I'm trying to use a library inside a wired integration test. In this case Dumbster to setup a simple SMTP server.
I have this dep in my pom.xml:
<dependency> <groupId>dumbster</groupId> <artifactId>dumbster</artifactId> <version>1.6</version> <scope>test</scope> </dependency>
And my test class is along the lines of:
@RunWith(AtlassianPluginsTestRunner.class) public class MyTest { SimpleSmtpServer simpleSmtpServer; @Before public void setUp() throws Exception { simpleSmtpServer = SimpleSmtpServer.start(); } }
But i'm getting: a ClassNotFoundException when I try to run the test from the test console.
I've tried various fiddles with OSGi Export/Import-Package instructions in both the test atlassian-plugin.xml and the <testInstructions> of the maven amps plugin config with no luck.
My colleagues have also had similiar problems with other libs.
Any ideas?
I don't think your deps have to be OSGi bundles if they are in META-INF/lib.
However, atlas-debug and cli/tpi should be building the same artifact.
Would it be possible for you to send me your project source so i can test locally and figure out what's going on?
Thanks,
- Jonathan
I appear to have found another problem following on from this. My test plugin works fine when initially built from an 'atlas-debug'.
When I make a simple change in the test class and hit 'Scan for Tests', the test plugin is rebuilt (via the fastdev cli/tpi call). It's now almost 2Mb in size and contains lots of deps in the META-INF/lib. The original size was approx 8k and didn't contain these! The test plugin then fails to install correctly listing lots of spring wiring exceptions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, at some point during my fiddling the dumbster jar was included in the META-INF/lib along with all other test dependencies - but now they aren't, not sure exactly what I did. ANYWAY - it wasn't an OSGi bundle, but I have found it bundled as OSGi here... http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.com.dumbster.smtp&version=1.6.0
So, I've included that as a pluginArtifact and test dependency, and it's looking good so far - now just need to fix my test ;)
Although having to turn these things into bundles, or manually exploding them seems a bit of a pain - is there someway we could list dependencies that need to be exploded?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Mark,
Can you tell me if the dumbster jar is in your test plugin jar inside META-INF/lib ?
Also, is dumbster an OSGi bundle? If not, you'll need to either make it an OSGi bundle, or package it exploded in your test plugin jar so that the maven-bundle plugin creates the proper manifest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.