Classloading mumbo jumbo

View: New views
3 Messages — Rating Filter:   Alert me  

Classloading mumbo jumbo

by Alan.Cabrera :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you look at the last test that I checked in you'll see that I have  
to set the context classloader.  Not exactly elegant.  What do others  
think?


Regards,
Alan


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

    http://xircles.codehaus.org/manage_email



Re: Classloading mumbo jumbo

by simonebordet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Fri, Oct 16, 2009 at 23:52, Alan D. Cabrera <adc@...> wrote:
> If you look at the last test that I checked in you'll see that I have to set
> the context classloader.  Not exactly elegant.  What do others think?

Why you had to set the context classloader ?
Is this needed by the user of JUnit4 ?
AFAICT, livetribe-slp does not need the set of the context
classloader, so this is either an artifact of the tests or of osgi ?

Can you also explain why we need to depend on 3 other project for just 2 tests ?
What benefits bring ops4j, junit4, hamcrest ?
For example, the overflow test written without hamcrest is shorter and
more speaking.

Simon
--
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz

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

    http://xircles.codehaus.org/manage_email



Re: Classloading mumbo jumbo

by Alan.Cabrera :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 19, 2009, at 1:34 AM, Simone Bordet wrote:

> Hi,
>
> On Fri, Oct 16, 2009 at 23:52, Alan D. Cabrera <adc@...>  
> wrote:
>> If you look at the last test that I checked in you'll see that I  
>> have to set
>> the context classloader.  Not exactly elegant.  What do others think?
>
> Why you had to set the context classloader ?
> Is this needed by the user of JUnit4 ?
> AFAICT, livetribe-slp does not need the set of the context
> classloader, so this is either an artifact of the tests or of osgi ?

It's an OSGi thing.  Your SLP factory building code uses that  
classloader to load the classes.  PAX Exam runs the unit tests as if  
they are bundles.  So when the test executes the context classloader  
is the unit test bundle's bundle classloader.  The problem is that the  
default properties file is not in a package that this classloader can  
pick up.

Maybe a solution would be to put the properties file in  
org.livetribe.slp.

> Can you also explain why we need to depend on 3 other project for  
> just 2 tests ?

Well, there are going to be a more tests.

> What benefits bring ops4j

Runs tests in an OSGi container.

> junit4

Needed by ops4j but I think it would be nice if they supported  
testingng; going to look into this.

> hamcrest ?
> For example, the overflow test written without hamcrest is shorter and
> more speaking.

I like hamcrest in general.  I agree your test was better.


Regards,
Alan


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

    http://xircles.codehaus.org/manage_email