Hi Thomas.

Thanks for your reply, but i still didn't manage to get it working.

On Apr 29, 12:23 pm, Thomas Broyer <[email protected]> wrote:
> On 28 avr, 18:50, "[email protected]" <[email protected]>
> wrote:
>
> > Hi.
>
> > I apologize if this was already asked before, but i couldn't find
> > anything in the archives or in the docs.
>
> > I'm using an external javascript library, using JSNI for accessing the
> > native javascript from my GWT java code.
>
> > I include these libraries in my host page using the <script> tag. My
> > question is regarding GWTTestCase(s). It seems that a www-test
> > directory gets created with some specific hosted.html page, which i
> > guess is the host page being used to run the tests.
>
> > How do i make the external javascript library i want to use available
> > to the test case?
>
> Reference them in your test module's gwt.xml using a <script />
> element (you could do the same in your "non-test" module instead of
> including the <script></script> elements in your host page).
>
> This means you should create a test module, if you haven't already,
> and adjust the getModuleName return value of you GWTTestCase classes
> accordingly.

I've tried a new module with the tests - though i didn't really
understand why it makes a difference. But i got different issues, so i
went back to creating a simple new project to see if i understand what
goes on.

Here's what i have:

A TestProject on package com.testing, with the default classes created
by the google eclipse plugin. Works in hosted mode and web mode. So i
added a 'test.js' which should be included. Placed the file under the
'war' directory, and referenced it via the TestProject.gwt.xml file:
<script src="/test.js"></script>

A JSNI method works great both in hosted and web mode, calling a
function defined in 'test.js' - referenced via $wnd.functionName().

Now for GWTTestCase. I defined one under the 'test' directory (putting
it in 'src' makes no difference in the results i get), which doesn't
even call any JSNI method. Added junit4.jar to my eclipse project,
added to the TestProject.gwt.xml file:
<inherits name='com.google.gwt.junit.JUnit'/>

and when the test is launched the compilation phase works but right
after i get this:
...
   Compilation succeeded -- 17.159s
Loading module 'test.js'
   [ERROR] Unable to find 'test/js.gwt.xml' on your classpath; could
be a typo, or maybe you forgot to include a classpath entry for
source?
Loading module 'test.js'
   [ERROR] Unable to find 'test/js.gwt.xml' on your classpath; could
be a typo, or maybe you forgot to include a classpath entry for
source?
The development shell servlet received a request to generate a host
page for module 'test.js'
   Loading module 'test.js'
      [ERROR] Unable to find 'test/js.gwt.xml' on your classpath;
could be a typo, or maybe you forgot to include a classpath entry for
source?

Where is this coming from? I've changed it to pretty mode to see if i
could find anything obvious, but i couldn't. I'm sure i'm doing
something stupid, but can't make it work.

Thanks,
Ricardo

PS: For reference i've been doing this using a build from the trunk
checked out a couple weeks ago to benefit from OOPHM, but trying it
with 1.6.4 later gives me the same results
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to