提交 0f4a76fb 编写于 作者: O Olivier Lamy

fix junit upgrade commons-io to 2.0.1

上级 1a9f3c67
......@@ -471,7 +471,6 @@ THE SOFTWARE.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency><!-- hudson doesn't use this directly, but some plugins wanted to use the latest -->
<groupId>commons-lang</groupId>
......
......@@ -182,7 +182,11 @@ THE SOFTWARE.
<groupId>org.jvnet.hudson</groupId>
<artifactId>hudson-maven-artifact-manager</artifactId>
<version>1.0</version>
</dependency>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>hudson-maven-embedder</artifactId>
......
......@@ -88,6 +88,9 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
private transient ModuleName moduleName;
/**
* @see documentation in {@link PomInfo#relativePath}
*/
private String relativePath;
/**
......@@ -481,6 +484,13 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
return reporterList;
}
/**
* for debug purpose
*/
public String toString() {
return super.toString()+'['+getFullName()+']'+"[relativePath:"+getRelativePath()+']';
}
private static final Logger LOGGER = Logger.getLogger(MavenModule.class.getName());
......
......@@ -228,4 +228,11 @@ final class PomInfo implements Serializable {
return StringUtils.equals( pomInfo.groupId, this.groupId )
&& StringUtils.equals( pomInfo.artifactId, this.artifactId );
}
/**
* for debug purpose
*/
public String toString() {
return "PomInfo:["+groupId+':'+artifactId+']'+"[relativePath:"+relativePath+']';
}
}
......@@ -359,6 +359,13 @@ THE SOFTWARE.
<artifactId>ant</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
......
......@@ -110,49 +110,7 @@ public class MavenMultiModuleTest extends HudsonTestCase {
pBuild.getDuration() >= summedModuleDuration);
}
@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"),
"moduleA"));
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);
}
@Bug(6544)
public void testEstimatedDurationForIncrementalMultiModMaven()
throws Exception {
......
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 {
@Override
public boolean end(MavenBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
assertNotNull(build.getProject().getWorkspace());
assertNotNull(build.getWorkspace());
return true;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册