Wednesday, February 13, 2019

Re: Testing emulated jre classes

 
What should to go into src/test/super?

This can be used to super source classes for GWT compiler that you only use within GwtTestCase and not in your normal app code, e.g. some test library that only works with GWT if you super source some classes.

As a little extreme example you can take a look at GWT SDK itself which also uses test super sources. For example GWT SDK has a Java8Test class that should test the GWT compiler in terms of Java 8 language features like lambdas. But back in the day when this test had been created, GWT SDK was still compiled using Java 1.6. So adding a test with Java 8 language features would have failed to compile using javac. To solve this issue the whole test is just an empty placeholder and has been super sourced for GWT (and that super sourced class excluded from javac). That super sourced class has the actual tests.

The test visible to javac: 
https://github.com/gwtproject/gwt/blob/master/user/test/com/google/gwt/dev/jjs/test/Java8Test.java

The super sourced test visible to GWT compiler and thus the real GwtTestCase that will be executed: 
https://github.com/gwtproject/gwt/blob/master/user/test-super/com/google/gwt/dev/jjs/super/com/google/gwt/dev/jjs/test/Java8Test.java


-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment