mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 13:32:24 +00:00
Updated doc
This commit is contained in:
1 parent
8b38b6d908
commit
0f9e154abb
1 file changed
+8
-7
@@ -527,9 +527,8 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
|
||||
* Locates Maven2 and configure that as the only Maven in the system.
|
||||
*/
|
||||
protected MavenInstallation configureDefaultMaven(String mavenVersion, int mavenReqVersion) throws Exception {
|
||||
// first if we are running inside Maven, pick that Maven, if it meets the criteria we require..
|
||||
// does it exists in the buildDirectory see maven-junit-plugin systemProperties
|
||||
// buildDirectory -> ${project.build.directory} (so no reason to be null ;-) )
|
||||
// Does it exists in the buildDirectory - i.e. already extracted from previous test?
|
||||
// see maven-junit-plugin systemProperties: buildDirectory -> ${project.build.directory} (so no reason to be null ;-) )
|
||||
String buildDirectory = System.getProperty( "buildDirectory", "./target/classes/" );
|
||||
File mavenAlreadyInstalled = new File(buildDirectory, mavenVersion);
|
||||
if (mavenAlreadyInstalled.exists()) {
|
||||
@@ -537,6 +536,8 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
|
||||
hudson.getDescriptorByType(Maven.DescriptorImpl.class).setInstallations(mavenInstallation);
|
||||
return mavenInstallation;
|
||||
}
|
||||
|
||||
// Does maven.home point to a Maven installation which satisfies mavenReqVersion?
|
||||
String home = System.getProperty("maven.home");
|
||||
if(home!=null) {
|
||||
MavenInstallation mavenInstallation = new MavenInstallation("default",home, NO_PROPERTIES);
|
||||
@@ -552,7 +553,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
|
||||
"To avoid a performance hit, set the system property 'maven.home' to point to a Maven2 installation.");
|
||||
FilePath mvn = hudson.getRootPath().createTempFile("maven", "zip");
|
||||
mvn.copyFrom(HudsonTestCase.class.getClassLoader().getResource(mavenVersion + "-bin.zip"));
|
||||
File mvnHome = new File(buildDirectory);//createTmpDir();
|
||||
File mvnHome = new File(buildDirectory);
|
||||
mvn.unzip(new FilePath(mvnHome));
|
||||
// TODO: switch to tar that preserves file permissions more easily
|
||||
if(!Functions.isWindows())
|
||||
@@ -1300,8 +1301,8 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits until Hudson finishes building everything, including those in the queue, or fail the test
|
||||
* if the specified timeout milliseconds is
|
||||
* Waits until Jenkins finishes building everything, including those builds in the queue, or fail the test
|
||||
* if the specified timeout milliseconds is exceeded.
|
||||
*/
|
||||
protected void waitUntilNoActivityUpTo(int timeout) throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
@@ -1325,7 +1326,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
|
||||
building.add(e.getCurrentExecutable());
|
||||
}
|
||||
}
|
||||
throw new AssertionError(String.format("Hudson is still doing something after %dms: queue=%s building=%s",
|
||||
throw new AssertionError(String.format("Jenkins is still doing something after %dms: queue=%s building=%s",
|
||||
timeout, Arrays.asList(hudson.getQueue().getItems()), building));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user