Test Driven Development by Java2Script

Now, Java2Script support JUnit for Test Driven Development(TDD) in developing RIA.

To do so, please set up the J2S development environment from SVN repository. If you would like to learn more details about JUnit support of J2S, you may need to checkout the project net.sf.j2s.java.junit.

After setup J2S environment, do your “Hello J2S World” examples for sure. And then create or import your testcases or testsuites. Make sure that your tests pass in Java’s JUnit test. And then “Run as…” -> “Java2Script Unit Test”, your tests will be run in console mode. You may come up with some failures in Java2Script mode even though all tests is passed in Java mode. For example, assertEquals(new Float(1.0).toString(), “1.0”) may result in comparing “1” with “1.0”, which will be considered as failures. Try to report bugs or try to avoid such buggy way.

Currently, JUnit tests over SWT are not supported yet.

Java2Script’s JUnit support will be in the next milestone release scheduled on middle of August.

This entry was posted in How To, Java2Script News. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *