e : artifacts.entrySet()) {
- FilePath f = workspace.child(e.getValue());
- if (f.exists()) {
- if (f.getRemote().replace('\\', '/').contains("/org/jvnet/hudson/main/test/")) {
- // Inside the local repository. Hard to know exactly what that path might be, so just mask it out.
- f = new FilePath(f.getChannel(), f.getRemote().replaceFirst("^.+(?=[/\\\\]org[/\\\\]jvnet[/\\\\]hudson[/\\\\]main[/\\\\]test[/\\\\])", "…"));
- }
- m.put(e.getKey(), f);
- } else {
- throw new IOException("no such file " + f);
- }
- }
- archivings.put(name, m);
- }
- @Override public boolean delete() throws IOException, InterruptedException {
- throw new IOException();
- }
- @Override public VirtualFile root() {
- throw new UnsupportedOperationException();
- }
- }
-
- /*
- @Test public void parallelMultiModMavenWsExists() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setAggregatorStyleBuild(false);
- m.getReporters().add(new TestReporter());
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimod.zip")));
- assertBuildStatusSuccess(m.scheduleBuild2(0).get());
-
- for (MavenModule mod : m.sortedActiveModules) {
- while (mod.getLastBuild() == null) {
- Thread.sleep(500);
- }
-
- while (mod.getLastBuild().isBuilding()) {
- Thread.sleep(500);
- }
-
- assertBuildStatusSuccess(mod.getLastBuild());
- }
-
-
-
- }
-
- @Test public void privateRepoParallelMultiModMavenWsExists() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setAggregatorStyleBuild(false);
- m.setUsePrivateRepository(true);
- m.getReporters().add(new TestReporter());
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimod.zip")));
- assertBuildStatusSuccess(m.scheduleBuild2(0).get());
-
- for (MavenModule mod : m.sortedActiveModules) {
- while (mod.getLastBuild() == null) {
- Thread.sleep(500);
- }
-
- while (mod.getLastBuild().isBuilding()) {
- Thread.sleep(500);
- }
-
- assertBuildStatusSuccess(mod.getLastBuild());
- }
-
- }
- */
- private static class TestReporter extends MavenReporter {
- @Override
- public boolean end(MavenBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
- assertNotNull(build.getProject().getWorkspace());
- assertNotNull(build.getWorkspace());
- return true;
- }
- }
-
- private static class DummyRedeployPublisher extends RedeployPublisher {
- public DummyRedeployPublisher() {
- super("", "", false, false);
- }
-
- @Override
- public boolean perform(AbstractBuild, ?> build, Launcher launcher,
- BuildListener listener) throws InterruptedException,
- IOException {
- return true;
- }
- }
-}
diff --git a/test/src/test/java/hudson/maven/MavenMultiModuleTestIncremental.java b/test/src/test/java/hudson/maven/MavenMultiModuleTestIncremental.java
deleted file mode 100755
index 2ebaee49c2..0000000000
--- a/test/src/test/java/hudson/maven/MavenMultiModuleTestIncremental.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package hudson.maven;
-
-import hudson.Launcher;
-import hudson.model.BuildListener;
-import hudson.model.Result;
-import hudson.tasks.Maven.MavenInstallation;
-
-import java.io.IOException;
-
-import org.jvnet.hudson.test.Bug;
-import org.jvnet.hudson.test.ExtractChangeLogSet;
-import org.jvnet.hudson.test.ExtractResourceWithChangesSCM;
-import org.jvnet.hudson.test.HudsonTestCase;
-
-/**
- * @author Andrew Bayer
- */
-public class MavenMultiModuleTestIncremental extends HudsonTestCase {
-
- @Bug(7684)
- public void testRelRootPom() throws Exception {
- configureDefaultMaven("apache-maven-2.2.1", MavenInstallation.MAVEN_21);
- MavenModuleSet m = createMavenProject();
- m.setRootPOM("parent/pom.xml");
- m.getReporters().add(new TestReporter());
- m.setScm(new ExtractResourceWithChangesSCM(getClass().getResource("maven-multimod-rel-base.zip"),
- getClass().getResource("maven-multimod-changes.zip")));
-
- buildAndAssertSuccess(m);
-
- // Now run a second build with the changes.
- m.setIncrementalBuild(true);
- buildAndAssertSuccess(m);
-
- MavenModuleSetBuild pBuild = m.getLastBuild();
- ExtractChangeLogSet changeSet = (ExtractChangeLogSet) pBuild.getChangeSet();
-
- assertFalse("ExtractChangeLogSet should not be empty.", changeSet.isEmptySet());
-
- for (MavenBuild modBuild : pBuild.getModuleLastBuilds().values()) {
- String parentModuleName = modBuild.getParent().getModuleName().toString();
- if (parentModuleName.equals("org.jvnet.hudson.main.test.multimod:moduleA")) {
- assertEquals("moduleA should have Result.NOT_BUILT", Result.NOT_BUILT, modBuild.getResult());
- }
- else if (parentModuleName.equals("org.jvnet.hudson.main.test.multimod:moduleB")) {
- assertEquals("moduleB should have Result.SUCCESS", Result.SUCCESS, modBuild.getResult());
- }
- else if (parentModuleName.equals("org.jvnet.hudson.main.test.multimod:moduleC")) {
- assertEquals("moduleC should have Result.SUCCESS", Result.SUCCESS, modBuild.getResult());
- }
- }
-
- long summedModuleDuration = 0;
- for (MavenBuild modBuild : pBuild.getModuleLastBuilds().values()) {
- summedModuleDuration += modBuild.getDuration();
- }
- assertTrue("duration of moduleset build should be greater-equal than sum of the module builds",
- pBuild.getDuration() >= summedModuleDuration);
- }
-
- private static class TestReporter extends MavenReporter {
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean end(MavenBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
- assertNotNull(build.getWorkspace());
- return true;
- }
- }
-}
diff --git a/test/src/test/java/hudson/maven/MavenOptsTest.java b/test/src/test/java/hudson/maven/MavenOptsTest.java
deleted file mode 100644
index a86bd1969a..0000000000
--- a/test/src/test/java/hudson/maven/MavenOptsTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-package hudson.maven;
-
-import hudson.maven.MavenModuleSet.DescriptorImpl;
-import org.jvnet.hudson.test.HudsonTestCase;
-import org.jvnet.hudson.test.Bug;
-import org.jvnet.hudson.test.ExtractResourceSCM;
-import hudson.EnvVars;
-import hudson.model.Result;
-import hudson.tasks.Maven.MavenInstallation;
-
-/**
- * @author Andrew Bayer
- */
-public class MavenOptsTest extends HudsonTestCase {
- DescriptorImpl d;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- d = jenkins.getDescriptorByType(DescriptorImpl.class);
- }
-
- @Override
- protected void tearDown() throws Exception {
- d.setGlobalMavenOpts(null);
- super.tearDown();
- }
-
- public void testEnvMavenOptsNoneInProject() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
- m.setGoals("validate");
- m.setAssignedLabel(createSlave(new EnvVars("MAVEN_OPTS", "-Dhudson.mavenOpt.test=foo")).getSelfLabel());
-
- buildAndAssertSuccess(m);
-
- assertLogContains("[hudson.mavenOpt.test=foo]", m.getLastBuild());
- }
-
-
- public void testEnvMavenOptsOverriddenByProject() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
- m.setGoals("validate");
- m.setMavenOpts("-Dhudson.mavenOpt.test=bar");
- m.setAssignedLabel(createSlave(new EnvVars("MAVEN_OPTS", "-Dhudson.mavenOpt.test=foo")).getSelfLabel());
-
- buildAndAssertSuccess(m);
-
- assertLogContains("[hudson.mavenOpt.test=bar]", m.getLastBuild());
- }
-
- public void testEnvAndGlobalMavenOptsOverriddenByProject() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
- m.setGoals("validate");
- d.setGlobalMavenOpts("-Dhudson.mavenOpt.test=bar");
- m.setAssignedLabel(createSlave(new EnvVars("MAVEN_OPTS", "-Dhudson.mavenOpt.test=foo")).getSelfLabel());
- m.setMavenOpts("-Dhudson.mavenOpt.test=baz");
-
- buildAndAssertSuccess(m);
-
- assertLogContains("[hudson.mavenOpt.test=baz]", m.getLastBuild());
- }
-
-
- public void testGlobalMavenOpts() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
- m.setGoals("validate");
- d.setGlobalMavenOpts("-Dhudson.mavenOpt.test=bar");
-
- buildAndAssertSuccess(m);
-
- assertLogContains("[hudson.mavenOpt.test=bar]", m.getLastBuild());
- }
-
- public void testGlobalMavenOptsOverridenByProject() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
- m.setGoals("validate");
- d.setGlobalMavenOpts("-Dhudson.mavenOpt.test=bar");
- m.setMavenOpts("-Dhudson.mavenOpt.test=foo");
-
- buildAndAssertSuccess(m);
-
- assertLogContains("[hudson.mavenOpt.test=foo]", m.getLastBuild());
- }
-
- @Bug(5651)
- public void testNewlinesInOptsRemoved() throws Exception {
- configureDefaultMaven("apache-maven-2.2.1", MavenInstallation.MAVEN_21);
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-surefire-unstable.zip")));
- m.setMavenOpts("-XX:MaxPermSize=512m\r\n-Xms128m\r\n-Xmx512m");
- m.setGoals("install");
-
- assertBuildStatus(Result.UNSTABLE, m.scheduleBuild2(0).get());
- MavenModuleSetBuild pBuild = m.getLastBuild();
-
- assertEquals("Parent build should have Result.UNSTABLE", Result.UNSTABLE, pBuild.getResult());
-
- }
-
- /**
- * Makes sure that environment variables in MAVEN_OPTS are properly expanded.
- */
- public void testEnvironmentVariableExpansion() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setMavenOpts("$FOO");
- m.setScm(new ExtractResourceSCM(getClass().getResource("maven-opts-echo.zip")));
- m.setGoals("validate");
- m.setAssignedLabel(createSlave(new EnvVars("FOO", "-Dhudson.mavenOpt.test=foo -Dhudson.mavenOpt.test2=bar")).getSelfLabel());
-
- buildAndAssertSuccess(m);
-
- assertLogContains("[hudson.mavenOpt.test=foo]", m.getLastBuild());
- }
-
-}
-
diff --git a/test/src/test/java/hudson/maven/MavenProjectTest.java b/test/src/test/java/hudson/maven/MavenProjectTest.java
deleted file mode 100644
index 0fbfd3ead3..0000000000
--- a/test/src/test/java/hudson/maven/MavenProjectTest.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * The MIT License
- *
- * Copyright (c) 2004-2010, Sun Microsystems, 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 hudson.maven;
-
-import hudson.maven.local_repo.DefaultLocalRepositoryLocator;
-import hudson.maven.local_repo.PerJobLocalRepositoryLocator;
-import hudson.model.AbstractProject;
-import hudson.model.Item;
-import hudson.model.Result;
-import hudson.tasks.Maven.MavenInstallation;
-import hudson.tasks.Shell;
-
-import java.io.File;
-
-import jenkins.model.Jenkins;
-import jenkins.mvn.DefaultGlobalSettingsProvider;
-import jenkins.mvn.DefaultSettingsProvider;
-import jenkins.mvn.FilePathGlobalSettingsProvider;
-import jenkins.mvn.FilePathSettingsProvider;
-import jenkins.mvn.GlobalMavenConfig;
-
-import org.junit.Assert;
-import org.jvnet.hudson.test.Bug;
-import org.jvnet.hudson.test.ExtractResourceSCM;
-import org.jvnet.hudson.test.HudsonTestCase;
-
-import java.net.HttpURLConnection;
-
-/**
- * @author huybrechts
- */
-public class MavenProjectTest extends HudsonTestCase {
-
-
- public void testOnMaster() throws Exception {
- MavenModuleSet project = createSimpleProject();
- project.setGoals("validate");
-
- buildAndAssertSuccess(project);
- }
-
- @Bug(16499)
- public void testCopyFromExistingMavenProject() throws Exception {
- MavenModuleSet project = createSimpleProject();
- project.setGoals("abcdefg");
- project.save();
-
- MavenModuleSet copy = (MavenModuleSet) Jenkins.getInstance().copy((AbstractProject, ?>)project, "copy" + System.currentTimeMillis());
- assertNotNull("Copied project must not be null", copy);
- assertEquals(project.getGoals(), copy.getGoals());
- }
-
- private MavenModuleSet createSimpleProject() throws Exception {
- return createProject("/simple-projects.zip");
- }
-
- private MavenModuleSet createProject(final String scmResource) throws Exception {
- MavenModuleSet project = createMavenProject();
- MavenInstallation mi = configureDefaultMaven();
- project.setScm(new ExtractResourceSCM(getClass().getResource(
- scmResource)));
- project.setMaven(mi.getName());
- project.setLocalRepository(new PerJobLocalRepositoryLocator());
- return project;
- }
-
- public void testOnSlave() throws Exception {
- MavenModuleSet project = createSimpleProject();
- project.setGoals("validate");
- project.setAssignedLabel(createSlave().getSelfLabel());
-
- buildAndAssertSuccess(project);
- }
-
- /**
- * Check if the generated site is linked correctly.
- */
- @Bug(3497)
- public void testSiteBuild() throws Exception {
- MavenModuleSet project = createSimpleProject();
- project.setGoals("site");
-
- buildAndAssertSuccess(project);
-
- // this should succeed
- HudsonTestCase.WebClient wc = new WebClient();
- wc.getPage(project,"site");
- wc.assertFails(project.getUrl() + "site/no-such-file", HttpURLConnection.HTTP_NOT_FOUND);
- }
-
- /**
- * Check if the generated site is linked correctly for multi module projects.
- */
- public void testMultiModuleSiteBuild() throws Exception {
- MavenModuleSet project = createProject("maven-multimodule-site.zip");
- project.setGoals("site");
-
- buildAndAssertSuccess(project);
-
- // this should succeed
- HudsonTestCase.WebClient wc = new WebClient();
- wc.getPage(project, "site");
- wc.getPage(project, "site/core");
- wc.getPage(project, "site/client");
-
- //@Bug(7577): check that site generation succeeds also if only a single module is build
- MavenModule coreModule = project.getModule("mmtest:core");
- Assert.assertEquals("site", coreModule.getGoals());
- buildAndAssertSuccess(coreModule);
- wc.getPage(project, "site/core");
- }
-
- /**
- * Check if the the site goal will work when run from a slave.
- */
- @Bug(5943)
- public void testMultiModuleSiteBuildOnSlave() throws Exception {
- MavenModuleSet project = createProject("maven-multimodule-site.zip");
- project.setGoals("site");
- project.setAssignedLabel(createSlave().getSelfLabel());
-
- buildAndAssertSuccess(project);
-
- // this should succeed
- HudsonTestCase.WebClient wc = new WebClient();
- wc.getPage(project, "site");
- wc.getPage(project, "site/core");
- wc.getPage(project, "site/client");
- }
-
- @Bug(6779)
- public void testDeleteSetBuildDeletesModuleBuilds() throws Exception {
- MavenModuleSet project = createProject("maven-multimod.zip");
- project.setLocalRepository(new DefaultLocalRepositoryLocator());
- project.setGoals("install");
- buildAndAssertSuccess(project);
- buildAndAssertSuccess(project.getModule("org.jvnet.hudson.main.test.multimod:moduleB"));
- buildAndAssertSuccess(project);
- assertEquals(2, project.getBuilds().size()); // Module build does not add a ModuleSetBuild
- project.getFirstBuild().delete();
- // A#1, B#1 and B#2 should all be deleted too
- assertEquals(1, project.getModule("org.jvnet.hudson.main.test.multimod:moduleA").getBuilds().size());
- assertEquals(1, project.getModule("org.jvnet.hudson.main.test.multimod:moduleB").getBuilds().size());
- }
- @Bug(7261)
- public void testAbsolutePathPom() throws Exception {
- File pom = new File(this.getClass().getResource("test-pom-7162.xml").toURI());
- MavenModuleSet project = createMavenProject();
- MavenInstallation mi = configureDefaultMaven();
- project.setMaven(mi.getName());
- project.setRootPOM(pom.getAbsolutePath());
- project.setGoals("install");
- buildAndAssertSuccess(project);
- }
-
- @Bug(17177)
- public void testCorrectResultInPostStepAfterFailedPreBuildStep() throws Exception {
- MavenModuleSet p = createSimpleProject();
- MavenInstallation mi = configureDefaultMaven();
- p.setMaven(mi.getName());
- p.setGoals("initialize");
-
- Shell pre = new Shell("exit 1"); // must fail to simulate scenario!
- p.getPrebuilders().add(pre);
- ResultExposingBuilder resultExposer = new ResultExposingBuilder();
- p.getPostbuilders().add(resultExposer);
-
- assertBuildStatus(Result.FAILURE, p.scheduleBuild2(0).get());
- assertEquals("The result passed to the post build step was not the one from the pre build step", Result.FAILURE, resultExposer.getResult());
- }
-
-
- /**
- * Config roundtrip test around pre/post build step
- */
- public void testConfigRoundtrip() throws Exception {
- MavenModuleSet m = createMavenProject();
- Shell b1 = new Shell("1");
- Shell b2 = new Shell("2");
- m.getPrebuilders().add(b1);
- m.getPostbuilders().add(b2);
- configRoundtrip((Item)m);
-
- assertEquals(1, m.getPrebuilders().size());
- assertNotSame(b1,m.getPrebuilders().get(Shell.class));
- assertEquals("1",m.getPrebuilders().get(Shell.class).getCommand());
-
- assertEquals(1, m.getPostbuilders().size());
- assertNotSame(b2,m.getPostbuilders().get(Shell.class));
- assertEquals("2",m.getPostbuilders().get(Shell.class).getCommand());
-
- for (Result r : new Result[]{Result.SUCCESS, Result.UNSTABLE, Result.FAILURE}) {
- m.setRunPostStepsIfResult(r);
- configRoundtrip((Item)m);
- assertEquals(r,m.getRunPostStepsIfResult());
- }
- }
-
-
- public void testDefaultSettingsProvider() throws Exception {
- {
- MavenModuleSet m = createMavenProject();
-
- assertNotNull(m);
- assertEquals(DefaultSettingsProvider.class, m.getSettings().getClass());
- assertEquals(DefaultGlobalSettingsProvider.class, m.getGlobalSettings().getClass());
- }
-
- {
- GlobalMavenConfig globalMavenConfig = GlobalMavenConfig.get();
- assertNotNull("No global Maven Config available", globalMavenConfig);
- globalMavenConfig.setSettingsProvider(new FilePathSettingsProvider("/tmp/settigns.xml"));
- globalMavenConfig.setGlobalSettingsProvider(new FilePathGlobalSettingsProvider("/tmp/global-settigns.xml"));
-
- MavenModuleSet m = createMavenProject();
- assertEquals(FilePathSettingsProvider.class, m.getSettings().getClass());
- assertEquals("/tmp/settigns.xml", ((FilePathSettingsProvider)m.getSettings()).getPath());
- assertEquals("/tmp/global-settigns.xml", ((FilePathGlobalSettingsProvider)m.getGlobalSettings()).getPath());
- }
- }
-}
diff --git a/test/src/test/java/hudson/maven/MavenSnapshotTriggerTest.java b/test/src/test/java/hudson/maven/MavenSnapshotTriggerTest.java
deleted file mode 100644
index b898e29b18..0000000000
--- a/test/src/test/java/hudson/maven/MavenSnapshotTriggerTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package hudson.maven;
-
-import org.jvnet.hudson.test.ExtractResourceSCM;
-import org.jvnet.hudson.test.HudsonTestCase;
-
-/**
- * Tests that Maven jobs are triggered, when snapshot dependencies of them were build.
- *
- * @author Andrew Bayer
- */
-public class MavenSnapshotTriggerTest extends HudsonTestCase {
- /**
- * Verifies dependency build ordering of SNAPSHOT dependency.
- * Note - has to build the projects once each first in order to get dependency info.
- */
- public void testSnapshotDependencyBuildTrigger() throws Exception {
-
- configureDefaultMaven();
- MavenModuleSet projA = createMavenProject("snap-dep-test-up");
- projA.setGoals("clean install");
- projA.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-A.zip")));
- MavenModuleSet projB = createMavenProject("snap-dep-test-down");
- projB.setGoals("clean install");
- projB.setIgnoreUpstremChanges(false);
- projB.setQuietPeriod(0);
- projB.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-B.zip")));
-
- buildAndAssertSuccess(projA);
- buildAndAssertSuccess(projB);
-
- projA.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-A-changed.zip")));
- buildAndAssertSuccess(projA);
-
- // at this point runB2 should be in the queue, so wait until that completes.
- waitUntilNoActivityUpTo(90*1000);
- assertEquals("Expected most recent build of second project to be #2", 2, projB.getLastBuild().getNumber());
- }
-
- /**
- * Verifies dependency build ordering of multiple SNAPSHOT dependencies.
- * Note - has to build the projects once each first in order to get dependency info.
- * B depends on A, C depends on A and B. Build order should be A->B->C.
- */
- public void testMixedTransitiveSnapshotTrigger() throws Exception {
- configureDefaultMaven();
-
- MavenModuleSet projA = createMavenProject("snap-dep-test-up");
- projA.setGoals("clean install");
- projA.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-A.zip")));
-
- MavenModuleSet projB = createMavenProject("snap-dep-test-mid");
- projB.setGoals("clean install");
- projB.setIgnoreUpstremChanges(false);
- projB.setQuietPeriod(0);
- projB.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-B.zip")));
-
- MavenModuleSet projC = createMavenProject("snap-dep-test-down");
- projC.setGoals("clean install");
- projC.setIgnoreUpstremChanges(false);
- projC.setQuietPeriod(0);
- projC.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-C.zip")));
-
- buildAndAssertSuccess(projA);
- buildAndAssertSuccess(projB);
- buildAndAssertSuccess(projC);
-
- projA.setScm(new ExtractResourceSCM(getClass().getResource("maven-dep-test-A-changed.zip")));
-
- buildAndAssertSuccess(projA);
-
- waitUntilNoActivityUpTo(90*1000); // wait until dependency build trickles down
- assertEquals("Expected most recent build of second project to be #2", 2, projB.getLastBuild().getNumber());
- assertEquals("Expected most recent build of third project to be #2", 2, projC.getLastBuild().getNumber());
- }
-}
diff --git a/test/src/test/java/hudson/maven/ModuleDependencyLocator.java b/test/src/test/java/hudson/maven/ModuleDependencyLocator.java
deleted file mode 100644
index 88f3620e4a..0000000000
--- a/test/src/test/java/hudson/maven/ModuleDependencyLocator.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * The MIT License
- *
- * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
- *
- * 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 hudson.maven;
-
-import hudson.ExtensionPoint;
-import hudson.ExtensionList;
-import hudson.Extension;
-import jenkins.model.Jenkins;
-import org.apache.maven.project.MavenProject;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Extension point in Hudson to find additional dependencies from {@link MavenProject}.
- *
- *
- * Maven plugin configurations often have additional configuration entries to specify
- * artifacts that a build depends on. Plugins can contribute an implementation of
- * this interface to find such hidden dependencies.
- *
- *
- * To register implementations, put {@link Extension} on your subclass.
- *
- * @author Kohsuke Kawaguchi
- * @since 1.264
- * @see HUDSON-2685
- */
-public abstract class ModuleDependencyLocator implements ExtensionPoint {
- /**
- * Discovers hidden dependencies.
- *
- * @param project
- * In memory representation of Maven project, from which the hidden dependencies will be extracted.
- * Never null.
- * @param pomInfo
- * Partially filled {@link PomInfo} object. Dependencies returned from this method will be
- * added to this object by the caller.
- */
- public abstract Collection find(MavenProject project, PomInfo pomInfo);
-
- /**
- * Returns all the registered {@link ModuleDependencyLocator} descriptors.
- */
- public static ExtensionList all() {
- return Jenkins.getInstance().getExtensionList(ModuleDependencyLocator.class);
- }
-
- /**
- * Facade of {@link ModuleDependencyLocator}.
- */
- /*package*/ static class ModuleDependencyLocatorFacade extends ModuleDependencyLocator {
- @Override
- public Collection find(MavenProject project, PomInfo pomInfo) {
- Set r = new HashSet();
- for (ModuleDependencyLocator m : all())
- r.addAll(m.find(project,pomInfo));
- return r;
- }
- }
-}
diff --git a/test/src/test/java/hudson/maven/PlexusModuleContributorTest.java b/test/src/test/java/hudson/maven/PlexusModuleContributorTest.java
deleted file mode 100644
index 9c893fe446..0000000000
--- a/test/src/test/java/hudson/maven/PlexusModuleContributorTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package hudson.maven;
-
-import hudson.FilePath;
-import hudson.model.AbstractBuild;
-import hudson.remoting.Which;
-import hudson.slaves.DumbSlave;
-import hudson.tasks.Maven.MavenInstallation;
-import org.junit.Rule;
-import org.junit.Test;
-import org.jvnet.hudson.test.JenkinsRule;
-import org.jvnet.hudson.test.SingleFileSCM;
-import org.jvnet.hudson.test.TestExtension;
-import test.BogusPlexusComponent;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class PlexusModuleContributorTest {
- @Rule
- public JenkinsRule j = new JenkinsRule();
-
-
- /**
- * Tests the effect of PlexusModuleContributor by trying to parse a POM that uses a custom packaging
- * that only exists inside our custom jar.
- */
- @Test
- public void testCustomPlexusComponent() throws Exception {
- j.configureDefaultMaven("apache-maven-2.2.1", MavenInstallation.MAVEN_21);
- MavenModuleSet p = j.createMavenProject();
- p.setScm(new SingleFileSCM("pom.xml",getClass().getResource("custom-plexus-component.pom")));
- p.setGoals("clean");
- j.assertBuildStatusSuccess(p.scheduleBuild2(0));
- }
-
- @Test
- public void testCustomPlexusComponent_Maven3() throws Exception {
- j.configureDefaultMaven("apache-maven-3.0.1", MavenInstallation.MAVEN_30);
- MavenModuleSet p = j.createMavenProject();
- p.setScm(new SingleFileSCM("pom.xml",getClass().getResource("custom-plexus-component.pom")));
- p.setGoals("clean");
- j.assertBuildStatusSuccess(p.scheduleBuild2(0));
- }
-
- @Test
- public void testCustomPlexusComponent_Maven3_slave() throws Exception {
- j.configureDefaultMaven("apache-maven-3.0.1", MavenInstallation.MAVEN_30);
- DumbSlave s = j.createSlave();
- s.toComputer().connect(false).get();
-
- MavenModuleSet p = j.createMavenProject();
- p.setAssignedLabel(s.getSelfLabel());
-
- p.setScm(new SingleFileSCM("pom.xml",getClass().getResource("custom-plexus-component.pom")));
- p.setGoals("clean");
- j.assertBuildStatusSuccess(p.scheduleBuild2(0));
- }
-
- @TestExtension
- public static class PlexusLoader extends PlexusModuleContributorFactory {
- @Override
- public PlexusModuleContributor createFor(AbstractBuild, ?> context) throws IOException, InterruptedException {
- File bogusPlexusJar = Which.jarFile(BogusPlexusComponent.class);
- final FilePath localJar = context.getBuiltOn().getRootPath().child("cache/bogusPlexus.jar");
- localJar.copyFrom(new FilePath(bogusPlexusJar));
-
- return PlexusModuleContributor.of(localJar);
- }
- }
-}
diff --git a/test/src/test/java/hudson/maven/RedeployPublisherTest.java b/test/src/test/java/hudson/maven/RedeployPublisherTest.java
deleted file mode 100644
index d1d46e8e59..0000000000
--- a/test/src/test/java/hudson/maven/RedeployPublisherTest.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * The MIT License
- *
- * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
- *
- * 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 hudson.maven;
-
-import hudson.model.Result;
-import hudson.tasks.Maven.MavenInstallation;
-
-import org.apache.commons.lang.StringUtils;
-import org.jvnet.hudson.test.Bug;
-import org.jvnet.hudson.test.ExtractResourceSCM;
-import org.jvnet.hudson.test.SingleFileSCM;
-import org.jvnet.hudson.test.Email;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.Arrays;
-import static org.junit.Assert.*;
-import org.junit.Assume;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
-import org.jvnet.hudson.test.JenkinsRule;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class RedeployPublisherTest {
-
- @Rule public JenkinsRule j = new JenkinsRule();
- @Rule public TemporaryFolder tmp = new TemporaryFolder();
-
- @Bug(2593)
- @Test
- public void testBug2593() throws Exception {
- Assume.assumeFalse("Not a v4.0.0 POM. for project org.jvnet.maven-antrun-extended-plugin:maven-antrun-extended-plugin at /home/jenkins/.m2/repository/org/jvnet/maven-antrun-extended-plugin/maven-antrun-extended-plugin/1.39/maven-antrun-extended-plugin-1.39.pom", "https://jenkins.ci.cloudbees.com/job/core/job/jenkins_main_trunk/".equals(System.getenv("JOB_URL")));
- j.configureDefaultMaven();
- MavenModuleSet m2 = j.createMavenProject();
- File repo = tmp.getRoot();
-
- // a fake build
- m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("big-artifact.pom")));
- m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),true, false));
-
- MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
- j.assertBuildStatus(Result.SUCCESS, b);
-
- // TODO: confirm that the artifacts use a consistent timestamp
- // TODO: we need to somehow introduce a large delay between deploy since timestamp is only second precision
- // TODO: or maybe we could use a btrace like capability to count the # of invocations?
-
- System.out.println(repo);
- }
-
- @Test
- public void testConfigRoundtrip() throws Exception {
- MavenModuleSet p = j.createMavenProject();
- RedeployPublisher rp = new RedeployPublisher("theId", "http://some.url/", true, true);
- p.getPublishersList().add(rp);
- j.submit(j.new WebClient().getPage(p,"configure").getFormByName("config"));
- j.assertEqualBeans(rp,p.getPublishersList().get(RedeployPublisher.class),"id,url,uniqueVersion,evenIfUnstable");
- }
-
-// /**
-// * Makes sure that the webdav wagon component we bundle is compatible.
-// */
-// public void testWebDavDeployment() throws Exception {
-// configureDefaultMaven();
-// MavenModuleSet m2 = createMavenProject();
-//
-// // a fake build
-// m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("big-artifact.pom")));
-// m2.getPublishersList().add(new RedeployPublisher("","dav:http://localhost/dav/",true));
-//
-// MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
-// assertBuildStatus(Result.SUCCESS, b);
-// }
-
- /**
- * Are we having a problem in handling file names with multiple extensions, like ".tar.gz"?
- */
- @Email("http://www.nabble.com/tar.gz-becomes-.gz-after-Hudson-deployment-td25391364.html")
- @Bug(3814)
- @Test
- public void testTarGz() throws Exception {
- j.configureDefaultMaven();
- MavenModuleSet m2 = j.createMavenProject();
- File repo = tmp.getRoot();
-
- // a fake build
- m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
- m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),false, false));
-
- MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
- j.assertBuildStatus(Result.SUCCESS, b);
-
- assertTrue("tar.gz doesn't exist",new File(repo,"test/test/0.1-SNAPSHOT/test-0.1-SNAPSHOT-bin.tar.gz").exists());
- }
-
- @Test
- public void testTarGzUniqueVersionTrue() throws Exception {
- j.configureDefaultMaven();
- MavenModuleSet m2 = j.createMavenProject();
- File repo = tmp.getRoot();
-
- // a fake build
- m2.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
- m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),true, false));
-
- MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
- j.assertBuildStatus(Result.SUCCESS, b);
-
- File artifactDir = new File(repo,"test/test/0.1-SNAPSHOT/");
- String[] files = artifactDir.list( new FilenameFilter()
- {
-
- public boolean accept( File dir, String name )
- {
- System.out.print( "deployed file " + name );
- return name.contains( "-bin.tar.gz" ) || name.endsWith( ".jar" ) || name.endsWith( "-bin.zip" );
- }
- });
- System.out.println("deployed files " + Arrays.asList( files ));
- assertFalse("tar.gz doesn't exist",new File(repo,"test/test/0.1-SNAPSHOT/test-0.1-SNAPSHOT-bin.tar.gz").exists());
- assertTrue("tar.gz doesn't exist",!files[0].contains( "SNAPSHOT" ));
- for (String file : files) {
- if (file.endsWith( "-bin.tar.gz" )) {
- String ver = StringUtils.remove( file, "-bin.tar.gz" );
- ver = ver.substring( ver.length() - 1, ver.length() );
- assertEquals("-bin.tar.gz not ended with 1 , file " + file , "1", ver);
- }
- if (file.endsWith( ".jar" )) {
- String ver = StringUtils.remove( file, ".jar" );
- ver = ver.substring( ver.length() - 1, ver.length() );
- assertEquals(".jar not ended with 1 , file " + file , "1", ver);
- }
- if (file.endsWith( "-bin.zip" )) {
- String ver = StringUtils.remove( file, "-bin.zip" );
- ver = ver.substring( ver.length() - 1, ver.length() );
- assertEquals("-bin.zip not ended with 1 , file " + file , "1", ver);
- }
- }
-
- }
-
- @Test
- public void testTarGzMaven3() throws Exception {
-
- MavenModuleSet m3 = j.createMavenProject();
- MavenInstallation mvn = j.configureMaven3();
- m3.setMaven( mvn.getName() );
- File repo = tmp.getRoot();
- // a fake build
- m3.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
- m3.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),false, false));
-
- MavenModuleSetBuild b = m3.scheduleBuild2(0).get();
- j.assertBuildStatus(Result.SUCCESS, b);
-
- assertTrue( MavenUtil.maven3orLater( b.getMavenVersionUsed() ) );
- File artifactDir = new File(repo,"test/test/0.1-SNAPSHOT/");
- String[] files = artifactDir.list( new FilenameFilter()
- {
-
- public boolean accept( File dir, String name )
- {
- return name.endsWith( "tar.gz" );
- }
- });
- assertFalse("tar.gz doesn't exist",new File(repo,"test/test/0.1-SNAPSHOT/test-0.1-SNAPSHOT-bin.tar.gz").exists());
- assertTrue("tar.gz doesn't exist",!files[0].contains( "SNAPSHOT" ));
- }
-
- @Test
- public void testTarGzUniqueVersionTrueMaven3() throws Exception {
- MavenModuleSet m3 = j.createMavenProject();
- MavenInstallation mvn = j.configureMaven3();
- m3.setMaven( mvn.getName() );
- File repo = tmp.getRoot();
- // a fake build
- m3.setScm(new SingleFileSCM("pom.xml",getClass().getResource("targz-artifact.pom")));
- m3.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),true, false));
-
- MavenModuleSetBuild b = m3.scheduleBuild2(0).get();
- j.assertBuildStatus(Result.SUCCESS, b);
-
- assertTrue( MavenUtil.maven3orLater( b.getMavenVersionUsed() ) );
-
- File artifactDir = new File(repo,"test/test/0.1-SNAPSHOT/");
- String[] files = artifactDir.list( new FilenameFilter()
- {
-
- public boolean accept( File dir, String name )
- {
- return name.contains( "-bin.tar.gz" ) || name.endsWith( ".jar" ) || name.endsWith( "-bin.zip" );
- }
- });
- System.out.println("deployed files " + Arrays.asList( files ));
- assertFalse("tar.gz doesn't exist",new File(repo,"test/test/0.1-SNAPSHOT/test-0.1-SNAPSHOT-bin.tar.gz").exists());
- assertTrue("tar.gz doesn't exist",!files[0].contains( "SNAPSHOT" ));
- for (String file : files) {
- if (file.endsWith( "-bin.tar.gz" )) {
- String ver = StringUtils.remove( file, "-bin.tar.gz" );
- ver = ver.substring( ver.length() - 1, ver.length() );
- assertEquals("-bin.tar.gz not ended with 1 , file " + file , "1", ver);
- }
- if (file.endsWith( ".jar" )) {
- String ver = StringUtils.remove( file, ".jar" );
- ver = ver.substring( ver.length() - 1, ver.length() );
- assertEquals(".jar not ended with 1 , file " + file , "1", ver);
- }
- if (file.endsWith( "-bin.zip" )) {
- String ver = StringUtils.remove( file, "-bin.zip" );
- ver = ver.substring( ver.length() - 1, ver.length() );
- assertEquals("-bin.zip not ended with 1 , file " + file , "1", ver);
- }
- }
- }
-
- @Bug(3773)
- @Test
- public void testDeployUnstable() throws Exception {
- j.configureDefaultMaven();
- MavenModuleSet m2 = j.createMavenProject();
- File repo = tmp.getRoot();
- // a build with a failing unit tests
- m2.setScm(new ExtractResourceSCM(getClass().getResource("maven-test-failure-findbugs.zip")));
- m2.getPublishersList().add(new RedeployPublisher("",repo.toURI().toString(),false, true));
-
- MavenModuleSetBuild b = m2.scheduleBuild2(0).get();
- j.assertBuildStatus(Result.UNSTABLE, b);
-
- assertTrue("Artifact should have been published even when the build is unstable",
- new File(repo,"test/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar").exists());
- }
-}
diff --git a/test/src/test/java/hudson/maven/ResultExposingBuilder.java b/test/src/test/java/hudson/maven/ResultExposingBuilder.java
deleted file mode 100644
index 2bc74dd15d..0000000000
--- a/test/src/test/java/hudson/maven/ResultExposingBuilder.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License
- *
- * Copyright (c) 2013, Dominik Bartholdi
- *
- * 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 hudson.maven;
-
-import hudson.Launcher;
-import hudson.model.BuildListener;
-import hudson.model.Result;
-import hudson.model.AbstractBuild;
-import hudson.tasks.Builder;
-
-import java.io.IOException;
-
-/**
- * @author Dominik Bartholdi (imod)
- */
-public class ResultExposingBuilder extends Builder {
- private Result result;
-
- public ResultExposingBuilder() {
- }
-
- @Override
- public boolean perform(AbstractBuild, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
- result = build.getResult();
- return super.perform(build, launcher, listener);
- }
-
- public Result getResult() {
- return result;
- }
-}
\ No newline at end of file
diff --git a/test/src/test/java/hudson/maven/reporters/MavenMailerTest.java b/test/src/test/java/hudson/maven/reporters/MavenMailerTest.java
deleted file mode 100644
index 3c1c727e12..0000000000
--- a/test/src/test/java/hudson/maven/reporters/MavenMailerTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * The MIT License
- *
- * Copyright (c) 2011, Dominik Bartholdi
- *
- * 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 hudson.maven.reporters;
-
-import hudson.maven.MavenModuleSet;
-import hudson.model.Result;
-import hudson.tasks.Mailer;
-import hudson.tasks.Mailer.DescriptorImpl;
-
-import javax.mail.Address;
-import javax.mail.internet.InternetAddress;
-
-import jenkins.model.Jenkins;
-
-import org.jvnet.hudson.test.Bug;
-import org.jvnet.hudson.test.ExtractResourceSCM;
-import org.jvnet.hudson.test.HudsonTestCase;
-import org.jvnet.mock_javamail.Mailbox;
-
-/**
- *
- * @author imod (Dominik Bartholdi)
- *
- */
-public class MavenMailerTest extends HudsonTestCase {
-
- @Bug(5695)
- public void testMulipleMails() throws Exception {
-
- // there is one module failing in the build, therefore we expect one mail for the failed module and one for the over all build status
- final Mailbox inbox = runMailTest(true);
- assertEquals(2, inbox.size());
-
- }
-
- @Bug(5695)
- public void testSingleMails() throws Exception {
-
- final Mailbox inbox = runMailTest(false);
- assertEquals(1, inbox.size());
-
- }
-
- public Mailbox runMailTest(boolean perModuleEamil) throws Exception {
-
- final DescriptorImpl mailDesc = Jenkins.getInstance().getDescriptorByType(Mailer.DescriptorImpl.class);
-
- // intentionally give the whole thin in a double quote
- Mailer.descriptor().setAdminAddress("\"me \"");
-
- String recipient = "you ";
- Mailbox yourInbox = Mailbox.get(new InternetAddress(recipient));
- yourInbox.clear();
-
- configureDefaultMaven();
- MavenModuleSet mms = createMavenProject();
- mms.setGoals("test");
- mms.setScm(new ExtractResourceSCM(getClass().getResource("/hudson/maven/maven-multimodule-unit-failure.zip")));
- assertBuildStatus(Result.UNSTABLE, mms.scheduleBuild2(0).get());
-
- MavenMailer m = new MavenMailer();
- m.recipients = recipient;
- m.perModuleEmail = perModuleEamil;
- mms.getReporters().add(m);
-
- mms.scheduleBuild2(0).get();
-
- Address[] senders = yourInbox.get(0).getFrom();
- assertEquals(1, senders.length);
- assertEquals("me ", senders[0].toString());
-
- return yourInbox;
- }
-
-}
diff --git a/test/src/test/java/hudson/maven/reporters/MavenSiteArchiverTest.java b/test/src/test/java/hudson/maven/reporters/MavenSiteArchiverTest.java
deleted file mode 100644
index 359fb4913e..0000000000
--- a/test/src/test/java/hudson/maven/reporters/MavenSiteArchiverTest.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package hudson.maven.reporters;
-
-import org.jvnet.hudson.test.HudsonTestCase;
-import hudson.maven.MavenProjectTest;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class MavenSiteArchiverTest extends HudsonTestCase {
- /**
- * Makes sure that the site archiving happens automatically.
- * The actual test resides in {@link MavenProjectTest#testSiteBuild()}
- */
- public void testSiteArchiving() throws Exception {
- }
-}
diff --git a/test/src/test/java/hudson/maven/reporters/SurefireArchiverTest.java b/test/src/test/java/hudson/maven/reporters/SurefireArchiverTest.java
deleted file mode 100644
index 7e3ae538ee..0000000000
--- a/test/src/test/java/hudson/maven/reporters/SurefireArchiverTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * The MIT License
- *
- * Copyright (c) 2010, InfraDNA, 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 hudson.maven.reporters;
-
-import hudson.maven.MavenBuild;
-import hudson.maven.MavenModuleSet;
-import hudson.maven.MavenModuleSetBuild;
-import hudson.maven.MavenProjectActionBuilder;
-import hudson.maven.reporters.SurefireArchiver.FactoryImpl;
-import hudson.model.Result;
-import org.jvnet.hudson.test.ExtractResourceSCM;
-import org.jvnet.hudson.test.HudsonTestCase;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class SurefireArchiverTest extends HudsonTestCase {
- public void testSerialization() throws Exception {
- configureDefaultMaven();
- MavenModuleSet m = createMavenProject();
- m.setScm(new ExtractResourceSCM(getClass().getResource("../maven-surefire-unstable.zip")));
- m.setGoals("install");
-
- MavenModuleSetBuild b = m.scheduleBuild2(0).get();
- assertBuildStatus(Result.UNSTABLE, b);
-
-
- MavenBuild mb = b.getModuleLastBuilds().values().iterator().next();
- boolean foundFactory=false,foundSurefire=false;
- for (MavenProjectActionBuilder x : mb.getProjectActionBuilders()) {
- if (x instanceof FactoryImpl)
- foundFactory = true;
- if (x instanceof SurefireArchiver)
- foundSurefire = true;
- }
-
- assertTrue(foundFactory);
- assertFalse(foundSurefire);
- }
-
-}
diff --git a/test/src/test/resources/hudson/maven/HUDSON-4192.zip b/test/src/test/resources/hudson/maven/HUDSON-4192.zip
deleted file mode 100644
index 24e286e883..0000000000
Binary files a/test/src/test/resources/hudson/maven/HUDSON-4192.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/JENKINS-1557.zip b/test/src/test/resources/hudson/maven/JENKINS-1557.zip
deleted file mode 100644
index 95a102f9f3..0000000000
Binary files a/test/src/test/resources/hudson/maven/JENKINS-1557.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/JENKINS-15865.zip b/test/src/test/resources/hudson/maven/JENKINS-15865.zip
deleted file mode 100644
index db7d1644b5..0000000000
Binary files a/test/src/test/resources/hudson/maven/JENKINS-15865.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/JENKINS-8573.zip b/test/src/test/resources/hudson/maven/JENKINS-8573.zip
deleted file mode 100644
index e271ee1ce2..0000000000
Binary files a/test/src/test/resources/hudson/maven/JENKINS-8573.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/JENKINS-9326.zip b/test/src/test/resources/hudson/maven/JENKINS-9326.zip
deleted file mode 100644
index a9b50b23ae..0000000000
Binary files a/test/src/test/resources/hudson/maven/JENKINS-9326.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/big-artifact.pom b/test/src/test/resources/hudson/maven/big-artifact.pom
deleted file mode 100644
index b7812b68e8..0000000000
--- a/test/src/test/resources/hudson/maven/big-artifact.pom
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
- 4.0.0
- test
- test
- 0.1-SNAPSHOT
-
-
-
-
- org.jvnet.maven-antrun-extended-plugin
- maven-antrun-extended-plugin
- 1.39
-
-
- package
-
-
- This is my artifact
- So is this
-
-
-
-
-
- run
-
-
-
-
-
-
-
-
-
- m.g.o-public
- http://maven.glassfish.org/content/groups/public/
-
-
-
-
\ No newline at end of file
diff --git a/test/src/test/resources/hudson/maven/custom-plexus-component.pom b/test/src/test/resources/hudson/maven/custom-plexus-component.pom
deleted file mode 100644
index 941a182de9..0000000000
--- a/test/src/test/resources/hudson/maven/custom-plexus-component.pom
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- 4.0.0
- test
- test
- 0.1-SNAPSHOT
- bogus
-
\ No newline at end of file
diff --git a/test/src/test/resources/hudson/maven/envars-maven-project.zip b/test/src/test/resources/hudson/maven/envars-maven-project.zip
deleted file mode 100644
index 802d3c0e4a..0000000000
Binary files a/test/src/test/resources/hudson/maven/envars-maven-project.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/foobar_eclipse_with_fix.zip b/test/src/test/resources/hudson/maven/foobar_eclipse_with_fix.zip
deleted file mode 100644
index 5d7f2f2cd5..0000000000
Binary files a/test/src/test/resources/hudson/maven/foobar_eclipse_with_fix.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/incorrect-inheritence-testcase.zip b/test/src/test/resources/hudson/maven/incorrect-inheritence-testcase.zip
deleted file mode 100755
index 0a30bcca61..0000000000
Binary files a/test/src/test/resources/hudson/maven/incorrect-inheritence-testcase.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-compilation-failure.zip b/test/src/test/resources/hudson/maven/maven-compilation-failure.zip
deleted file mode 100644
index 771d0e861a..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-compilation-failure.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-dep-test-A-changed.zip b/test/src/test/resources/hudson/maven/maven-dep-test-A-changed.zip
deleted file mode 100644
index 853579d789..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-dep-test-A-changed.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-dep-test-A.zip b/test/src/test/resources/hudson/maven/maven-dep-test-A.zip
deleted file mode 100755
index 719c6618ef..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-dep-test-A.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-dep-test-B.zip b/test/src/test/resources/hudson/maven/maven-dep-test-B.zip
deleted file mode 100755
index 21fb317024..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-dep-test-B.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-dep-test-C.zip b/test/src/test/resources/hudson/maven/maven-dep-test-C.zip
deleted file mode 100755
index c789f277b1..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-dep-test-C.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-empty-mod.zip b/test/src/test/resources/hudson/maven/maven-empty-mod.zip
deleted file mode 100644
index d02e3b63cb..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-empty-mod.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-multimod-changes.zip b/test/src/test/resources/hudson/maven/maven-multimod-changes.zip
deleted file mode 100644
index edcd030d4d..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-multimod-changes.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-multimod-incr.zip b/test/src/test/resources/hudson/maven/maven-multimod-incr.zip
deleted file mode 100644
index 71e0e08e3a..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-multimod-incr.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-multimod-rel-base.zip b/test/src/test/resources/hudson/maven/maven-multimod-rel-base.zip
deleted file mode 100644
index 912f30cc8c..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-multimod-rel-base.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-multimod.zip b/test/src/test/resources/hudson/maven/maven-multimod.zip
deleted file mode 100644
index ffecf2a093..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-multimod.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-multimodule-site.zip b/test/src/test/resources/hudson/maven/maven-multimodule-site.zip
deleted file mode 100644
index 14b13b4483..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-multimodule-site.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-multimodule-unit-failure.zip b/test/src/test/resources/hudson/maven/maven-multimodule-unit-failure.zip
deleted file mode 100755
index 9d1d6207d4..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-multimodule-unit-failure.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-opts-echo.zip b/test/src/test/resources/hudson/maven/maven-opts-echo.zip
deleted file mode 100644
index a0c358b94d..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-opts-echo.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-surefire-unstable.zip b/test/src/test/resources/hudson/maven/maven-surefire-unstable.zip
deleted file mode 100644
index a0c2f9657f..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-surefire-unstable.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven-test-failure-findbugs.zip b/test/src/test/resources/hudson/maven/maven-test-failure-findbugs.zip
deleted file mode 100755
index 878cff23c5..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven-test-failure-findbugs.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/maven3-project.zip b/test/src/test/resources/hudson/maven/maven3-project.zip
deleted file mode 100644
index 35c1bec72c..0000000000
Binary files a/test/src/test/resources/hudson/maven/maven3-project.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/multimodule-maven.zip b/test/src/test/resources/hudson/maven/multimodule-maven.zip
deleted file mode 100644
index 6cca3718fb..0000000000
Binary files a/test/src/test/resources/hudson/maven/multimodule-maven.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/several-modules-in-directory.zip b/test/src/test/resources/hudson/maven/several-modules-in-directory.zip
deleted file mode 100644
index 927ef95e7e..0000000000
Binary files a/test/src/test/resources/hudson/maven/several-modules-in-directory.zip and /dev/null differ
diff --git a/test/src/test/resources/hudson/maven/targz-artifact.pom b/test/src/test/resources/hudson/maven/targz-artifact.pom
deleted file mode 100644
index 3a2e44fc78..0000000000
--- a/test/src/test/resources/hudson/maven/targz-artifact.pom
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
- 4.0.0
- test
- test
- 0.1-SNAPSHOT
-
-
-
-
- maven-assembly-plugin
-
-
- bin
-
-
-
-
- package
-
- single
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test/src/test/resources/hudson/maven/test-pom-7162.xml b/test/src/test/resources/hudson/maven/test-pom-7162.xml
deleted file mode 100644
index 2b6f190398..0000000000
--- a/test/src/test/resources/hudson/maven/test-pom-7162.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
- 4.0.0
-
- com.infradna.support
- query
- 1.0-SNAPSHOT
- jar
-
- query
- http://maven.apache.org
-
-
- UTF-8
- bar
-
-
-
-
- junit
- junit
- 3.8.1
- test
-
-
-
diff --git a/test/src/test/resources/hudson/maven/test-pom-8395.xml b/test/src/test/resources/hudson/maven/test-pom-8395.xml
deleted file mode 100755
index 0ef0ff59ac..0000000000
--- a/test/src/test/resources/hudson/maven/test-pom-8395.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
- 4.0.0
- org.hudson-ci.testcase
- testcase-wrong-plugin-dep-scope
- 1.0-SNAPSHOT
- jar
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 1.6
-
-
- ant
- ant-nodeps
- 1.8.2
- test
-
-
-
-
-
-