How to use additional libraries in wired tests

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:


And my test class is along the lines of:

public class MyTest {

    SimpleSmtpServer simpleSmtpServer;

    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?

4 answers

0 vote

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.

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...

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?

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.

0 vote

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?


- Jonathan

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted 4 hours ago in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

20 views 1 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot