Fix compilation
This commit is contained in:
parent
d7cc13d972
commit
9640d0470a
|
@ -18,7 +18,6 @@ import java.nio.ByteBuffer;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.concurrent.CountDownLatch;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
@ -33,9 +32,7 @@ import org.eclipse.jetty.http.DateGenerator;
|
||||||
import org.eclipse.jetty.http.HttpStatus;
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
import org.eclipse.jetty.http.HttpTester;
|
import org.eclipse.jetty.http.HttpTester;
|
||||||
import org.eclipse.jetty.http.HttpVersion;
|
import org.eclipse.jetty.http.HttpVersion;
|
||||||
import org.eclipse.jetty.server.HttpChannel;
|
|
||||||
import org.eclipse.jetty.server.LocalConnector;
|
import org.eclipse.jetty.server.LocalConnector;
|
||||||
import org.eclipse.jetty.server.Request;
|
|
||||||
import org.eclipse.jetty.server.Server;
|
import org.eclipse.jetty.server.Server;
|
||||||
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
|
import org.eclipse.jetty.server.handler.gzip.GzipHandler;
|
||||||
import org.eclipse.jetty.toolchain.test.FS;
|
import org.eclipse.jetty.toolchain.test.FS;
|
||||||
|
@ -56,7 +53,6 @@ import static org.hamcrest.Matchers.is;
|
||||||
import static org.hamcrest.Matchers.not;
|
import static org.hamcrest.Matchers.not;
|
||||||
import static org.hamcrest.Matchers.nullValue;
|
import static org.hamcrest.Matchers.nullValue;
|
||||||
import static org.hamcrest.Matchers.startsWith;
|
import static org.hamcrest.Matchers.startsWith;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the GzipHandler support when working with the {@link DefaultServlet}.
|
* Test the GzipHandler support when working with the {@link DefaultServlet}.
|
||||||
|
@ -83,17 +79,6 @@ public class GzipDefaultServletTest extends AbstractGzipTest
|
||||||
LocalConnector localConnector = new LocalConnector(server);
|
LocalConnector localConnector = new LocalConnector(server);
|
||||||
server.addConnector(localConnector);
|
server.addConnector(localConnector);
|
||||||
|
|
||||||
CountDownLatch latch = new CountDownLatch(1);
|
|
||||||
|
|
||||||
localConnector.addBean(new HttpChannel.Listener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onComplete(Request request)
|
|
||||||
{
|
|
||||||
latch.countDown();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Path contextDir = workDir.resolve("context");
|
Path contextDir = workDir.resolve("context");
|
||||||
FS.ensureDirExists(contextDir);
|
FS.ensureDirExists(contextDir);
|
||||||
|
|
||||||
|
@ -139,9 +124,6 @@ public class GzipDefaultServletTest extends AbstractGzipTest
|
||||||
|
|
||||||
assertThat("Response[Content-Length]", response.get("Content-Length"), is(nullValue()));
|
assertThat("Response[Content-Length]", response.get("Content-Length"), is(nullValue()));
|
||||||
|
|
||||||
// allow server to finish sending body (for HEAD, server.stop() races with the gzip writing thread)
|
|
||||||
assertTrue(latch.await(5, TimeUnit.SECONDS));
|
|
||||||
|
|
||||||
// A HEAD request should have similar headers, but no body
|
// A HEAD request should have similar headers, but no body
|
||||||
if (!method.equals("HEAD"))
|
if (!method.equals("HEAD"))
|
||||||
{
|
{
|
||||||
|
@ -158,13 +140,13 @@ public class GzipDefaultServletTest extends AbstractGzipTest
|
||||||
@Override
|
@Override
|
||||||
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
|
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
|
||||||
{
|
{
|
||||||
switch (req.getMethod())
|
|
||||||
{
|
|
||||||
case "WIBBLE":
|
|
||||||
// Disregard the method given, use GET instead.
|
// Disregard the method given, use GET instead.
|
||||||
|
if ("WIBBLE".equals(req.getMethod()))
|
||||||
|
{
|
||||||
doGet(req, resp);
|
doGet(req, resp);
|
||||||
return;
|
}
|
||||||
default:
|
else
|
||||||
|
{
|
||||||
super.service(req, resp);
|
super.service(req, resp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -474,7 +456,7 @@ public class GzipDefaultServletTest extends AbstractGzipTest
|
||||||
* A quality of 0 results in no compression.
|
* A quality of 0 results in no compression.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* See: http://bugs.eclipse.org/388072
|
* See: <a href="http://bugs.eclipse.org/388072">Bugzilla #388072</a>
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testIsNotGzipCompressedWithZeroQ() throws Exception
|
public void testIsNotGzipCompressedWithZeroQ() throws Exception
|
||||||
|
|
Loading…
Reference in New Issue