Confusion about excluding/including source files for a GWTTestCase

78 views
Skip to first unread message

laredotornado

unread,
Nov 16, 2011, 1:00:11 PM11/16/11
to Google Web Toolkit
Hi,

I'm using GWT 2.4 and trying to write a GWTTestCase, but must be
missing something fundamental. In my test case, I use an Apache
library

public void testParsingNodeWithAttributes() throws IOException,
ParserConfigurationException, SAXException {

But upon running the test, I get errors like

[ERROR] Line 36: No source code is available for type
javax.xml.parsers.ParserConfigurationException; did you forget to
inherit a required module?
[ERROR] Line 36: No source code is available for type
org.xml.sax.SAXException; did you forget to inherit a required module?
[ERROR] Line 39: No source code is available for type
org.junit.Assert; did you forget to inherit a required module?
[ERROR] Line 92: No source code is available for type
javax.xml.xpath.XPathExpressionException; did you forget to inherit a
required module?

Here is my test module file ...

<?xml version="1.0" encoding="UTF-8"?>
<module>
<!-- Inherit our applications main module. -->
<inherits name='com.myco.clearing.product.ProductPlus' />

<!-- Specify the path to any remote services. -->
<servlet path="/ProductPlus/greet"
class="com.myco.clearing.product.server.ProductServiceImpl" />

</module>


If I add this line to my .gwt.xml module ...

<source path='client' excludes="**/*Test.java" />

Then I get below error when I try and run my test case ...

com.google.gwt.junit.JUnitFatalLaunchException: The test class
'com.myco.clearing.product.client.commons.xml.XMLNodeTest' was not
found in module 'com.myco.clearing.product.ProductPlusJUnit'; no
compilation unit for that type was seen
at
com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:
743)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1346)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1309)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:
441)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:
83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
197)


Any ideas? Thanks, - Dave

Thomas Broyer

unread,
Nov 17, 2011, 7:24:57 AM11/17/11
to google-we...@googlegroups.com
The mentioned classes and interfaces are not part of the emulated runtime <http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.html#runtime> so either you should rewrite your test without them, or you're erroneously using a GWTTestCase where what you want is a simple JUnit test.
Reply all
Reply to author
Forward
0 new messages