提交 484c3057 编写于 作者: K kohsuke

Merged revisions 21777 via svnmerge from

https://www.dev.java.net/svn/hudson/branches/rc

........
  r21777 | kohsuke | 2009-09-17 09:55:27 -0700 (Thu, 17 Sep 2009) | 1 line
  
  fixed a regression in the JDK installation
........


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21781 71c3de6d-444a-0410-be80-ed276b4c234a
上级 facd1219
......@@ -170,7 +170,7 @@ public class JDKInstaller extends ToolInstaller {
throw new AbortException("Failed to find the extracted JDKs: "+paths);
// remove the intermediate directory
fs.pullUp(paths.get(0),expectedLocation);
fs.pullUp(expectedLocation+'/'+paths.get(0),expectedLocation);
break;
case WINDOWS:
/*
......@@ -235,10 +235,10 @@ public class JDKInstaller extends ToolInstaller {
void pullUp(String from, String to) throws IOException, InterruptedException;
}
private static final class FilePathFileSystem implements FileSystem {
/*package*/ static final class FilePathFileSystem implements FileSystem {
private final Node node;
private FilePathFileSystem(Node node) {
FilePathFileSystem(Node node) {
this.node = node;
}
......
......@@ -4,10 +4,13 @@ import org.jvnet.hudson.test.HudsonTestCase;
import hudson.model.JDK;
import hudson.model.FreeStyleProject;
import hudson.model.FreeStyleBuild;
import hudson.model.TaskListener;
import hudson.tasks.Shell;
import hudson.util.StreamTaskListener;
import hudson.tools.JDKInstaller.Platform;
import hudson.tools.JDKInstaller.CPU;
import hudson.FilePath;
import hudson.Launcher.LocalLauncher;
import java.io.File;
import java.util.Arrays;
......@@ -85,4 +88,26 @@ public class JDKInstallerTest extends HudsonTestCase {
assertTrue(log.contains(tmp.getAbsolutePath()));
}
/**
* Fake installation on Unix.
*/
public void testFakeUnixInstall() throws Exception {
File bundle = File.createTempFile("fake-jdk-by-hudson","sh");
try {
new FilePath(bundle).write(
"#!/bin/bash -ex\n" +
"mkdir -p jdk1.6.0_dummy/bin\n" +
"touch jdk1.6.0_dummy/bin/java","ASCII");
TaskListener l = new StreamTaskListener(System.out);
File d = env.temporaryDirectoryAllocator.allocate();
new JDKInstaller("",true).install(new LocalLauncher(l),Platform.LINUX,
new JDKInstaller.FilePathFileSystem(hudson),l,d.getPath(),bundle.getPath());
assertTrue(new File(d,"bin/java").exists());
} finally {
bundle.delete();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册