Hi,
I have a plugin class in src/main/java/com/example/impl/TargetImpl
that implements the interface in src/main/java/com/example/api/TargetApi
.
In my unit test in src/test/java/ut/com/example/TargetTest I use
TargetImpl x = new TargetImpl();
This works fine with atlas-unit-test, but when running it from the test console UI, I get java.lang.NoClassDefFoundError: com.example.impl.TargetImpl
What am I doing wrong? How can I make the OSGi container grant access to com.example.impl
?
Community moderators have prevented the ability to post new answers.
Well, I use some bad hacking to work around it. It is probable too complicated. I set up a service in the test plugin. If the main plugin starts up and detects the presence of that service, it asks it about the objects that need to be instantiated by the test plugin and provides java.lang.reflect.Constructor objects for them. The tests can then ask the service for instances and they are created by the service using reflection.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi. Would it be a big problem for you to show me how exactly you did it? I have similar issue and I'm just curious.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.