Problema:
Ao tentar rodar os testes em uma classe que é filha de GWTTestCase apresentou a seguinte mensagem de erro:
com.google.gwt.junit.JUnitFatalLaunchException: The test class 'stories.SomeStoryTest' was not found in module 'com.appspot.projectname.ProjectName; no compilation unit for that type was seen
at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:390)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:626)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:346)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:219)
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:132)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Motivo:
A classe de teste SomeStoryTest deve estar no mesmo pacote do módulo do projeto, ou em em um pacote interno.
Solução:
Adequar o caminho da classe de teste. No exemplo atual devemos mudar o caminho de story.SomeStoryTest para com.appspot.projectname.client.SomeStoryTest ou algum pacote interno a cliente, como para com.appspot.projectname.client.stories.SomeStoryTest
Links relacionados:
http://code.google.com/intl/pt-BR/webtoolkit/doc/1.6/DevGuideTesting.html
http://www.ibm.com/developerworks/java/library/j-cq07247/index.html
No comments:
Post a Comment