Traditional Integration Test example fail with No tests found in class

I've tried the Step 2. Create a Traditional Integration Test from the online tutorial, but failed with "No tests found in class":

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running it.org.raboss.dev.atlassian.jira.MyComponentWiredTest
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/bossekr/.m2/repository/org/slf4j/slf4j-log4j12/1.7.9/slf4j-log4j12-1.7.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/bossekr/.m2/repository/org/slf4j/slf4j-simple/1.6.4/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[INFO] [talledLocalContainer] Feb 29, 2016 10:28:38 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
[INFO] [talledLocalContainer] INFO: Initiating Jersey application, version 'Jersey: 1.8-atlassian-16 03/23/2015 10:20 PM'
[INFO] [talledLocalContainer] Feb 29, 2016 10:28:38 PM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
[INFO] [talledLocalContainer] INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
[INFO] [talledLocalContainer] Feb 29, 2016 10:28:38 PM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
[INFO] [talledLocalContainer] INFO: Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport
[INFO] [talledLocalContainer] Feb 29, 2016 10:28:38 PM com.sun.jersey.api.wadl.config.WadlGeneratorLoader loadWadlGenerator
[INFO] [talledLocalContainer] INFO: Loading wadlGenerator com.atlassian.plugins.rest.doclet.generators.resourcedoc.AtlassianWadlGeneratorResourceDocSupport
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.078 sec <<< FAILURE!
No tests found in class [it.org.raboss.dev.atlassian.jira.MyComponentWiredTest]  Time elapsed: 3.077 sec  <<< ERROR!
java.lang.Exception: No tests found in class [it.org.raboss.dev.atlassian.jira.MyComponentWiredTest]
	at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.runViaRestCall(AtlassianPluginsTestRunner.java:125)
	at com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner.run(AtlassianPluginsTestRunner.java:75)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Results :

Tests in error: 
  No tests found in class [it.org.raboss.dev.atlassian.jira.MyComponentWiredTest]: No tests found in class [it.org.raboss.dev.atlassian.jira.MyComponentWiredTest]

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

I'm starting the traditional integration test with

atlas-integration-test --version 6.4.12 --product jira

Application skeleton was created with

atlas-create-refapp-plugin

2 answers

Make sure that you have correct packaging - atlassian-plugin:

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>jira-plugin</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>atlassian-plugin</packaging>
<!-- (...) -->

Make sure there are no errors while running tests. In my case I was missing required dependencies in amps configuration:

<plugin>
    <groupId>com.atlassian.maven.plugins</groupId>
    <artifactId>maven-jira-plugin</artifactId>
    <version>${amps.version}</version>
    <extensions>true</extensions>
    <configuration>
        <allowGoogleTracking>false</allowGoogleTracking>
        <productVersion>${jira.version}</productVersion>
        <productDataVersion>${jira.version}</productDataVersion>
        <enableQuickReload>true</enableQuickReload>
        <enableFastdev>false</enableFastdev>
        <instructions>
            <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
            <Export-Package>
                com.example.jira.plugin
            </Export-Package>
            <Import-Package>
                com.example.jira.plugin;version="${project.version}",

When there are errors in logs, there will be report summary like this:

[INFO] [talledLocalContainer]     ___ FAILED PLUGIN REPORT _____________________
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     2 plugins failed to load during JIRA startup.

Followed by installation error cause.

If cause is like:

Unresolved constraint in bundle com.example.jira-plugin [175]: Unable to resolve 175.0: missing requirement [175.0] osgi.wiring.package; (osgi.wiring.package=some.package)

You must add it to AMPS export statement:

<instructions>
    <!-- Add package to export here -->
    <Export-Package>some.package</Export-Package>

You may find other useful AMPS configuration option in docs: https://developer.atlassian.com/docs/developer-tools/working-with-the-sdk/about-amps-build-options/amps-build-configuration-reference

Hope it helps.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

268 views 0 6
Read article

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