Posts Tagged ‘jvm’

JRuby & JTestR in Eclipse

August 11th, 2008

Continuing my rampage upon the JRuby community, I have achieved beautiful success with running my tests inside of the eclipse IDE as a JUnit test. Now I have limited knowledge in the JUnit realm and encourage those to improve upon my approach.

In your eclipse Package Manager sidebar, Right Click -#> Run As.. -#> Run Configurations. Go ahead and select ‘JUnit’ and hit the ‘New Launch Configuration’ button.

Fill in the configuration as follows:
[code language="plain"]* Run a single test
Project: your-project-name
Test class: org.jtestr.ant.JtestRSuite[/code]
Now just open the ‘Arguments’ tab and inside the ‘VM arguments:’ box
[code language="shell"]-Djtestr.junit.tests=rspec_tests[/code]
rspec_tests is the folder where my tests are stored, feel free to change this to something like /test/jtestr/funny_test or whatever structure you store your files in.

I am still trying to figure out a more effecient way to get these test to run under eclipse. Till than I can always fall back on this approach as well as the standard ant task.

Tags: , , , , ,
Posted in Development, JRuby, RSpec | Comments (1)

JtestR - alive and kicking

August 10th, 2008

Last week I posted about my JtestR problems and the lack of any solution. Well after some generous help from Ola Bini, JtestR’s lead developer, we found the problem. Apparently, you cannot run your Java application with the jtestr.jar file inside the root directory. The jar must be placed within a subdirectory, otherwise your Ruby runtime will try to include the JtestR.jar file through its require ‘jtestr’ statement. Its an odd quirk, with an easy workaround. Ola Bini has said its fixed in the latest trunk build, but to use the workaround until 0.4 comes out. I would like to thank him for all his help troubleshooting this issue. Cheers!

Tags: , , , , ,
Posted in JRuby, RSpec | Comments (0)