JsTester

JsTester allows validation of javaScript code inside java. It provides a group of assert methods like JUnit's Assert, it also supports the validations described in http://javascript.crockford.com/remedial.html, and the ability to use your own validations (unary & binary predicates).
The project provides two ways of creating your tests: by inheritance (JsTestCase), and by composition (JsTester). Use JsTestCase as you would normally use any extension of TestCase. Use JsTester with TestNG or JUnit4 and annotations, or inside another TestCase hierarchy.

There are three versions:

  1. compiled with JDK1.4 as target (for both JUnit 3.x and TestNG)
  2. compiled with JDK5.0 as target (will work with JUnit 3,x TestNG and JUnit 4.x)
  3. compiled with JDK6.0 as target (will work with JUnit 3,x TestNG and JUnit 4.x) and includes support for JDK6 javax.script as alternative to js-rhino
This means as of version 1.2 JsTester will no longer be JDK1.3.1 compatible.

The project was born as a necessity to test JSON code generated by json-lib.