I just did a quick check and deleted the @Configuration annotation from one of my tests, and I ended up with a NoClassDefFound similar to yours.

I would have expected Pax Exam to cleanly fail with a NoConfigurationFoundException or so, but this is not currently the case - I can't think of meaningful use cases without a configuration, but then again, who knows...

The JUnit4ClassRunner simply looks for all @Configuration-annotated methods and adds them to the Reactor. The reactor is happy to start with an empty configuration and only logs a DEBUG level message, which is clearly not enough.

So there is an issue for Pax Exam to provide better feedback, but the root cause of your problem really seems to be Scala putting the static method in the wrong class.

Best regards,

Harald

Am 08.08.2011 20:50, schrieb Samuel Cox:
Toni, thanks for that.  I'll search through the source.

However, I just noticed something that might be pretty important.

If you want a static method in Scala, you have to do something like:

class A {
   def instanceMethod() = 1
}

object A {
   def staticMethod() = 2
}

Scala tries  hard to have this end up generating bytecode like:

class A {
   int instanceMethod() { return 1; }
   static int staticMethod() { return 2; }
}

However, this doesn't always work.  In my case, my @Configuration
annotated method is ending up in a class named, ServiceTest$, whereas
the actual unit test is named, ServiceTest.  I'm assuming that is
going to cause problems...



_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to