GWT junit test in super dev mode???

200 views
Skip to first unread message

Daniel Kln

unread,
Feb 14, 2017, 5:52:33 AM2/14/17
to GWT Users
Hi, 

i setted in the run config the arg: -Dgwt.args="-runStyle Manual:1".

When i start running the gwt unit test, i get a link, which i have to paste into a browser of my choice. This is what i expected. But than the browser shows:

Development Mode requires the GWT Developer Plugin


My question: how i can avoid this problem. In production mode the same result appears. 

Thank you a lot for your help

Daniel
  

Velusamy Velu

unread,
Feb 14, 2017, 9:01:51 AM2/14/17
to GWT Users
I think if you provide details of your deployment process it could be easier to diagnose the issue.

Daniel Kln

unread,
Feb 14, 2017, 9:53:15 AM2/14/17
to GWT Users
Hi,

so i am using eclipse. Right click on the package, which contains the test class which extends from GWTTestCase -> Run as -> Run configurations -> Arguments -> VM arguments -> Setting argument -> Apply -> Run 

Console shows: 

Please navigate your browser to this URL:

pasting link into browser (i tried ff, chrome and edge)

Thank you

Daniel Kln

unread,
Feb 14, 2017, 9:56:30 AM2/14/17
to GWT Users
i am following this instruction (http://www.gwtproject.org/doc/latest/DevGuideTesting.html):

Running your test in Manual Mode

Manual-mode tests allow you to run unit tests manually on any browser. In this mode, the JUnitShell main class runs as usual on a specified GWT module, but instead of running the test immediately, it prints out a URL and waits for a browser to connect. You can manually cut and paste this URL into the browser of your choice, and the unit tests will run in that browser.

For example, if you want to run a test in a single browser, you would use the following arguments:

-runStyle Manual:1

GWT will then show a console message like the following:


Please navigate your browser to this
 URL:
http://172.29.212.75:58339/com.google.gwt.user.User.JUnit/junit.html?gwt.codesvr=172.29.212.75:42899

Point your browser to the specified URL, and the test will run. You may be prompted by the GWT Developer Plugin to accept the connection the first time the test is run.

Manual-mode test targets are not generated by the webAppCreator tool, but you can easily create one by copying the test.prod ant target in the build.xml file to test.manual and adding -runStyle Manual:1 to the -Dgwt.args part. Manual mode can also be used for remote browser testing.


Am Dienstag, 14. Februar 2017 11:52:33 UTC+1 schrieb Daniel Kln:

Daniel Kln

unread,
Feb 14, 2017, 9:59:38 AM2/14/17
to GWT Users
the image shows my browser result. they say in the text that this should happen, but it doesn t work. so i need an alternativ with the same result except selenium. 


Am Dienstag, 14. Februar 2017 11:52:33 UTC+1 schrieb Daniel Kln:
devplug.png

Jens

unread,
Feb 14, 2017, 10:13:12 AM2/14/17
to GWT Users
You have to use -Dgwt.args="-prod -runStyle Manual:1"  so that the test will be compiled to JS without the need of the legacy DevMode plugin.

-- J.

Daniel Kln

unread,
Feb 14, 2017, 10:18:31 AM2/14/17
to GWT Users
Hi Jens, 

i tried also tried your solution. Result:

java.lang.AssertionError
at com.google.gwt.dev.Permutation.assertSameAnswers(Permutation.java:105)
at com.google.gwt.dev.Permutation.mergeFrom(Permutation.java:80)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:322)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
at com.google.gwt.dev.Compiler.run(Compiler.java:206)
at com.google.gwt.junit.JUnitShell.compileForWebMode(JUnitShell.java:1093)
at com.google.gwt.junit.JUnitShell.maybeCompileForWebMode(JUnitShell.java:1151)
at com.google.gwt.junit.CompileStrategy.maybeCompileModuleImpl2(CompileStrategy.java:184)
at com.google.gwt.junit.CompileStrategy.maybeCompileModuleImpl(CompileStrategy.java:113)
at com.google.gwt.junit.SimpleCompileStrategy.maybeCompileModule(SimpleCompileStrategy.java:36)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1316)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:1284)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:678)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:421)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


Am Dienstag, 14. Februar 2017 11:52:33 UTC+1 schrieb Daniel Kln:

Daniel Kln

unread,
Feb 14, 2017, 10:23:26 AM2/14/17
to GWT Users
My source code:

@Override
    public String getModuleName() {
        return "de.abc.application.Application";
    }

    /***
     * Test 1
     */
    @Test
    public void testBrowserVersion() {

        System.out.println("Test 1: Starting test to validate the browser version");
        JsArray<JavaScriptObject> browserInformation = BrowserParameter.getBrowserVersion();
        System.out.println("Browser information: " + browserInformation);

        // do sth. with browserInformaton

        System.out.println("Test 1 finish");
    }

Am Dienstag, 14. Februar 2017 11:52:33 UTC+1 schrieb Daniel Kln:

Thomas Broyer

unread,
Feb 14, 2017, 11:38:21 AM2/14/17
to GWT Users
This looks like https://github.com/gwtproject/gwt/issues/9413
IIRC, it's triggered depending on how the tests are run, and which binding properties are defined in the gwt.xml files (in the reprocase for the issue, there's a binding property that's never used in any rebind rule; commenting it out fixes the issue).

Note that starting with GWT 2.8, tests run in -prod mode by default, so you no longer need to pass -prod in the -Dgwt.args (and this hints that you're not using 2.8 for your development ;-) )

Daniel Kln

unread,
Feb 14, 2017, 11:57:43 AM2/14/17
to GWT Users
Thank you thomas, caused by your hint i could find the mistake.

in my gwt.xml file i added a block comment around:

 <!--  <extend-property name="locale" values="de" />
  <extend-property name="locale" values="en" />-->

this solved the problem. 

Am Dienstag, 14. Februar 2017 11:52:33 UTC+1 schrieb Daniel Kln:

Thomas Broyer

unread,
Feb 14, 2017, 12:02:45 PM2/14/17
to GWT Users
One workaround that just came to my mind: because code does not run in Java (prod mode), you don't need to run tests with Java assertions enabled (i.e. remove -ea from JVM arguments); GWT assertions are governed by an -ea flag in -Dgwt.args=, independent from the -ea flag of the JVM.
HTH.

Daniel Kln

unread,
Feb 14, 2017, 12:45:42 PM2/14/17
to GWT Users
to remove the -ea argument worked too. i could remove the comment in my xml file and got a positive result.

Thank you

by the way, yes i am using gwt version 2.7


Am Dienstag, 14. Februar 2017 11:52:33 UTC+1 schrieb Daniel Kln:
Reply all
Reply to author
Forward
0 new messages