提交 cad02234 编写于 作者: K kohsuke

Improving error handling to better understand the problem redsolo is facing:

testThatUsernameWithDifferentCasingIsNotDisplayedAsOne(hudson.plugins.cigame.ScoreCardActionIntegrationTest)  Time elapsed: 0 sec  <<< ERROR!
java.io.IOException: Access is denied
        at java.io.WinNTFileSystem.createFileExclusively(Native Method)
        at java.io.File.checkAndCreate(File.java:1704)
        at java.io.File.createTempFile(File.java:1793)
        at org.jvnet.hudson.test.TemporaryDirectoryAllocator.allocate(TemporaryDirectoryAllocator.java:63)
        at org.jvnet.hudson.test.HudsonHomeLoader$1.allocate(HudsonHomeLoader.java:54)
        at org.jvnet.hudson.test.HudsonHomeLoader$CopyExisting.allocate(HudsonHomeLoader.java:83)
        at org.jvnet.hudson.test.HudsonHomeLoader$Local.allocate(HudsonHomeLoader.java:123)
        at org.jvnet.hudson.test.HudsonTestCase.newHudson(HudsonTestCase.java:296)
        at org.jvnet.hudson.test.HudsonTestCase.setUp(HudsonTestCase.java:223)
        at junit.framework.TestCase.runBare(TestCase.java:132)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:91)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21372 71c3de6d-444a-0410-be80-ed276b4c234a
上级 620e3857
......@@ -24,6 +24,7 @@
package org.jvnet.hudson.test;
import hudson.FilePath;
import hudson.util.IOException2;
import java.io.File;
import java.io.IOException;
......@@ -60,11 +61,15 @@ public class TemporaryDirectoryAllocator {
* When this method returns, the directory already exists.
*/
public synchronized File allocate() throws IOException {
File f = File.createTempFile("hudson", "test", base);
f.delete();
f.mkdirs();
tmpDirectories.add(f);
return f;
try {
File f = File.createTempFile("hudson", "test", base);
f.delete();
f.mkdirs();
tmpDirectories.add(f);
return f;
} catch (IOException e) {
throw new IOException2("Failed to create a temporary directory in "+base,e);
}
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册