diff --git a/src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_reloaded/MatrixReloadedAction.java b/src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_reloaded/MatrixReloadedAction.java deleted file mode 100644 index f112e68e73..0000000000 --- a/src/main/java/org/jenkinsci/test/acceptance/plugins/matrix_reloaded/MatrixReloadedAction.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2014 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package org.jenkinsci.test.acceptance.plugins.matrix_reloaded; - -import static org.hamcrest.MatcherAssert.assertThat; - -import org.jenkinsci.test.acceptance.Matchers; -import org.jenkinsci.test.acceptance.po.Action; -import org.jenkinsci.test.acceptance.po.ActionPageObject; -import org.jenkinsci.test.acceptance.po.ContainerPageObject; -import org.jenkinsci.test.acceptance.po.MatrixBuild; -import org.openqa.selenium.By; - -@ActionPageObject("matrix-reloaded") -public class MatrixReloadedAction extends Action { - - public MatrixReloadedAction(MatrixBuild parent, String relative) { - super(parent, relative); - } - - public MatrixReloadedAction shouldHaveCombination(String combination) { - open(); - assertThat(driver, Matchers.hasElement(checkbox(combination))); - return this; - } - - private By checkbox(String combination) { - return by.path("/MRP::" + combination); - } - - public void rebuild(String... combinations) { - open(); - for (String c : combinations) { - control(checkbox(c)).check(); - } - clickButton("Rebuild Matrix"); - } - - @Override - public boolean isApplicable(ContainerPageObject po) { - return po instanceof MatrixBuild; - } -} diff --git a/src/test/java/plugins/MatrixPluginTest.java b/src/test/java/plugins/MatrixPluginTest.java index 541f30ebc7..a6c545603a 100644 --- a/src/test/java/plugins/MatrixPluginTest.java +++ b/src/test/java/plugins/MatrixPluginTest.java @@ -12,7 +12,6 @@ import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest; import org.jenkinsci.test.acceptance.junit.Since; import org.jenkinsci.test.acceptance.junit.WithPlugins; -import org.jenkinsci.test.acceptance.plugins.matrix_reloaded.MatrixReloadedAction; import org.jenkinsci.test.acceptance.po.LabelAxis; import org.jenkinsci.test.acceptance.po.MatrixBuild; import org.jenkinsci.test.acceptance.po.MatrixConfiguration; @@ -186,41 +185,6 @@ public void run_configurations_on_with_a_given_label() throws Exception { .shouldContainsConsoleOutput("(Building|Building remotely) on " + s.getName()); } - @Test - @WithPlugins({"matrix-reloaded", "matrix-groovy-execution-strategy"}) - public void run_extended_test() { - job.configure(); - // Create a [3,3] matrix - job.addUserAxis(AXIS_X, AXIS_X_VALUES); - job.addUserAxis(AXIS_Y, AXIS_Y_VALUES); - - job.control(by.xpath("//div[normalize-space(text())='%s']/..//select", "Execution Strategy")) - .select(STRATEGY); - job.control(by.xpath("//div[normalize-space(text())='%s']/..//textarea", "Groovy Script")) - .set(GROOVY_SELECTOR_SCRIPT); - - job.save(); - job.startBuild(); - - // Default execution: Only valid combinations are built. Other combinations are not created - MatrixBuild build = waitForSuccessBuild(job); - assertExist(build); - - // Rebuild a non-allowed combination: Valid combinations exist but aren't built. Invalid combinations don't - // exist. - rebuildCombination(job, AXIS_X + "=" + AXIS_X_TEST_NOT_BUILT + "," + AXIS_Y + "=" + AXIS_Y_TEST_NOT_BUILT); - build = waitForSuccessBuild(job); - assertExist(build); - assertBuilt(build, AXIS_X_TEST_NOT_BUILT, AXIS_Y_TEST_NOT_BUILT); - - // Rebuild only one valid combination ([1,1]): This combination exists and is built. The rest of valid - // combinations exist but aren't built. Invalid combinations don't exist. - rebuildCombination(job, AXIS_X + "=" + AXIS_X_TEST_BUILT + "," + AXIS_Y + "=" + AXIS_Y_TEST_BUILT); - build = waitForSuccessBuild(job); - assertExist(build); - assertBuilt(build, AXIS_X_TEST_BUILT, AXIS_Y_TEST_BUILT); - } - private void assertBuilt(MatrixBuild build, int axisX, int axisY) { for (int x = AXIS_INITIAL_VALUE; x <= AXIS_MAX_VALUE; x++) { for (int y = AXIS_INITIAL_VALUE; y <= AXIS_MAX_VALUE; y++) { @@ -254,12 +218,6 @@ private MatrixBuild waitForSuccessBuild(MatrixProject job) { return (MatrixBuild) job.getLastBuild().waitUntilFinished().shouldSucceed(); } - private void rebuildCombination(MatrixProject job, String... combinations) { - MatrixReloadedAction action = job.getLastBuild().action(MatrixReloadedAction.class); - action.open(); - action.rebuild(combinations); - } - private Matcher built() { return new Matcher<>("Matrix run exists") { @Override diff --git a/src/test/java/plugins/MatrixReloadedPluginTest.java b/src/test/java/plugins/MatrixReloadedPluginTest.java deleted file mode 100644 index 0a298289ed..0000000000 --- a/src/test/java/plugins/MatrixReloadedPluginTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2014 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package plugins; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.not; - -import org.jenkinsci.test.acceptance.Matcher; -import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest; -import org.jenkinsci.test.acceptance.junit.WithPlugins; -import org.jenkinsci.test.acceptance.plugins.matrix_reloaded.MatrixReloadedAction; -import org.jenkinsci.test.acceptance.po.MatrixBuild; -import org.jenkinsci.test.acceptance.po.MatrixProject; -import org.jenkinsci.test.acceptance.po.MatrixRun; -import org.jenkinsci.test.acceptance.po.TextAxis; -import org.junit.Test; - -@WithPlugins({ - "matrix-project", // JENKINS-37545 - "matrix-reloaded" -}) -public class MatrixReloadedPluginTest extends AbstractJUnitTest { - - @Test - public void rebuild_one_combination() { - MatrixProject job = jenkins.jobs.create(MatrixProject.class); - job.configure(); - TextAxis x = job.addAxis(TextAxis.class); - x.name.set("AAA"); - x.valueString.set("111 222"); - - TextAxis y = job.addAxis(TextAxis.class); - y.name.set("BBB"); - y.valueString.set("333 444"); - job.save(); - job.startBuild().waitUntilFinished(); - - MatrixReloadedAction action = job.getLastBuild().action(MatrixReloadedAction.class); - action.open(); - - action.shouldHaveCombination("AAA=111,BBB=333") - .shouldHaveCombination("AAA=111,BBB=444") - .shouldHaveCombination("AAA=222,BBB=333") - .shouldHaveCombination("AAA=222,BBB=444"); - - action.rebuild("AAA=111,BBB=333"); - MatrixBuild build = (MatrixBuild) job.getLastBuild().shouldSucceed(); - - assertThat(build.getConfiguration("AAA=111,BBB=333"), exists()); - assertThat(build.getConfiguration("AAA=111,BBB=444"), not(exists())); - assertThat(build.getConfiguration("AAA=222,BBB=333"), not(exists())); - assertThat(build.getConfiguration("AAA=222,BBB=444"), not(exists())); - } - - private Matcher exists() { - return new Matcher<>("Matrix run exists") { - @Override - public boolean matchesSafely(MatrixRun item) { - return item.exists(); - } - }; - } -}