diff --git a/src/main/java/jenkins/plugins/slack/SlackNotifier.java b/src/main/java/jenkins/plugins/slack/SlackNotifier.java index 20dc3e66..a9628b31 100755 --- a/src/main/java/jenkins/plugins/slack/SlackNotifier.java +++ b/src/main/java/jenkins/plugins/slack/SlackNotifier.java @@ -7,20 +7,24 @@ import hudson.model.AbstractProject; import hudson.model.BuildListener; import hudson.model.Descriptor; +import hudson.model.listeners.ItemListener; import hudson.tasks.BuildStepDescriptor; import hudson.tasks.BuildStepMonitor; import hudson.tasks.Notifier; import hudson.tasks.Publisher; import hudson.util.FormValidation; +import jenkins.model.Jenkins; import jenkins.model.JenkinsLocationConfiguration; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.export.Exported; import java.io.IOException; import java.util.Map; +import java.util.logging.Level; import java.util.logging.Logger; public class SlackNotifier extends Notifier { @@ -325,4 +329,202 @@ public FormValidation doTestConnection(@QueryParameter("slackTeamDomain") final } } } + + @Deprecated + public static class SlackJobProperty extends hudson.model.JobProperty> { + + private String teamDomain; + private String token; + private String room; + private boolean startNotification; + private boolean notifySuccess; + private boolean notifyAborted; + private boolean notifyNotBuilt; + private boolean notifyUnstable; + private boolean notifyFailure; + private boolean notifyBackToNormal; + private boolean notifyRepeatedFailure; + private boolean includeTestSummary; + private boolean showCommitList; + private boolean includeCustomMessage; + private String customMessage; + + @DataBoundConstructor + public SlackJobProperty(String teamDomain, + String token, + String room, + boolean startNotification, + boolean notifyAborted, + boolean notifyFailure, + boolean notifyNotBuilt, + boolean notifySuccess, + boolean notifyUnstable, + boolean notifyBackToNormal, + boolean notifyRepeatedFailure, + boolean includeTestSummary, + boolean showCommitList, + boolean includeCustomMessage, + String customMessage) { + this.teamDomain = teamDomain; + this.token = token; + this.room = room; + this.startNotification = startNotification; + this.notifyAborted = notifyAborted; + this.notifyFailure = notifyFailure; + this.notifyNotBuilt = notifyNotBuilt; + this.notifySuccess = notifySuccess; + this.notifyUnstable = notifyUnstable; + this.notifyBackToNormal = notifyBackToNormal; + this.notifyRepeatedFailure = notifyRepeatedFailure; + this.includeTestSummary = includeTestSummary; + this.showCommitList = showCommitList; + this.includeCustomMessage = includeCustomMessage; + this.customMessage = customMessage; + } + + @Exported + public String getTeamDomain() { + return teamDomain; + } + + @Exported + public String getToken() { + return token; + } + + @Exported + public String getRoom() { + return room; + } + + @Exported + public boolean getStartNotification() { + return startNotification; + } + + @Exported + public boolean getNotifySuccess() { + return notifySuccess; + } + + @Exported + public boolean getShowCommitList() { + return showCommitList; + } + + @Override + public boolean prebuild(AbstractBuild build, BuildListener listener) { + return super.prebuild(build, listener); + } + + @Exported + public boolean getNotifyAborted() { + return notifyAborted; + } + + @Exported + public boolean getNotifyFailure() { + return notifyFailure; + } + + @Exported + public boolean getNotifyNotBuilt() { + return notifyNotBuilt; + } + + @Exported + public boolean getNotifyUnstable() { + return notifyUnstable; + } + + @Exported + public boolean getNotifyBackToNormal() { + return notifyBackToNormal; + } + + @Exported + public boolean includeTestSummary() { + return includeTestSummary; + } + + @Exported + public boolean getNotifyRepeatedFailure() { + return notifyRepeatedFailure; + } + + @Exported + public boolean includeCustomMessage() { + return includeCustomMessage; + } + + @Exported + public String getCustomMessage() { + return customMessage; + } + + } + + @Extension public static final class Migrator extends ItemListener { + @SuppressWarnings("deprecation") + @Override + public void onLoaded() { + logger.info("Starting Settings Migration Process"); + for (AbstractProject p : Jenkins.getInstance().getAllItems(AbstractProject.class)) { + logger.info("processing Job: " + p.getName()); + + final SlackJobProperty slackJobProperty = p.getProperty(SlackJobProperty.class); + + if (slackJobProperty == null) { + logger.info(String + .format("Configuration is already up to date for \"%s\", skipping migration", + p.getName())); + continue; + } + + SlackNotifier slackNotifier = p.getPublishersList().get(SlackNotifier.class); + + if (slackNotifier == null) { + logger.info(String + .format("Configuration does not have a notifier for \"%s\", not migrating settings", + p.getName())); + } else { + + //map settings + if (StringUtils.isBlank(slackNotifier.teamDomain)) { + slackNotifier.teamDomain = slackJobProperty.getTeamDomain(); + } + if (StringUtils.isBlank(slackNotifier.authToken)) { + slackNotifier.authToken = slackJobProperty.getToken(); + } + if (StringUtils.isBlank(slackNotifier.room)) { + slackNotifier.room = slackJobProperty.getRoom(); + } + + slackNotifier.startNotification = slackJobProperty.getStartNotification(); + + slackNotifier.notifyAborted = slackJobProperty.getNotifyAborted(); + slackNotifier.notifyFailure = slackJobProperty.getNotifyFailure(); + slackNotifier.notifyNotBuilt = slackJobProperty.getNotifyNotBuilt(); + slackNotifier.notifySuccess = slackJobProperty.getNotifySuccess(); + slackNotifier.notifyUnstable = slackJobProperty.getNotifyUnstable(); + slackNotifier.notifyBackToNormal = slackJobProperty.getNotifyBackToNormal(); + slackNotifier.notifyRepeatedFailure = slackJobProperty.getNotifyRepeatedFailure(); + + slackNotifier.includeTestSummary = slackJobProperty.includeTestSummary(); + slackNotifier.commitInfoChoice = slackJobProperty.getShowCommitList() ? CommitInfoChoice.AUTHORS_AND_TITLES : CommitInfoChoice.NONE; + slackNotifier.includeCustomMessage = slackJobProperty.includeCustomMessage(); + slackNotifier.customMessage = slackJobProperty.getCustomMessage(); + } + + try { + //property section is not used anymore - remove + p.removeProperty(SlackJobProperty.class); + p.save(); + logger.info("Configuration updated successfully"); + } catch (IOException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + } + } + } + } } diff --git a/src/test/java/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest.java b/src/test/java/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest.java new file mode 100644 index 00000000..d2fc9865 --- /dev/null +++ b/src/test/java/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest.java @@ -0,0 +1,180 @@ +package jenkins.plugins.slack.config; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import hudson.matrix.MatrixProject; +import hudson.model.FreeStyleProject; +import jenkins.model.Jenkins; +import jenkins.plugins.slack.CommitInfoChoice; +import jenkins.plugins.slack.SlackNotifier; +import jenkins.plugins.slack.SlackNotifier.SlackJobProperty; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.jvnet.hudson.test.JenkinsRule; +import org.jvnet.hudson.test.recipes.LocalData; + +@SuppressWarnings("deprecation") +public class BackwordsCompatible_1_8_SlackNotifierTest { + + @Rule + public JenkinsRule j = new JenkinsRule(); + + public Jenkins jenkins; + + @Before + public void setup() { + jenkins = j.getInstance(); + } + + @Test + @LocalData + public void testBasicMigration() { + FreeStyleProject project = (FreeStyleProject) jenkins.getItem("Test_Slack_Plugin"); + SlackNotifier notifier = project.getPublishersList().get(SlackNotifier.class); + + assertEquals("jenkins-slack-plugin", notifier.getTeamDomain()); + assertEquals("auth-token-for-test", notifier.getAuthToken()); + assertEquals("http://localhost:8080/", notifier.getBuildServerUrl()); + assertEquals("#slack-plugin-testing", notifier.getRoom()); + + assertFalse(notifier.getStartNotification()); + assertTrue(notifier.getNotifySuccess()); + assertFalse(notifier.getNotifyAborted()); + assertFalse(notifier.getNotifyNotBuilt()); + assertFalse(notifier.getNotifyUnstable()); + assertTrue(notifier.getNotifyFailure()); + assertFalse(notifier.getNotifyBackToNormal()); + assertFalse(notifier.getNotifyRepeatedFailure()); + assertFalse(notifier.includeTestSummary()); + assertEquals(CommitInfoChoice.NONE, notifier.getCommitInfoChoice()); + assertFalse(notifier.includeCustomMessage()); + assertEquals("", notifier.getCustomMessage()); + + assertNull(project.getProperty(SlackJobProperty.class)); + } + + @Test + @LocalData + public void testGlobalSettingsOverriden() { + FreeStyleProject project = (FreeStyleProject) jenkins.getItem("Test_Slack_Plugin"); + SlackNotifier notifier = project.getPublishersList().get(SlackNotifier.class); + + assertEquals("jenkins-slack-plugin", notifier.getTeamDomain()); + assertEquals("auth-token-for-test", notifier.getAuthToken()); + assertEquals("http://localhost:8080/", notifier.getBuildServerUrl()); + assertEquals("#slack-plugin-testing", notifier.getRoom()); + + assertFalse(notifier.getStartNotification()); + assertTrue(notifier.getNotifySuccess()); + assertFalse(notifier.getNotifyAborted()); + assertFalse(notifier.getNotifyNotBuilt()); + assertFalse(notifier.getNotifyUnstable()); + assertTrue(notifier.getNotifyFailure()); + assertFalse(notifier.getNotifyBackToNormal()); + assertFalse(notifier.getNotifyRepeatedFailure()); + assertFalse(notifier.includeTestSummary()); + assertEquals(CommitInfoChoice.NONE, notifier.getCommitInfoChoice()); + assertFalse(notifier.includeCustomMessage()); + assertEquals("", notifier.getCustomMessage()); + + assertNull(project.getProperty(SlackJobProperty.class)); + } + + @Test + @LocalData + public void testGlobalSettingsNotOverridden() throws IOException { + FreeStyleProject project = (FreeStyleProject) jenkins.getItem("Test_Slack_Plugin"); + SlackNotifier notifier = project.getPublishersList().get(SlackNotifier.class); + + assertEquals("", notifier.getTeamDomain()); + assertEquals("", notifier.getAuthToken()); + assertEquals(j.getURL().toString(), notifier.getBuildServerUrl()); + assertEquals("", notifier.getRoom()); + + assertFalse(notifier.getStartNotification()); + assertTrue(notifier.getNotifySuccess()); + assertFalse(notifier.getNotifyAborted()); + assertFalse(notifier.getNotifyNotBuilt()); + assertFalse(notifier.getNotifyUnstable()); + assertTrue(notifier.getNotifyFailure()); + assertFalse(notifier.getNotifyBackToNormal()); + assertFalse(notifier.getNotifyRepeatedFailure()); + assertFalse(notifier.includeTestSummary()); + assertEquals(CommitInfoChoice.NONE, notifier.getCommitInfoChoice()); + assertFalse(notifier.includeCustomMessage()); + assertEquals("", notifier.getCustomMessage()); + + assertNull(project.getProperty(SlackJobProperty.class)); + } + + @Test + @LocalData + public void testMigrationFromNoPlugin() { + FreeStyleProject project1 = (FreeStyleProject) jenkins.getItem("Test_01"); + assertNull(project1.getPublishersList().get(SlackNotifier.class)); + assertNull(project1.getProperty(SlackJobProperty.class)); + + FreeStyleProject project2 = (FreeStyleProject) jenkins.getItem("Test_02"); + assertNull(project2.getPublishersList().get(SlackNotifier.class)); + assertNull(project2.getProperty(SlackJobProperty.class)); + + MatrixProject project3 = (MatrixProject) jenkins.getItem("Test_03"); + assertNull(project3.getPublishersList().get(SlackNotifier.class)); + assertNull(project3.getProperty(SlackJobProperty.class)); + } + + @Test + @LocalData + public void testMigrationOfSomeJobs() throws IOException { + // Project without Slack notifications + FreeStyleProject project1 = (FreeStyleProject) jenkins.getItem("Test_01"); + assertNull(project1.getPublishersList().get(SlackNotifier.class)); + assertNull(project1.getProperty(SlackJobProperty.class)); + + // Another project without Slack notifications + MatrixProject project3 = (MatrixProject) jenkins.getItem("Test_03"); + assertNull(project3.getPublishersList().get(SlackNotifier.class)); + assertNull(project3.getProperty(SlackJobProperty.class)); + + // Project with Slack notifications + FreeStyleProject project2 = (FreeStyleProject) jenkins.getItem("Test_02"); + SlackNotifier notifier = project2.getPublishersList().get(SlackNotifier.class); + assertNotNull(notifier); + + assertEquals("", notifier.getTeamDomain()); + assertEquals("", notifier.getAuthToken()); + assertEquals(j.getURL().toString(), notifier.getBuildServerUrl()); + assertEquals("", notifier.getRoom()); + + assertTrue(notifier.getStartNotification()); + assertTrue(notifier.getNotifySuccess()); + assertTrue(notifier.getNotifyAborted()); + assertTrue(notifier.getNotifyNotBuilt()); + assertTrue(notifier.getNotifyUnstable()); + assertTrue(notifier.getNotifyFailure()); + assertTrue(notifier.getNotifyBackToNormal()); + assertTrue(notifier.getNotifyRepeatedFailure()); + assertTrue(notifier.includeTestSummary()); + assertEquals(CommitInfoChoice.AUTHORS_AND_TITLES, notifier.getCommitInfoChoice()); + assertTrue(notifier.includeCustomMessage()); + assertEquals("Custom message for 1.8 plugin.", notifier.getCustomMessage()); + + assertNull(project2.getProperty(SlackJobProperty.class)); + } + + @Test + @LocalData + public void testMigrationWithNoNotifier() { + FreeStyleProject project = (FreeStyleProject) jenkins.getItem("Test_01"); + assertNull(project.getPublishersList().get(SlackNotifier.class)); + assertNull(project.getProperty(SlackJobProperty.class)); + } +} diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testBasicMigration/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testBasicMigration/config.xml new file mode 100644 index 00000000..1420198b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testBasicMigration/config.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testBasicMigration/jobs/Test_Slack_Plugin/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testBasicMigration/jobs/Test_Slack_Plugin/config.xml new file mode 100644 index 00000000..b5c573f8 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testBasicMigration/jobs/Test_Slack_Plugin/config.xml @@ -0,0 +1,46 @@ + + + + + false + + + + + + false + true + false + false + false + true + false + false + false + false + false + + + + + true + false + false + false + + false + + + echo "Hello World" + + + + + jenkins-slack-plugin + auth-token-for-test + http://localhost:8080/ + #slack-plugin-testing + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/config.xml new file mode 100644 index 00000000..1420198b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/config.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/jenkins.plugins.slack.SlackNotifier.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/jenkins.plugins.slack.SlackNotifier.xml new file mode 100644 index 00000000..b6c48a40 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/jenkins.plugins.slack.SlackNotifier.xml @@ -0,0 +1,7 @@ + + + jenkins-slack-plugin-global + auth-token-for-test-global + #slack-plugin-testing-global + http://localhost:8080/global/ + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/jobs/Test_Slack_Plugin/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/jobs/Test_Slack_Plugin/config.xml new file mode 100644 index 00000000..73edbacb --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsNotOverridden/jobs/Test_Slack_Plugin/config.xml @@ -0,0 +1,46 @@ + + + + + false + + + + + + false + true + false + false + false + true + false + false + false + false + false + + + + + true + false + false + false + + false + + + echo "Hello World" + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/config.xml new file mode 100644 index 00000000..1420198b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/config.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/jenkins.plugins.slack.SlackNotifier.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/jenkins.plugins.slack.SlackNotifier.xml new file mode 100644 index 00000000..b6c48a40 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/jenkins.plugins.slack.SlackNotifier.xml @@ -0,0 +1,7 @@ + + + jenkins-slack-plugin-global + auth-token-for-test-global + #slack-plugin-testing-global + http://localhost:8080/global/ + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/jobs/Test_Slack_Plugin/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/jobs/Test_Slack_Plugin/config.xml new file mode 100644 index 00000000..b5c573f8 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testGlobalSettingsOverriden/jobs/Test_Slack_Plugin/config.xml @@ -0,0 +1,46 @@ + + + + + false + + + + + + false + true + false + false + false + true + false + false + false + false + false + + + + + true + false + false + false + + false + + + echo "Hello World" + + + + + jenkins-slack-plugin + auth-token-for-test + http://localhost:8080/ + #slack-plugin-testing + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/config.xml new file mode 100644 index 00000000..1420198b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/config.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_01/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_01/config.xml new file mode 100644 index 00000000..8133821d --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_01/config.xml @@ -0,0 +1,25 @@ + + + + + false + + + true + false + false + false + + + H * * * * + + + false + + + echo "Test" + + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_02/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_02/config.xml new file mode 100644 index 00000000..78911423 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_02/config.xml @@ -0,0 +1,32 @@ + + + + + false + + + true + false + false + false + + + + Test_01 + + SUCCESS + 0 + BLUE + true + + + + false + + + echo "Test" + + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_02/nextBuildNumber b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_02/nextBuildNumber new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_02/nextBuildNumber @@ -0,0 +1 @@ +1 diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_03/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_03/config.xml new file mode 100644 index 00000000..afa7de3b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationFromNoPlugin/jobs/Test_03/config.xml @@ -0,0 +1,35 @@ + + + + + false + + + true + false + false + false + + false + + + + echo "Test" + + + + + Test_02 + + UNSTABLE + 1 + YELLOW + true + + + + + + false + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/config.xml new file mode 100644 index 00000000..1420198b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/config.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jenkins.plugins.slack.SlackNotifier.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jenkins.plugins.slack.SlackNotifier.xml new file mode 100644 index 00000000..b6c48a40 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jenkins.plugins.slack.SlackNotifier.xml @@ -0,0 +1,7 @@ + + + jenkins-slack-plugin-global + auth-token-for-test-global + #slack-plugin-testing-global + http://localhost:8080/global/ + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_01/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_01/config.xml new file mode 100644 index 00000000..8133821d --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_01/config.xml @@ -0,0 +1,25 @@ + + + + + false + + + true + false + false + false + + + H * * * * + + + false + + + echo "Test" + + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_02/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_02/config.xml new file mode 100644 index 00000000..40ff1817 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_02/config.xml @@ -0,0 +1,55 @@ + + + + + false + + + + + + true + true + true + true + true + true + true + true + true + true + true + Custom message for 1.8 plugin. + + + + true + false + false + false + + + + Test_01 + + SUCCESS + 0 + BLUE + true + + + + false + + + echo "Test" + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_03/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_03/config.xml new file mode 100644 index 00000000..afa7de3b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationOfSomeJobs/jobs/Test_03/config.xml @@ -0,0 +1,35 @@ + + + + + false + + + true + false + false + false + + false + + + + echo "Test" + + + + + Test_02 + + UNSTABLE + 1 + YELLOW + true + + + + + + false + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationWithNoNotifier/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationWithNoNotifier/config.xml new file mode 100644 index 00000000..1420198b --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationWithNoNotifier/config.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationWithNoNotifier/jobs/Test_01/config.xml b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationWithNoNotifier/jobs/Test_01/config.xml new file mode 100644 index 00000000..477394d2 --- /dev/null +++ b/src/test/resources/jenkins/plugins/slack/config/BackwordsCompatible_1_8_SlackNotifierTest/testMigrationWithNoNotifier/jobs/Test_01/config.xml @@ -0,0 +1,43 @@ + + + + + false + + + + + + false + false + false + false + false + false + false + false + false + false + false + + + + + true + false + false + false + + + H * * * * + + + false + + + echo "Test" + + + + + \ No newline at end of file