diff --git a/jira/LICENSE b/jira/LICENSE new file mode 100644 index 0000000..9c6ab63 --- /dev/null +++ b/jira/LICENSE @@ -0,0 +1,6 @@ +To avoid future confusion, we recommend that you include a license with your plugin. +This file is simply a reminder. + +For a template license you can have a look at: http://www.opensource.org/licenses/ + +Atlassian releases most of its modules under the Apache2 license: http://opensource.org/licenses/Apache-2.0 diff --git a/jira/README b/jira/README new file mode 100644 index 0000000..94e6a43 --- /dev/null +++ b/jira/README @@ -0,0 +1,13 @@ +You have successfully created an Atlassian Plugin! + +Here are the SDK commands you'll use immediately: + +* atlas-run -- installs this plugin into the product and starts it on localhost +* atlas-debug -- same as atlas-run, but allows a debugger to attach at port 5005 +* atlas-cli -- after atlas-run or atlas-debug, opens a Maven command line window: + - 'pi' reinstalls the plugin into the running product instance +* atlas-help -- prints description for all commands in the SDK + +Full documentation is always available at: + +https://developer.atlassian.com/display/DOCS/Introduction+to+the+Atlassian+Plugin+SDK diff --git a/jira/pom.xml b/jira/pom.xml new file mode 100644 index 0000000..90a52ea --- /dev/null +++ b/jira/pom.xml @@ -0,0 +1,116 @@ + + + + + 4.0.0 + com.change_vision + jira-test-runtime + 1.0-SNAPSHOT + + + Example Company + http://www.example.com/ + + + test + This is the com.change_vision.test:test plugin for Atlassian JIRA. + atlassian-plugin + + + + com.atlassian.jira + jira-api + ${jira.version} + provided + + + + + + junit + junit + 4.10 + test + + + + + com.atlassian.plugins + atlassian-plugins-osgi-testrunner + ${plugin.testrunner.version} + test + + + javax.ws.rs + jsr311-api + 1.1.1 + provided + + + com.google.code.gson + gson + 2.2.2-atlassian-1 + + + + + + + + + + + com.atlassian.maven.plugins + maven-jira-plugin + ${amps.version} + true + + ${jira.version} + ${jira.version} + + + + + + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + + 6.0.2 + 4.2.2 + 1.1.1 + + 5.2.26 + + + diff --git a/jira/src/main/java/com/change_vision/test/MyPluginComponent.java b/jira/src/main/java/com/change_vision/test/MyPluginComponent.java new file mode 100644 index 0000000..b8596fa --- /dev/null +++ b/jira/src/main/java/com/change_vision/test/MyPluginComponent.java @@ -0,0 +1,6 @@ +package com.change_vision.test; + +public interface MyPluginComponent +{ + String getName(); +} \ No newline at end of file diff --git a/jira/src/main/java/com/change_vision/test/MyPluginComponentImpl.java b/jira/src/main/java/com/change_vision/test/MyPluginComponentImpl.java new file mode 100644 index 0000000..bf982bc --- /dev/null +++ b/jira/src/main/java/com/change_vision/test/MyPluginComponentImpl.java @@ -0,0 +1,23 @@ +package com.change_vision.test; + +import com.atlassian.sal.api.ApplicationProperties; + +public class MyPluginComponentImpl implements MyPluginComponent +{ + private final ApplicationProperties applicationProperties; + + public MyPluginComponentImpl(ApplicationProperties applicationProperties) + { + this.applicationProperties = applicationProperties; + } + + public String getName() + { + if(null != applicationProperties) + { + return "myComponent:" + applicationProperties.getDisplayName(); + } + + return "myComponent"; + } +} \ No newline at end of file diff --git a/jira/src/main/resources/atlassian-plugin.xml b/jira/src/main/resources/atlassian-plugin.xml new file mode 100644 index 0000000..fa29554 --- /dev/null +++ b/jira/src/main/resources/atlassian-plugin.xml @@ -0,0 +1,32 @@ + + + ${project.description} + ${project.version} + + images/pluginIcon.png + images/pluginLogo.png + + + + + + + + com.atlassian.auiplugin:ajs + + + + + + test + + + + + com.change_vision.test.MyPluginComponent + + + + + + \ No newline at end of file diff --git a/jira/src/main/resources/css/test.css b/jira/src/main/resources/css/test.css new file mode 100644 index 0000000..e69de29 diff --git a/jira/src/main/resources/images/pluginIcon.png b/jira/src/main/resources/images/pluginIcon.png new file mode 100644 index 0000000..798d9e2 Binary files /dev/null and b/jira/src/main/resources/images/pluginIcon.png differ diff --git a/jira/src/main/resources/images/pluginLogo.png b/jira/src/main/resources/images/pluginLogo.png new file mode 100644 index 0000000..48143ec Binary files /dev/null and b/jira/src/main/resources/images/pluginLogo.png differ diff --git a/jira/src/main/resources/js/test.js b/jira/src/main/resources/js/test.js new file mode 100644 index 0000000..e69de29 diff --git a/jira/src/main/resources/test.properties b/jira/src/main/resources/test.properties new file mode 100644 index 0000000..8ddfdd1 --- /dev/null +++ b/jira/src/main/resources/test.properties @@ -0,0 +1,2 @@ +#put any key/value pairs here +my.plugin.name=MyPlugin \ No newline at end of file diff --git a/jira/src/test/java/it/com/change_vision/test/MyComponentWiredTest.java b/jira/src/test/java/it/com/change_vision/test/MyComponentWiredTest.java new file mode 100644 index 0000000..dba7e14 --- /dev/null +++ b/jira/src/test/java/it/com/change_vision/test/MyComponentWiredTest.java @@ -0,0 +1,28 @@ +package it.com.change_vision.test; + +import org.junit.Test; +import org.junit.runner.RunWith; +import com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner; +import com.change_vision.test.MyPluginComponent; +import com.atlassian.sal.api.ApplicationProperties; + +import static org.junit.Assert.assertEquals; + +@RunWith(AtlassianPluginsTestRunner.class) +public class MyComponentWiredTest +{ + private final ApplicationProperties applicationProperties; + private final MyPluginComponent myPluginComponent; + + public MyComponentWiredTest(ApplicationProperties applicationProperties,MyPluginComponent myPluginComponent) + { + this.applicationProperties = applicationProperties; + this.myPluginComponent = myPluginComponent; + } + + @Test + public void testMyName() + { + assertEquals("names do not match!", "myComponent:" + applicationProperties.getDisplayName(),myPluginComponent.getName()); + } +} \ No newline at end of file diff --git a/jira/src/test/java/ut/com/change_vision/test/MyComponentUnitTest.java b/jira/src/test/java/ut/com/change_vision/test/MyComponentUnitTest.java new file mode 100644 index 0000000..eea63a8 --- /dev/null +++ b/jira/src/test/java/ut/com/change_vision/test/MyComponentUnitTest.java @@ -0,0 +1,17 @@ +package ut.com.change_vision.test; + +import org.junit.Test; +import com.change_vision.test.MyPluginComponent; +import com.change_vision.test.MyPluginComponentImpl; + +import static org.junit.Assert.assertEquals; + +public class MyComponentUnitTest +{ + @Test + public void testMyName() + { + MyPluginComponent component = new MyPluginComponentImpl(null); + assertEquals("names do not match!", "myComponent",component.getName()); + } +} \ No newline at end of file diff --git a/jira/src/test/resources/atlassian-plugin.xml b/jira/src/test/resources/atlassian-plugin.xml new file mode 100644 index 0000000..557cfd3 --- /dev/null +++ b/jira/src/test/resources/atlassian-plugin.xml @@ -0,0 +1,14 @@ + + + ${project.description} + ${project.version} + + + + + + + + + + \ No newline at end of file