That looks fine. Another way to do it is to use a ScriptingContainer. See spec/java_integration/utilities/jdbc_unloader_spec.rb for an example.
/Nick On Mon, Nov 7, 2011 at 3:15 AM, Uwe Kubosch <u...@kubosch.no> wrote: > Answering my own message: > > I now ensure the code is run in a fresh process like this: > > {noformat} > with_jruby_shell_spawning do > `bin/jruby -e "load File.join('file:', > File.join(File.expand_path(File.dirname('#{__FILE__}')), 'requireTest.jar!'), > 'A', 'B.rb') ; B"` > assert_equal 0, $? > end > {noformat} > > Thjs works. Anybody got an opinion on if this is a good way to do it? > > > On 2011-11-07, at 09:05, Uwe Kubosch wrote: > >> Hi all! >> >> I have written a load test for JRUBY-6172 that uncovers a case where load >> fails when it should succeed. The test fails correctly when run alone, but >> succeeds when run with another test that modifies the classpath. The test >> uses test/test_helper.rb to run code in a separate JRuby instance, but this >> does not seem to isolate the code with regards to classpath. >> >> Anybody got a tip on how to ensure a clean classpath while running a load >> test? >> >> >> >> -- >> Uwe Kubosch >> Systems Developer >> Datek Wireless AS >> u...@datek.no >> http://datek.no/ >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> > > -- > Uwe Kubosch > u...@kubosch.no > http://kubosch.no/ > > > > > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email