FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

JRuby Classpath for Test

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
maffam



Joined: 02 Apr 2009
Posts: 2

PostPosted: Thu Apr 02, 2009 6:03 am    Post subject: JRuby Classpath for Test Reply with quote

We're using log4j with our JRuby app so in order to configure Netbeans to find the .jar we use
(project)->Properties->Java->JRubyClasspath->Add JAR/Folder and select the correct .jar file.

This works fine with both NetBeans 6.5 and 6.7M2 such that we can Run->'Run Main Project' successfully, but if we try to use Run->'Test Project (name)', we get the error as if the classpath is not respected for testing, i.e.

C:\Program Files\NetBeans 6.7 M2\ruby2\nb_test_mediator.rb:98:in `require_file': cannot load Java class org.apache.log4j.Logger (NameError)
from C:\Program Files\NetBeans 6.7 M2\ruby2\nb_test_mediator.rb:111:in `add_to_suites'

This is under Windows where the CLASSPATH environment variable is set correctly - that is, we don't have the problem when running tests at the command line outside of Netbeans.

So is there something else that needs to be set or some other way we need to set JRuby Classpath in order to get it to recognize this .jar during testing?

Thanks very much for your help.

Mike
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Thu Apr 02, 2009 7:51 am    Post subject: JRuby Classpath for Test Reply with quote

Hi Mike,

This seems to be a bug. I can think of two workarounds:

- create a rake task for running tests, in that case the classpath
should get set correctly. Note that the name of the task has to be
"test" or start with "test:" for the UI test runner to recognize it (see
http://wiki.netbeans.org/RubyTesting#section-RubyTesting-RakeIntegration
if you'd like to use some other name).

- copy the .jar files you use to <jruby install dir>/lib

Can you please file an issue for this at
http://www.netbeans.org/issues/enter_bug.cgi (against the ruby/testing
component)? I'll fix it in any case, but it's better to file an issue if
you want to track the progress and be notified when it gets fixed.

Thanks,
Erno


maffam wrote:
Quote:
We're using log4j with our JRuby app so in order to configure Netbeans to find the .jar we use

(project)->Properties->Java->JRubyClasspath->Add JAR/Folder and select the correct .jar file.



This works fine with both NetBeans 6.5 and 6.7M2 such that we can Run->'Run Main Project' successfully, but if we try to use Run->'Test Project (name)', we get the error as if the classpath is not respected for testing, i.e.



C:\Program Files\NetBeans 6.7 M2\ruby2\nb_test_mediator.rb:98:in `require_file': cannot load Java class org.apache.log4j.Logger (NameError)

from C:\Program Files\NetBeans 6.7 M2\ruby2\nb_test_mediator.rb:111:in `add_to_suites'



This is under Windows where the CLASSPATH environment variable is set correctly - that is, we don't have the problem when running tests at the command line outside of Netbeans.



So is there something else that needs to be set or some other way we need to set JRuby Classpath in order to get it to recognize this .jar during testing?



Thanks very much for your help.



Mike











Back to top
maffam



Joined: 02 Apr 2009
Posts: 2

PostPosted: Thu Apr 02, 2009 2:47 pm    Post subject: created as Issue 161780 Reply with quote

Erno,

Thanks very much for the quick response. I created the issue as Issue 161780. And thanks for the suggestions for the workarounds, we went with the second one.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB