You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2016/10/31 20:03:34 UTC

svn commit: r1767358 - in /tomcat/tc8.5.x/trunk/test/org/apache: catalina/connector/TestCoyoteOutputStream.java coyote/http11/filters/TestGzipOutputFilter.java

Author: markt
Date: Mon Oct 31 20:03:34 2016
New Revision: 1767358

URL: http://svn.apache.org/viewvc?rev=1767358&view=rev
Log:
Fix use of deprecated code in unit tests.

Modified:
    tomcat/tc8.5.x/trunk/test/org/apache/catalina/connector/TestCoyoteOutputStream.java
    tomcat/tc8.5.x/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java

Modified: tomcat/tc8.5.x/trunk/test/org/apache/catalina/connector/TestCoyoteOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/test/org/apache/catalina/connector/TestCoyoteOutputStream.java?rev=1767358&r1=1767357&r2=1767358&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/test/org/apache/catalina/connector/TestCoyoteOutputStream.java (original)
+++ tomcat/tc8.5.x/trunk/test/org/apache/catalina/connector/TestCoyoteOutputStream.java Mon Oct 31 20:03:34 2016
@@ -108,7 +108,7 @@ public class TestCoyoteOutputStream exte
 
         Context root = tomcat.addContext("", TEMP_DIR);
         Tomcat.addServlet(root, "testServlet", new TestServlet());
-        root.addServletMapping("/", "testServlet");
+        root.addServletMappingDecoded("/", "testServlet");
 
         tomcat.start();
 

Modified: tomcat/tc8.5.x/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/tc8.5.x/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java?rev=1767358&r1=1767357&r2=1767358&view=diff
==============================================================================
--- tomcat/tc8.5.x/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java (original)
+++ tomcat/tc8.5.x/trunk/test/org/apache/coyote/http11/filters/TestGzipOutputFilter.java Mon Oct 31 20:03:34 2016
@@ -18,6 +18,7 @@
 package org.apache.coyote.http11.filters;
 
 import java.io.ByteArrayOutputStream;
+import java.nio.ByteBuffer;
 import java.util.zip.GZIPOutputStream;
 
 import static org.junit.Assert.assertTrue;
@@ -25,7 +26,6 @@ import static org.junit.Assert.assertTru
 import org.junit.Test;
 
 import org.apache.coyote.Response;
-import org.apache.tomcat.util.buf.ByteChunk;
 
 /**
  * Test case to demonstrate the interaction between gzip and flushing in the
@@ -60,10 +60,9 @@ public class TestGzipOutputFilter {
         tob.addActiveFilter(gf);
 
         // write a chunk out
-        ByteChunk chunk = new ByteChunk(1024);
         byte[] d = "Hello there tomcat developers, there is a bug in JDK".getBytes();
-        chunk.append(d, 0, d.length);
-        tob.doWrite(chunk);
+        ByteBuffer bb = ByteBuffer.wrap(d);
+        tob.doWrite(bb);
 
         // flush the InternalOutputBuffer
         tob.flush();



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