Author: markt Date: Thu Apr 14 14:16:19 2016 New Revision: 1739113 URL: http://svn.apache.org/viewvc?rev=1739113&view=rev Log: This test appears to be conflicting with another test but I can't see how. Give it a dedicated temp location to work in to (hopefully) avoid the conflict.
Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestFileResourceSetReadOnly.java Modified: tomcat/trunk/test/org/apache/catalina/webresources/TestFileResourceSetReadOnly.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/webresources/TestFileResourceSetReadOnly.java?rev=1739113&r1=1739112&r2=1739113&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/webresources/TestFileResourceSetReadOnly.java (original) +++ tomcat/trunk/test/org/apache/catalina/webresources/TestFileResourceSetReadOnly.java Thu Apr 14 14:16:19 2016 @@ -16,9 +16,35 @@ */ package org.apache.catalina.webresources; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.FileAttribute; + +import org.junit.AfterClass; +import org.junit.BeforeClass; + +import org.apache.catalina.startup.ExpandWar; +import org.apache.catalina.startup.TomcatBaseTest; + public class TestFileResourceSetReadOnly extends AbstractTestFileResourceSet { - private static final String dir1 = "test/webresources/dir1"; + private static Path tempDir; + private static File dir1; + + @BeforeClass + public static void before() throws IOException { + tempDir = Files.createTempDirectory("test", new FileAttribute[0]); + dir1 = new File(tempDir.toFile(), "dir1"); + TomcatBaseTest.recursiveCopy(new File("test/webresources/dir1").toPath(), dir1.toPath()); + } + + @AfterClass + public static void after() { + ExpandWar.delete(tempDir.toFile()); + } + public TestFileResourceSetReadOnly() { super(true); @@ -26,6 +52,6 @@ public class TestFileResourceSetReadOnly @Override protected String getDir1() { - return dir1; + return dir1.getAbsolutePath(); } } \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org