Procedures/Standards for testing:

Software Requirements
---------------------
Testing is done with JUnit (http://www.junit.org).
To run the JUnit ant tasks, you also need the optional ant tasks jar file from http://jakarta.apache.org/site/binindex.html

The default build.xml is setup to look for the JUnit jar file under $JRUBY_HOME/lib.  The optional ant tasks should be put in $ANT_HOME/lib/optional.jar.


Writing Tests
-------------

1) Java unit tests with JUnit:

Tests for classes should be put in a "test" subpackage of the original class's package.  For example, org.jruby.RubyModule's tests should go in org.jruby.test.  Test files should be named: Test${classname}.java (e.g. TestRubyModule.java).  After creating individual tests, each test class should be added to the main test suite at org.jruby.test.MainTestSuite.

Before checking in your changes, be sure to run the full test suite with the following command line:

	ant test

..or, if you don't have the ant JUnit task:

	java junit.textui.TestRunner org.jruby.test.MainTestSuite

This will ensure that your changes not only work by themselves but haven't caused problems elsewhere in the source.

Unit tests should ALWAYS run at 100% pass rate when checked into CVS.


2) Ruby tests with minirunit:

When implementing new methods on the builtin classes the easiest way is to write the tests in Ruby. It also makes it possible to verify the tests against the original Ruby interpreter (MRI).
In the folder "test" you will find JRuby's own tests, and in "test/mri" some tests taken from MRI. Run all of them with:

        ./jruby.sh test/testSuite.rb
or
        jruby.bat test/testSuite.rb


3) Using Rubicon:

To use Rubicon for testing you must first install it. Get it from CVS with

        cvs -d:pserver:anonymous@cvs.ruby-lang.org:/src login
        cvs -d:pserver:anonymous@cvs.ruby-lang.org:/src co rubicon

Then follow Rubicon's README on how to install and run it.

You must first install RubyUnit in your original Ruby interpreter (1.6 required). Then copy the lib directory from that to your JRUBY_HOME directory. (If you built jruby from CVS it is the build directory). You should then run
        <jruby> mkconfig.rb
(Replace <jruby> with the platform-dependent start script).
Now your JRuby is ready to (partially) run Rubicon.
