buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Hugo Borja <vic.bo...@gmail.com>
Subject Re: running JUnit tests fails with buildr trunk and JRuby
Date Mon, 07 Apr 2008 19:39:02 GMT
Tomas Carlsson wrote:
> buildr-trunk, JRuby 1.1, Windows XP
> 
> I set up a very simple test project with one java class and one test java
> class with Junit annotations. Running "jruby -S buildr test" fails with:
> java.lang.IllegalArgumentException: null
> 
> Parts of --trace is included below, it indicates a null ref when looking up
> the ant.jar location if I'm not mistaken.
> 
> Anyone seen this before? Anyone been able to run JUnit tests with buildr on
> JRuby?
> 
> /tomas
> 
> ** Invoke buildr-test-test:test:setup (first_time)
> ** Execute buildr-test-test:test:setup
> ** Execute buildr-test-test:test
> Running tests in buildr-test-test
> redefining Project
> D, [2008-04-07T17:43:57.413434 #3380] DEBUG -- : Apache Ant version 1.7.0
> compiled on December 13 2006
> ** Invoke buildr-test-test:test:teardown (first_time)
> ** Execute buildr-test-test:test:teardown
> rake aborted!
> java.lang.IllegalArgumentException: null
> java/net/URI.java:842:in `create'
> sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
> sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
> sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
> java/lang/reflect/Method.java:597:in `invoke'
> org/apache/tools/ant/launch/Locator.java:162:in `fromURI'
> org/apache/tools/ant/launch/Locator.java:119:in `getResourceSource'
> org/apache/tools/ant/launch/Locator.java:90:in `getClassSource'
> org/apache/tools/ant/Project.java:313:in `setAntLib'
> org/apache/tools/ant/Project.java:309:in `initProperties'
> org/apache/tools/ant/Project.java:295:in `init'
> sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
> sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
> sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
> java/lang/reflect/Method.java:597:in `invoke'
> org/jruby/javasupport/JavaMethod.java:251:in `invokeWithExceptionHandling'
> 

That seems to be a classpath issue on windows (never seen this on my 
linux env). I tested with a simple ant invocation:

   task :echo do
     ant('echo') do |ant|
       ant.echo :message => "Hello World"
     end
   end

got the same error you have, however if ant jars are in the CLASSPATH 
environment variable when invoking jruby everyting works ok. So I think
this is related to how the classpath is updated by buildr/java/jruby.rb,
I'll try to check this as soon as I can.

Greetings!
-- 
   vic



Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message