logo       

Re: [jruby-user] Classpath in JRuby: msg#00234

lang.jruby.user

Subject: Re: [jruby-user] Classpath in JRuby

Yes of course i did:

The TestCase:

$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
require 'uems_client'
require 'test/unit'

Dir['*.jar'].each {|x| require x}

class ManyLoginsTest < Test::Unit::TestCase

  include UemsClient

  def setup
    set_url("http://localhost:8080/uems")
    set_service_name("RegistryQueryService")
  end

  def test_login
    login('uemsadmin', 'uemsadmin', 100)
  end

end

_____________________________________________________

The Command:

> jruby many_logins.rb
Loaded suite many_logins
Started
1
E
Finished in 0.875 seconds.

  1) Error:
test_login(ManyLoginsTest):
NativeException: java.lang.IllegalArgumentException : interface com.fortent.uems.service.RegistryQuery is not visible from
class loader
    Proxy.java:353:in `java.lang.reflect.Proxy.getProxyClass'
    Proxy.java:581:in `java.lang.reflect.Proxy.newProxyInstance'

_____________________________________________________

The Library:

> jar -tf uems-common-1.2.0-SNAPSHOT.jar | grep RegistryQuery
com/fortent/uems/service/DeltaRegistryQuery.class
com/fortent/uems/service/RegistryQuery.class


Anything odd?
Jason

On Nov 30, 2007 12:43 PM, Nick Sieger <nicksieger@xxxxxxxxx> wrote:
On 11/28/07, Jason Vinson <vinsonizer@xxxxxxxxx> wrote:
> Hi,
>
> I am running some TestUnit testcases to exercise remote Java apis with JRuby
> and it's all working great.  One thing that I have to do to run these tests
> is include some specific jars on the classpath.  I've found that I can
> construct the classpath manually, but I wanted to see if there was a more
> elegant solution.  I also know I can use the JRUBY_HOME/lib dir, but i'd
> rather not pollute it with these jars, as they will change over time as the
> code is developed.
>
> What i was hoping (which is probably impossible) was that I could do
> something like this:
>
> Dir['jars/*.jar'].each {|x| require x}
>
> The above obviously doesn't work, but I thought it sure looked nice  :)
>
> Are there any elegant solutions that are available that I am missing?
>

Did you try it?

/Nick

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise