FAQ
Author: markt
Date: Wed Oct 29 20:00:04 2014
New Revision: 1635285

URL: http://svn.apache.org/r1635285
Log:
Avoid using /tmp as a docBase where it is not necessary

Modified:
     tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
     tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
     tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
     tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java

Modified: tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java?rev=1635285&r1=1635284&r2=1635285&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java (original)
+++ tomcat/trunk/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java Wed Oct 29 20:00:04 2014
@@ -69,8 +69,9 @@ public class TestAbstractAjpProcessor ex
          tomcat.getConnector().setProperty("connectionTimeout", "-1");
          tomcat.start();

- // 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");

@@ -176,8 +177,9 @@ public class TestAbstractAjpProcessor ex

          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, "bug55453", new Tester304WithBodyServlet());
          ctx.addServletMapping("/", "bug55453");

@@ -231,8 +233,9 @@ public class TestAbstractAjpProcessor ex

          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);
+
          ReadBodyServlet servlet = new ReadBodyServlet(callAvailable);
          Tomcat.addServlet(ctx, "ReadBody", servlet);
          ctx.addServletMapping("/", "ReadBody");

Modified: tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java?rev=1635285&r1=1635284&r2=1635285&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/TestAbstractHttp11Processor.java Wed Oct 29 20:00:04 2014
@@ -57,13 +57,13 @@ public class TestAbstractHttp11Processor
      public void testResponseWithErrorChunked() throws Exception {
          Tomcat tomcat = getTomcatInstance();

- // Must have a real docBase - just use temp
- Context ctxt = tomcat.addContext("", System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);

          // Add protected servlet
- Tomcat.addServlet(ctxt, "ChunkedResponseWithErrorServlet",
+ Tomcat.addServlet(ctx, "ChunkedResponseWithErrorServlet",
                  new ResponseWithErrorServlet(true));
- ctxt.addServletMapping("/*", "ChunkedResponseWithErrorServlet");
+ ctx.addServletMapping("/*", "ChunkedResponseWithErrorServlet");

          tomcat.start();

@@ -347,13 +347,12 @@ public class TestAbstractHttp11Processor
      public void testPipelining() throws Exception {
          Tomcat tomcat = getTomcatInstance();

- // Must have a real docBase - just use temp
- Context ctxt = tomcat.addContext("",
- System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);

          // Add protected servlet
- Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMapping("/foo", "TesterServlet");
+ Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
+ ctx.addServletMapping("/foo", "TesterServlet");

          tomcat.start();

@@ -408,13 +407,12 @@ public class TestAbstractHttp11Processor
      public void testChunking11NoContentLength() throws Exception {
          Tomcat tomcat = getTomcatInstance();

- // Must have a real docBase - just use temp
- Context ctxt = tomcat.addContext("",
- System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);

- Tomcat.addServlet(ctxt, "NoContentLengthFlushingServlet",
+ Tomcat.addServlet(ctx, "NoContentLengthFlushingServlet",
                  new NoContentLengthFlushingServlet());
- ctxt.addServletMapping("/test", "NoContentLengthFlushingServlet");
+ ctx.addServletMapping("/test", "NoContentLengthFlushingServlet");

          tomcat.start();

@@ -436,13 +434,12 @@ public class TestAbstractHttp11Processor

          Tomcat tomcat = getTomcatInstance();

- // Must have a real docBase - just use temp
- Context ctxt = tomcat.addContext("",
- System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);

- Tomcat.addServlet(ctxt, "NoContentLengthConnectionCloseFlushingServlet",
+ Tomcat.addServlet(ctx, "NoContentLengthConnectionCloseFlushingServlet",
                  new NoContentLengthConnectionCloseFlushingServlet());
- ctxt.addServletMapping("/test",
+ ctx.addServletMapping("/test",
                  "NoContentLengthConnectionCloseFlushingServlet");

          tomcat.start();
@@ -477,13 +474,12 @@ public class TestAbstractHttp11Processor
      private void doTestBug53677(boolean flush) throws Exception {
          Tomcat tomcat = getTomcatInstance();

- // Must have a real docBase - just use temp
- Context ctxt = tomcat.addContext("",
- System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);

- Tomcat.addServlet(ctxt, "LargeHeaderServlet",
+ Tomcat.addServlet(ctx, "LargeHeaderServlet",
                  new LargeHeaderServlet(flush));
- ctxt.addServletMapping("/test", "LargeHeaderServlet");
+ ctx.addServletMapping("/test", "LargeHeaderServlet");

          tomcat.start();

@@ -514,12 +510,11 @@ public class TestAbstractHttp11Processor
          tomcat.getConnector().setProperty("processorCache", "1");
          tomcat.getConnector().setProperty("maxThreads", "1");

- // Must have a real docBase - just use temp
- Context ctxt = tomcat.addContext("",
- System.getProperty("java.io.tmpdir"));
+ // No file system docBase required
+ Context ctx = tomcat.addContext("", null);

- Tomcat.addServlet(ctxt, "async", new Bug55772Servlet());
- ctxt.addServletMapping("/*", "async");
+ Tomcat.addServlet(ctx, "async", new Bug55772Servlet());
+ ctx.addServletMapping("/*", "async");

          tomcat.start();


Modified: tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java?rev=1635285&r1=1635284&r2=1635285&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java Wed Oct 29 20:00:04 2014
@@ -101,9 +101,8 @@ public class TestChunkedInputFilter exte
          // 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);

          EchoHeaderServlet servlet = new EchoHeaderServlet(expectPass);
          Tomcat.addServlet(ctx, "servlet", servlet);
@@ -165,9 +164,8 @@ public class TestChunkedInputFilter exte
          // 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);

          Tomcat.addServlet(ctx, "servlet", new EchoHeaderServlet(false));
          ctx.addServletMapping("/", "servlet");
@@ -229,9 +227,8 @@ public class TestChunkedInputFilter exte
          tomcat.getConnector().setProperty(
                  "maxExtensionSize", Integer.toString(EXT_SIZE_LIMIT));

- // 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, "servlet", new EchoHeaderServlet(ok));
          ctx.addServletMapping("/", "servlet");
@@ -278,9 +275,8 @@ public class TestChunkedInputFilter exte
          // 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);

          Tomcat.addServlet(ctx, "servlet", new EchoHeaderServlet(true));
          ctx.addServletMapping("/", "servlet");
@@ -378,9 +374,8 @@ public class TestChunkedInputFilter exte
          // 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);

          BodyReadServlet servlet = new BodyReadServlet(expectPass, readLimit);
          Tomcat.addServlet(ctx, "servlet", servlet);

Modified: tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java?rev=1635285&r1=1635284&r2=1635285&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java (original)
+++ tomcat/trunk/test/org/apache/coyote/http11/upgrade/TestUpgrade.java Wed Oct 29 20:00:04 2014
@@ -149,9 +149,8 @@ public class TestUpgrade extends TomcatB
          // 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);

          UpgradeServlet servlet = new UpgradeServlet(upgradeHandlerClass);
          Tomcat.addServlet(ctx, "servlet", servlet);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupdev @
categoriestomcat
postedOct 29, '14 at 8:01p
activeOct 29, '14 at 8:01p
posts1
users1
websitetomcat.apache.org
irc#tomcat

1 user in discussion

Markt: 1 post

People

Translate

site design / logo © 2017 Grokbase