Author: markt
Date: Wed Oct 29 19:37:10 2014
New Revision: 1635273
URL: http://svn.apache.org/r1635273
Log:
Avoid using /tmp as a docBase where it is not necessary
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java
tomcat/trunk/test/org/apache/catalina/core/TestNamingContextListener.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextAliases.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardHostValve.java
tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestApplicationFilterConfig.java
Wed Oct 29 19:37:10 2014
@@ -37,9 +37,8 @@ public class TestApplicationFilterConfig
public void testBug54170() throws Exception {
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- Context ctx =
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "HelloWorld", new HelloWorldServlet());
ctx.addServletMapping("/", "HelloWorld");
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestNamingContextListener.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestNamingContextListener.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestNamingContextListener.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestNamingContextListener.java
Wed Oct 29 19:37:10 2014
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertEqu
import org.junit.Test;
+import org.apache.catalina.Context;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.startup.TomcatBaseTest;
@@ -48,9 +49,8 @@ public class TestNamingContextListener e
public void testBug49132() throws Exception {
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- org.apache.catalina.Context ctx =
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Enable JNDI - it is disabled by default
tomcat.enableNaming();
@@ -96,9 +96,8 @@ public class TestNamingContextListener e
public void testBug54096() throws Exception {
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- org.apache.catalina.Context ctx =
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Enable JNDI - it is disabled by default
tomcat.enableNaming();
Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContext.java Wed Oct
29 19:37:10 2014
@@ -421,9 +421,8 @@ public class TestStandardContext extends
// Set up a container
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Setup realm
TesterMapRealm realm = new TesterMapRealm();
@@ -491,9 +490,9 @@ public class TestStandardContext extends
// Set up a container
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
+
ctx.setDenyUncoveredHttpMethods(enableDeny);
// Setup realm
@@ -572,9 +571,8 @@ public class TestStandardContext extends
// Set up a container
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Add ServletContainerInitializer
Bug51376SCI sci = new Bug51376SCI(loadOnStartUp);
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextAliases.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContextAliases.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardContextAliases.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContextAliases.java
Wed Oct 29 19:37:10 2014
@@ -32,6 +32,7 @@ import static org.junit.Assert.assertTru
import org.junit.Test;
+import org.apache.catalina.Context;
import org.apache.catalina.WebResourceRoot;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.startup.TomcatBaseTest;
@@ -44,9 +45,8 @@ public class TestStandardContextAliases
public void testDirContextAliases() throws Exception {
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- StandardContext ctx = (StandardContext)
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
File lib = new File("webapps/examples/WEB-INF/lib");
ctx.setResources(new StandardRoot(ctx));
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java
Wed Oct 29 19:37:10 2014
@@ -16,7 +16,6 @@
*/
package org.apache.catalina.core;
-import java.io.File;
import java.io.IOException;
import javax.servlet.ServletException;
@@ -43,9 +42,8 @@ public class TestStandardContextValve ex
// Set up a container
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Traces order of events across multiple components
StringBuilder trace = new StringBuilder();
@@ -90,9 +88,8 @@ public class TestStandardContextValve ex
// Set up a container
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Traces order of events across multiple components
StringBuilder trace = new StringBuilder();
Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardHostValve.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardHostValve.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardHostValve.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardHostValve.java Wed
Oct 29 19:37:10 2014
@@ -16,7 +16,6 @@
*/
package org.apache.catalina.core;
-import java.io.File;
import java.io.IOException;
import javax.servlet.ServletException;
@@ -41,9 +40,8 @@ public class TestStandardHostValve exten
// Set up a container
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- File docBase = new File(System.getProperty("java.io.tmpdir"));
- Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
// Add the error page
Tomcat.addServlet(ctx, "error", new ErrorServlet());
Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java?rev=1635273&r1=1635272&r2=1635273&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestStandardWrapper.java Wed Oct
29 19:37:10 2014
@@ -250,9 +250,8 @@ public class TestStandardWrapper extends
// Setup Tomcat instance
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- Context ctx =
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
Servlet s = new DenyAllServlet();
ServletContainerInitializer sci = new SCI(s, useCreateServlet);
@@ -280,9 +279,9 @@ public class TestStandardWrapper extends
// Setup Tomcat instance
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- Context ctx =
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
+
ctx.setDenyUncoveredHttpMethods(denyUncovered);
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servletClassName);
@@ -431,9 +430,8 @@ public class TestStandardWrapper extends
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- StandardContext ctx = (StandardContext)
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "Bug51445", new Bug51445Servlet());
ctx.addServletMapping("/", "Bug51445");
@@ -475,9 +473,8 @@ public class TestStandardWrapper extends
Tomcat tomcat = getTomcatInstance();
- // Must have a real docBase - just use temp
- StandardContext ctx = (StandardContext)
- tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);
StandardWrapper wrapper = new StandardWrapper();
wrapper.setServletName("Bug51445");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]