org.codehaus.mojo
findbugs-maven-plugin
diff --git a/jetty-security/src/test/java/org/eclipse/jetty/security/AliasedConstraintTest.java b/jetty-security/src/test/java/org/eclipse/jetty/security/AliasedConstraintTest.java
index b14d0232172..5237cc3e2b6 100644
--- a/jetty-security/src/test/java/org/eclipse/jetty/security/AliasedConstraintTest.java
+++ b/jetty-security/src/test/java/org/eclipse/jetty/security/AliasedConstraintTest.java
@@ -1,184 +1,184 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.security;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.startsWith;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jetty.http.HttpStatus;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.LocalConnector;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.handler.ContextHandler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerList;
-import org.eclipse.jetty.server.handler.ResourceHandler;
-import org.eclipse.jetty.server.session.SessionHandler;
-import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
-import org.eclipse.jetty.util.security.Constraint;
-import org.eclipse.jetty.util.security.Password;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameter;
-import org.junit.runners.Parameterized.Parameters;
-
-/**
- * Some requests for static data that is served by ResourceHandler, but some is secured.
- *
- * This is mainly here to test security bypass techniques using aliased names that should be caught.
- */
-@RunWith(Parameterized.class)
-public class AliasedConstraintTest
-{
- private static final String TEST_REALM = "TestRealm";
- private static Server server;
- private static LocalConnector connector;
- private static ConstraintSecurityHandler security;
-
-
- @BeforeClass
- public static void startServer() throws Exception
- {
- server = new Server();
- connector = new LocalConnector(server);
- server.setConnectors(new Connector[] { connector });
-
- ContextHandler context = new ContextHandler();
- SessionHandler session = new SessionHandler();
-
- TestLoginService loginService = new TestLoginService(TEST_REALM);
-
- loginService.putUser("user0",new Password("password"),new String[] {});
- loginService.putUser("user",new Password("password"),new String[] { "user" });
- loginService.putUser("user2",new Password("password"),new String[] { "user" });
- loginService.putUser("admin",new Password("password"),new String[] { "user", "administrator" });
- loginService.putUser("user3",new Password("password"),new String[] { "foo" });
-
- context.setContextPath("/ctx");
- context.setResourceBase(MavenTestingUtils.getTestResourceDir("docroot").getAbsolutePath());
-
- HandlerList handlers = new HandlerList();
- handlers.setHandlers(new Handler[]{context,new DefaultHandler()});
- server.setHandler(handlers);
- context.setHandler(session);
- // context.addAliasCheck(new AllowSymLinkAliasChecker());
-
- server.addBean(loginService);
-
- security = new ConstraintSecurityHandler();
- session.setHandler(security);
- ResourceHandler handler = new ResourceHandler();
- security.setHandler(handler);
-
- List constraints = new ArrayList<>();
-
- Constraint constraint0 = new Constraint();
- constraint0.setAuthenticate(true);
- constraint0.setName("forbid");
- ConstraintMapping mapping0 = new ConstraintMapping();
- mapping0.setPathSpec("/forbid/*");
- mapping0.setConstraint(constraint0);
- constraints.add(mapping0);
-
- Set knownRoles = new HashSet<>();
- knownRoles.add("user");
- knownRoles.add("administrator");
-
- security.setConstraintMappings(constraints,knownRoles);
- server.start();
- }
-
- @AfterClass
- public static void stopServer() throws Exception
- {
- server.stop();
- }
-
- @Parameters(name = "{0}: {1}")
- public static Collection data()
- {
- List data = new ArrayList<>();
-
- final String OPENCONTENT = "this is open content";
-
- data.add(new Object[] { "/ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
- data.add(new Object[] { "/ctx/ALL/index.txt", HttpStatus.NOT_FOUND_404, null });
- data.add(new Object[] { "/ctx/ALL/Fred/../index.txt", HttpStatus.NOT_FOUND_404, null });
- data.add(new Object[] { "/ctx/../bar/../ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
- data.add(new Object[] { "/ctx/forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
- data.add(new Object[] { "/ctx/all/../forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
- data.add(new Object[] { "/ctx/FoRbId/index.txt", HttpStatus.NOT_FOUND_404, null });
-
- return data;
- }
-
- @Parameter(value = 0)
- public String uri;
-
- @Parameter(value = 1)
- public int expectedStatusCode;
-
- @Parameter(value = 2)
- public String expectedContent;
-
- @Test
- public void testAccess() throws Exception
- {
- StringBuilder request = new StringBuilder();
- request.append("GET ").append(uri).append(" HTTP/1.1\r\n");
- request.append("Host: localhost\r\n");
- request.append("Connection: close\r\n");
- request.append("\r\n");
-
- String response = connector.getResponse(request.toString());
-
- switch (expectedStatusCode)
- {
- case 200:
- assertThat(response,startsWith("HTTP/1.1 200 OK"));
- break;
- case 403:
- assertThat(response,startsWith("HTTP/1.1 403 Forbidden"));
- break;
- case 404:
- assertThat(response,startsWith("HTTP/1.1 404 Not Found"));
- break;
- default:
- fail("Write a handler for response status code: " + expectedStatusCode);
- break;
- }
-
- if (expectedContent != null)
- {
- assertThat(response,containsString("this is open content"));
- }
- }
-}
+//
+// ========================================================================
+// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.security;
+
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.startsWith;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jetty.http.HttpStatus;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.LocalConnector;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.ContextHandler;
+import org.eclipse.jetty.server.handler.DefaultHandler;
+import org.eclipse.jetty.server.handler.HandlerList;
+import org.eclipse.jetty.server.handler.ResourceHandler;
+import org.eclipse.jetty.server.session.SessionHandler;
+import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.eclipse.jetty.util.security.Constraint;
+import org.eclipse.jetty.util.security.Password;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameter;
+import org.junit.runners.Parameterized.Parameters;
+
+/**
+ * Some requests for static data that is served by ResourceHandler, but some is secured.
+ *
+ * This is mainly here to test security bypass techniques using aliased names that should be caught.
+ */
+@RunWith(Parameterized.class)
+public class AliasedConstraintTest
+{
+ private static final String TEST_REALM = "TestRealm";
+ private static Server server;
+ private static LocalConnector connector;
+ private static ConstraintSecurityHandler security;
+
+
+ @BeforeClass
+ public static void startServer() throws Exception
+ {
+ server = new Server();
+ connector = new LocalConnector(server);
+ server.setConnectors(new Connector[] { connector });
+
+ ContextHandler context = new ContextHandler();
+ SessionHandler session = new SessionHandler();
+
+ TestLoginService loginService = new TestLoginService(TEST_REALM);
+
+ loginService.putUser("user0",new Password("password"),new String[] {});
+ loginService.putUser("user",new Password("password"),new String[] { "user" });
+ loginService.putUser("user2",new Password("password"),new String[] { "user" });
+ loginService.putUser("admin",new Password("password"),new String[] { "user", "administrator" });
+ loginService.putUser("user3",new Password("password"),new String[] { "foo" });
+
+ context.setContextPath("/ctx");
+ context.setResourceBase(MavenTestingUtils.getTestResourceDir("docroot").getAbsolutePath());
+
+ HandlerList handlers = new HandlerList();
+ handlers.setHandlers(new Handler[]{context,new DefaultHandler()});
+ server.setHandler(handlers);
+ context.setHandler(session);
+ // context.addAliasCheck(new AllowSymLinkAliasChecker());
+
+ server.addBean(loginService);
+
+ security = new ConstraintSecurityHandler();
+ session.setHandler(security);
+ ResourceHandler handler = new ResourceHandler();
+ security.setHandler(handler);
+
+ List constraints = new ArrayList<>();
+
+ Constraint constraint0 = new Constraint();
+ constraint0.setAuthenticate(true);
+ constraint0.setName("forbid");
+ ConstraintMapping mapping0 = new ConstraintMapping();
+ mapping0.setPathSpec("/forbid/*");
+ mapping0.setConstraint(constraint0);
+ constraints.add(mapping0);
+
+ Set knownRoles = new HashSet<>();
+ knownRoles.add("user");
+ knownRoles.add("administrator");
+
+ security.setConstraintMappings(constraints,knownRoles);
+ server.start();
+ }
+
+ @AfterClass
+ public static void stopServer() throws Exception
+ {
+ server.stop();
+ }
+
+ @Parameters(name = "{0}: {1}")
+ public static Collection data()
+ {
+ List data = new ArrayList<>();
+
+ final String OPENCONTENT = "this is open content";
+
+ data.add(new Object[] { "/ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
+ data.add(new Object[] { "/ctx/ALL/index.txt", HttpStatus.NOT_FOUND_404, null });
+ data.add(new Object[] { "/ctx/ALL/Fred/../index.txt", HttpStatus.NOT_FOUND_404, null });
+ data.add(new Object[] { "/ctx/../bar/../ctx/all/index.txt", HttpStatus.OK_200, OPENCONTENT });
+ data.add(new Object[] { "/ctx/forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
+ data.add(new Object[] { "/ctx/all/../forbid/index.txt", HttpStatus.FORBIDDEN_403, null });
+ data.add(new Object[] { "/ctx/FoRbId/index.txt", HttpStatus.NOT_FOUND_404, null });
+
+ return data;
+ }
+
+ @Parameter(value = 0)
+ public String uri;
+
+ @Parameter(value = 1)
+ public int expectedStatusCode;
+
+ @Parameter(value = 2)
+ public String expectedContent;
+
+ @Test
+ public void testAccess() throws Exception
+ {
+ StringBuilder request = new StringBuilder();
+ request.append("GET ").append(uri).append(" HTTP/1.1\r\n");
+ request.append("Host: localhost\r\n");
+ request.append("Connection: close\r\n");
+ request.append("\r\n");
+
+ String response = connector.getResponse(request.toString());
+
+ switch (expectedStatusCode)
+ {
+ case 200:
+ assertThat(response,startsWith("HTTP/1.1 200 OK"));
+ break;
+ case 403:
+ assertThat(response,startsWith("HTTP/1.1 403 Forbidden"));
+ break;
+ case 404:
+ assertThat(response,startsWith("HTTP/1.1 404 Not Found"));
+ break;
+ default:
+ fail("Write a handler for response status code: " + expectedStatusCode);
+ break;
+ }
+
+ if (expectedContent != null)
+ {
+ assertThat(response,containsString("this is open content"));
+ }
+ }
+}
diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml
index 233ca5c06de..ccbf03688a3 100644
--- a/jetty-server/pom.xml
+++ b/jetty-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-server
@@ -14,35 +14,10 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- generate-manifest
-
- manifest
-
-
-
- javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*
- <_nouses>true
-
-
-
-
-
org.apache.maven.plugins
maven-jar-plugin
-
- artifact-jar
-
- jar
-
-
test-jar
@@ -50,28 +25,6 @@
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- package
-
- single
-
-
-
- config
-
-
-
-
org.codehaus.mojo
@@ -83,18 +36,9 @@
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
javax.servlet
javax.servlet-api
-
org.eclipse.jetty
@@ -119,9 +63,16 @@
true
- org.mockito
- mockito-core
+ org.eclipse.jetty.toolchain
+ jetty-test-helper
test
-
+
+
+ org.eclipse.jetty
+ jetty-http
+ ${project.version}
+ tests
+ test
+
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java
index f5524572669..9259a3fbb48 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java
@@ -378,6 +378,16 @@ public class LocalConnector extends AbstractConnector
}
}
}
+
+ /**
+ * Remaining output ByteBuffer after calls to {@link #getResponse()} or {@link #waitForResponse(boolean, long, TimeUnit)}
+ *
+ * @return the remaining response data buffer
+ */
+ public ByteBuffer getResponseData()
+ {
+ return _responseData;
+ }
/**
* Wait for a response using a parser to detect the end of message
@@ -515,7 +525,7 @@ public class LocalConnector extends AbstractConnector
}
}
}
-
+
if (bout.getCount()==0 && isOutputShutdown())
return null;
return ByteBuffer.wrap(bout.getBuf(),0,bout.getCount());
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java
index d89088a6634..10370b20d08 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ServerConnectorTest.java
@@ -57,17 +57,8 @@ import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
-import static org.hamcrest.Matchers.anyOf;
-import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.greaterThan;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-
public class ServerConnectorTest
{
public static class ReuseInfoHandler extends AbstractHandler
diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml
index 7d4d1698d2f..2ff8909c825 100644
--- a/jetty-servlet/pom.xml
+++ b/jetty-servlet/pom.xml
@@ -3,7 +3,7 @@
jetty-project
org.eclipse.jetty
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-servlet
@@ -16,34 +16,8 @@
- org.apache.felix
- maven-bundle-plugin
- true
-
-
-
- manifest
-
-
-
- javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*
- <_nouses>true
-
-
-
-
-
-
-
org.apache.maven.plugins
maven-jar-plugin
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
tests
@@ -53,23 +27,6 @@
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- package
-
- single
-
-
-
- config
-
-
-
-
-
org.codehaus.mojo
findbugs-maven-plugin
@@ -96,5 +53,12 @@
jetty-test-helper
test
+
+ org.eclipse.jetty
+ jetty-http
+ ${project.version}
+ tests
+ test
+
diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml
index 6b9e284b022..254631b857f 100644
--- a/jetty-servlets/pom.xml
+++ b/jetty-servlets/pom.xml
@@ -3,7 +3,7 @@
jetty-project
org.eclipse.jetty
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-servlets
@@ -15,52 +15,6 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
-
- manifest
-
-
-
- javax.servlet.*;version="[2.6.0,3.2)",*
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- package
-
- single
-
-
-
- config
-
-
-
-
-
org.codehaus.mojo
findbugs-maven-plugin
@@ -108,6 +62,20 @@
${project.version}
test
+
+ org.eclipse.jetty
+ jetty-http
+ ${project.version}
+ tests
+ test
+
+
+ org.eclipse.jetty
+ jetty-servlet
+ ${project.version}
+ tests
+ test
+
org.eclipse.jetty.toolchain
jetty-test-helper
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java
index 9df5e0c79e0..c0a138112ec 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/ThreadStarvationTest.java
@@ -1,407 +1,407 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.servlets;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.StandardOpenOption;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.BrokenBarrierException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.Exchanger;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.eclipse.jetty.io.ChannelEndPoint;
-import org.eclipse.jetty.io.ManagedSelector;
-import org.eclipse.jetty.io.SocketChannelEndPoint;
-import org.eclipse.jetty.server.HttpChannel;
-import org.eclipse.jetty.server.Request;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.handler.AbstractHandler;
-import org.eclipse.jetty.servlet.DefaultServlet;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
-import org.eclipse.jetty.toolchain.test.TestTracker;
-import org.eclipse.jetty.toolchain.test.annotation.Slow;
-import org.eclipse.jetty.util.log.StacklessLogging;
-import org.eclipse.jetty.util.thread.QueuedThreadPool;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-
-public class ThreadStarvationTest
-{
- @Rule
- public TestTracker tracker = new TestTracker();
- private Server _server;
-
- @After
- public void dispose() throws Exception
- {
- if (_server != null)
- _server.stop();
- }
-
- @Test
- @Slow
- public void testDefaultServletSuccess() throws Exception
- {
- int maxThreads = 10;
- QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
- threadPool.setDetailedDump(true);
- _server = new Server(threadPool);
-
- // Prepare a big file to download.
- File directory = MavenTestingUtils.getTargetTestingDir();
- Files.createDirectories(directory.toPath());
- String resourceName = "resource.bin";
- Path resourcePath = Paths.get(directory.getPath(), resourceName);
- try (OutputStream output = Files.newOutputStream(resourcePath, StandardOpenOption.CREATE, StandardOpenOption.WRITE))
- {
- byte[] chunk = new byte[1024];
- Arrays.fill(chunk,(byte)'X');
- chunk[chunk.length-2]='\r';
- chunk[chunk.length-1]='\n';
- for (int i = 0; i < 256 * 1024; ++i)
- output.write(chunk);
- }
-
- final CountDownLatch writePending = new CountDownLatch(1);
- ServerConnector connector = new ServerConnector(_server, 0, 1)
- {
- @Override
- protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
- {
- return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
- {
- @Override
- protected void onIncompleteFlush()
- {
- super.onIncompleteFlush();
- writePending.countDown();
- }
- };
- }
- };
- connector.setIdleTimeout(Long.MAX_VALUE);
- _server.addConnector(connector);
-
- ServletContextHandler context = new ServletContextHandler(_server, "/");
- context.setResourceBase(directory.toURI().toString());
- context.addServlet(DefaultServlet.class, "/*").setAsyncSupported(false);
- _server.setHandler(context);
-
- _server.start();
-
- List sockets = new ArrayList<>();
- for (int i = 0; i < maxThreads*2; ++i)
- {
- Socket socket = new Socket("localhost", connector.getLocalPort());
- sockets.add(socket);
- OutputStream output = socket.getOutputStream();
- String request = "" +
- "GET /" + resourceName + " HTTP/1.1\r\n" +
- "Host: localhost\r\n" +
- "\r\n";
- output.write(request.getBytes(StandardCharsets.UTF_8));
- output.flush();
- Thread.sleep(100);
- }
-
- // Wait for a the servlet to block.
- Assert.assertTrue(writePending.await(5, TimeUnit.SECONDS));
-
- long expected = Files.size(resourcePath);
- byte[] buffer = new byte[48 * 1024];
- List> totals = new ArrayList<>();
- for (Socket socket : sockets)
- {
- final Exchanger x = new Exchanger<>();
- totals.add(x);
- final InputStream input = socket.getInputStream();
-
- new Thread()
- {
- @Override
- public void run()
- {
- long total=0;
- try
- {
- // look for CRLFCRLF
- StringBuilder header = new StringBuilder();
- int state=0;
- while (state<4 && header.length()<2048)
- {
- int ch=input.read();
- if (ch<0)
- break;
- header.append((char)ch);
- switch(state)
- {
- case 0:
- if (ch=='\r')
- state=1;
- break;
- case 1:
- if (ch=='\n')
- state=2;
- else
- state=0;
- break;
- case 2:
- if (ch=='\r')
- state=3;
- else
- state=0;
- break;
- case 3:
- if (ch=='\n')
- state=4;
- else
- state=0;
- break;
- }
- }
-
- while (total x : totals)
- {
- Long total = x.exchange(-1L,10000,TimeUnit.SECONDS);
- Assert.assertEquals(expected,total.longValue());
- }
-
- // We could read everything, good.
- for (Socket socket : sockets)
- socket.close();
- }
-
- @Test
- public void testFailureStarvation() throws Exception
- {
- try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class))
- {
- int acceptors = 0;
- int selectors = 1;
- int maxThreads = 10;
- final int barried=maxThreads-acceptors-selectors*2;
- final CyclicBarrier barrier = new CyclicBarrier(barried);
-
-
- QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
- threadPool.setDetailedDump(true);
- _server = new Server(threadPool);
-
-
- ServerConnector connector = new ServerConnector(_server, acceptors, selectors)
- {
- @Override
- protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
- {
- return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
- {
- @Override
- public boolean flush(ByteBuffer... buffers) throws IOException
- {
- super.flush(buffers[0]);
- throw new IOException("TEST FAILURE");
- }
- };
- }
- };
- connector.setIdleTimeout(Long.MAX_VALUE);
- _server.addConnector(connector);
-
- final AtomicInteger count = new AtomicInteger(0);
- _server.setHandler(new AbstractHandler()
- {
- @Override
- public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
- {
- int c=count.getAndIncrement();
- try
- {
- if (c sockets = new ArrayList<>();
- for (int i = 0; i < maxThreads*2; ++i)
- {
- Socket socket = new Socket("localhost", connector.getLocalPort());
- sockets.add(socket);
- OutputStream output = socket.getOutputStream();
- String request = "" +
- "GET / HTTP/1.1\r\n" +
- "Host: localhost\r\n" +
- // "Connection: close\r\n" +
- "\r\n";
- output.write(request.getBytes(StandardCharsets.UTF_8));
- output.flush();
- }
-
- byte[] buffer = new byte[48 * 1024];
- List> totals = new ArrayList<>();
- for (Socket socket : sockets)
- {
- final Exchanger x = new Exchanger<>();
- totals.add(x);
- final InputStream input = socket.getInputStream();
-
- new Thread()
- {
- @Override
- public void run()
- {
- int read=0;
- try
- {
- // look for CRLFCRLF
- StringBuilder header = new StringBuilder();
- int state=0;
- while (state<4 && header.length()<2048)
- {
- int ch=input.read();
- if (ch<0)
- break;
- header.append((char)ch);
- switch(state)
- {
- case 0:
- if (ch=='\r')
- state=1;
- break;
- case 1:
- if (ch=='\n')
- state=2;
- else
- state=0;
- break;
- case 2:
- if (ch=='\r')
- state=3;
- else
- state=0;
- break;
- case 3:
- if (ch=='\n')
- state=4;
- else
- state=0;
- break;
- }
- }
-
- read=input.read(buffer);
- }
- catch (IOException e)
- {
- // e.printStackTrace();
- }
- finally
- {
- try
- {
- x.exchange(read);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- }
- }
- }.start();
- }
-
- for (Exchanger x : totals)
- {
- Integer read = x.exchange(-1,10,TimeUnit.SECONDS);
- Assert.assertEquals(-1,read.intValue());
- }
-
- // We could read everything, good.
- for (Socket socket : sockets)
- socket.close();
-
- _server.stop();
- }
- }
-}
+//
+// ========================================================================
+// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.servlets;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.nio.ByteBuffer;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.Exchanger;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.io.ChannelEndPoint;
+import org.eclipse.jetty.io.ManagedSelector;
+import org.eclipse.jetty.io.SocketChannelEndPoint;
+import org.eclipse.jetty.server.HttpChannel;
+import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.server.handler.AbstractHandler;
+import org.eclipse.jetty.servlet.DefaultServlet;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.eclipse.jetty.toolchain.test.TestTracker;
+import org.eclipse.jetty.toolchain.test.annotation.Slow;
+import org.eclipse.jetty.util.log.StacklessLogging;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class ThreadStarvationTest
+{
+ @Rule
+ public TestTracker tracker = new TestTracker();
+ private Server _server;
+
+ @After
+ public void dispose() throws Exception
+ {
+ if (_server != null)
+ _server.stop();
+ }
+
+ @Test
+ @Slow
+ public void testDefaultServletSuccess() throws Exception
+ {
+ int maxThreads = 10;
+ QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
+ threadPool.setDetailedDump(true);
+ _server = new Server(threadPool);
+
+ // Prepare a big file to download.
+ File directory = MavenTestingUtils.getTargetTestingDir();
+ Files.createDirectories(directory.toPath());
+ String resourceName = "resource.bin";
+ Path resourcePath = Paths.get(directory.getPath(), resourceName);
+ try (OutputStream output = Files.newOutputStream(resourcePath, StandardOpenOption.CREATE, StandardOpenOption.WRITE))
+ {
+ byte[] chunk = new byte[1024];
+ Arrays.fill(chunk,(byte)'X');
+ chunk[chunk.length-2]='\r';
+ chunk[chunk.length-1]='\n';
+ for (int i = 0; i < 256 * 1024; ++i)
+ output.write(chunk);
+ }
+
+ final CountDownLatch writePending = new CountDownLatch(1);
+ ServerConnector connector = new ServerConnector(_server, 0, 1)
+ {
+ @Override
+ protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
+ {
+ return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
+ {
+ @Override
+ protected void onIncompleteFlush()
+ {
+ super.onIncompleteFlush();
+ writePending.countDown();
+ }
+ };
+ }
+ };
+ connector.setIdleTimeout(Long.MAX_VALUE);
+ _server.addConnector(connector);
+
+ ServletContextHandler context = new ServletContextHandler(_server, "/");
+ context.setResourceBase(directory.toURI().toString());
+ context.addServlet(DefaultServlet.class, "/*").setAsyncSupported(false);
+ _server.setHandler(context);
+
+ _server.start();
+
+ List sockets = new ArrayList<>();
+ for (int i = 0; i < maxThreads*2; ++i)
+ {
+ Socket socket = new Socket("localhost", connector.getLocalPort());
+ sockets.add(socket);
+ OutputStream output = socket.getOutputStream();
+ String request = "" +
+ "GET /" + resourceName + " HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ "\r\n";
+ output.write(request.getBytes(StandardCharsets.UTF_8));
+ output.flush();
+ Thread.sleep(100);
+ }
+
+ // Wait for a the servlet to block.
+ Assert.assertTrue(writePending.await(5, TimeUnit.SECONDS));
+
+ long expected = Files.size(resourcePath);
+ byte[] buffer = new byte[48 * 1024];
+ List> totals = new ArrayList<>();
+ for (Socket socket : sockets)
+ {
+ final Exchanger x = new Exchanger<>();
+ totals.add(x);
+ final InputStream input = socket.getInputStream();
+
+ new Thread()
+ {
+ @Override
+ public void run()
+ {
+ long total=0;
+ try
+ {
+ // look for CRLFCRLF
+ StringBuilder header = new StringBuilder();
+ int state=0;
+ while (state<4 && header.length()<2048)
+ {
+ int ch=input.read();
+ if (ch<0)
+ break;
+ header.append((char)ch);
+ switch(state)
+ {
+ case 0:
+ if (ch=='\r')
+ state=1;
+ break;
+ case 1:
+ if (ch=='\n')
+ state=2;
+ else
+ state=0;
+ break;
+ case 2:
+ if (ch=='\r')
+ state=3;
+ else
+ state=0;
+ break;
+ case 3:
+ if (ch=='\n')
+ state=4;
+ else
+ state=0;
+ break;
+ }
+ }
+
+ while (total x : totals)
+ {
+ Long total = x.exchange(-1L,10000,TimeUnit.SECONDS);
+ Assert.assertEquals(expected,total.longValue());
+ }
+
+ // We could read everything, good.
+ for (Socket socket : sockets)
+ socket.close();
+ }
+
+ @Test
+ public void testFailureStarvation() throws Exception
+ {
+ try (StacklessLogging stackless = new StacklessLogging(HttpChannel.class))
+ {
+ int acceptors = 0;
+ int selectors = 1;
+ int maxThreads = 10;
+ final int barried=maxThreads-acceptors-selectors*2;
+ final CyclicBarrier barrier = new CyclicBarrier(barried);
+
+
+ QueuedThreadPool threadPool = new QueuedThreadPool(maxThreads, maxThreads);
+ threadPool.setDetailedDump(true);
+ _server = new Server(threadPool);
+
+
+ ServerConnector connector = new ServerConnector(_server, acceptors, selectors)
+ {
+ @Override
+ protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException
+ {
+ return new SocketChannelEndPoint(channel, selectSet, key, getScheduler())
+ {
+ @Override
+ public boolean flush(ByteBuffer... buffers) throws IOException
+ {
+ super.flush(buffers[0]);
+ throw new IOException("TEST FAILURE");
+ }
+ };
+ }
+ };
+ connector.setIdleTimeout(Long.MAX_VALUE);
+ _server.addConnector(connector);
+
+ final AtomicInteger count = new AtomicInteger(0);
+ _server.setHandler(new AbstractHandler()
+ {
+ @Override
+ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
+ {
+ int c=count.getAndIncrement();
+ try
+ {
+ if (c sockets = new ArrayList<>();
+ for (int i = 0; i < maxThreads*2; ++i)
+ {
+ Socket socket = new Socket("localhost", connector.getLocalPort());
+ sockets.add(socket);
+ OutputStream output = socket.getOutputStream();
+ String request = "" +
+ "GET / HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ // "Connection: close\r\n" +
+ "\r\n";
+ output.write(request.getBytes(StandardCharsets.UTF_8));
+ output.flush();
+ }
+
+ byte[] buffer = new byte[48 * 1024];
+ List> totals = new ArrayList<>();
+ for (Socket socket : sockets)
+ {
+ final Exchanger x = new Exchanger<>();
+ totals.add(x);
+ final InputStream input = socket.getInputStream();
+
+ new Thread()
+ {
+ @Override
+ public void run()
+ {
+ int read=0;
+ try
+ {
+ // look for CRLFCRLF
+ StringBuilder header = new StringBuilder();
+ int state=0;
+ while (state<4 && header.length()<2048)
+ {
+ int ch=input.read();
+ if (ch<0)
+ break;
+ header.append((char)ch);
+ switch(state)
+ {
+ case 0:
+ if (ch=='\r')
+ state=1;
+ break;
+ case 1:
+ if (ch=='\n')
+ state=2;
+ else
+ state=0;
+ break;
+ case 2:
+ if (ch=='\r')
+ state=3;
+ else
+ state=0;
+ break;
+ case 3:
+ if (ch=='\n')
+ state=4;
+ else
+ state=0;
+ break;
+ }
+ }
+
+ read=input.read(buffer);
+ }
+ catch (IOException e)
+ {
+ // e.printStackTrace();
+ }
+ finally
+ {
+ try
+ {
+ x.exchange(read);
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }.start();
+ }
+
+ for (Exchanger x : totals)
+ {
+ Integer read = x.exchange(-1,10,TimeUnit.SECONDS);
+ Assert.assertEquals(-1,read.intValue());
+ }
+
+ // We could read everything, good.
+ for (Socket socket : sockets)
+ socket.close();
+
+ _server.stop();
+ }
+ }
+}
diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml
index e01b95eba34..274d6e67152 100644
--- a/jetty-spring/pom.xml
+++ b/jetty-spring/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-spring
@@ -11,28 +11,12 @@
3.2.8.RELEASE
target/dependencies
+ ${project.groupId}.spring
install
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- package
-
- single
-
-
-
- config
-
-
-
-
-
org.jacoco
jacoco-maven-plugin
diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml
index 5c0b6f5cb89..3500bbbe750 100644
--- a/jetty-start/pom.xml
+++ b/jetty-start/pom.xml
@@ -2,13 +2,17 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-start
Jetty :: Start
The start utility
http://www.eclipse.org/jetty
+
+ ${project.groupId}.start
+ start.jar
+
@@ -30,9 +34,6 @@
-
- start.jar
-
org.eclipse.jetty.toolchain
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java
index cd110dc6b20..e955a57691b 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/BaseHomeTest.java
@@ -1,214 +1,214 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.start;
-
-import static org.hamcrest.Matchers.containsInAnyOrder;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.hamcrest.Matchers.startsWith;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jetty.start.config.ConfigSources;
-import org.eclipse.jetty.start.config.JettyBaseConfigSource;
-import org.eclipse.jetty.start.config.JettyHomeConfigSource;
-import org.eclipse.jetty.toolchain.test.IO;
-import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class BaseHomeTest
-{
- public static void assertPathList(BaseHome hb, String message, List expected, PathFinder finder)
- {
- List actual = new ArrayList<>();
- for (Path path : finder.getHits())
- {
- actual.add(hb.toShortForm(path.toFile()));
- }
-
- if (actual.size() != expected.size())
- {
- System.out.printf("Actual Path(s): %,d hits%n",actual.size());
- for (String path : actual)
- {
- System.out.printf(" %s%n",path);
- }
- System.out.printf("Expected Path(s): %,d entries%n",expected.size());
- for (String path : expected)
- {
- System.out.printf(" %s%n",path);
- }
- }
- Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
- }
-
- public static void assertPathList(BaseHome hb, String message, List expected, List paths)
- {
- List actual = new ArrayList<>();
- for (Path path : paths)
- {
- actual.add(hb.toShortForm(path.toFile()));
- }
-
- if (actual.size() != expected.size())
- {
- System.out.printf("Actual Path(s): %,d hits%n",actual.size());
- for (String path : actual)
- {
- System.out.printf(" %s%n",path);
- }
- System.out.printf("Expected Path(s): %,d entries%n",expected.size());
- for (String path : expected)
- {
- System.out.printf(" %s%n",path);
- }
- }
- Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
- }
-
- public static void assertFileList(BaseHome hb, String message, List expected, List files)
- {
- List actual = new ArrayList<>();
- for (File file : files)
- {
- actual.add(hb.toShortForm(file));
- }
- Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
- }
-
- @Test
- public void testGetPath_OnlyHome() throws IOException
- {
- File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
-
- ConfigSources config = new ConfigSources();
- config.add(new JettyHomeConfigSource(homeDir.toPath()));
-
- BaseHome hb = new BaseHome(config);
- Path startIni = hb.getPath("start.ini");
-
- String ref = hb.toShortForm(startIni);
- Assert.assertThat("Reference",ref,startsWith("${jetty.home}"));
-
- String contents = IO.readToString(startIni.toFile());
- Assert.assertThat("Contents",contents,containsString("Home Ini"));
- }
-
- @Test
- public void testGetPaths_OnlyHome() throws IOException
- {
- File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
-
- ConfigSources config = new ConfigSources();
- config.add(new JettyHomeConfigSource(homeDir.toPath()));
-
- BaseHome hb = new BaseHome(config);
- List paths = hb.getPaths("start.d/*");
-
- List expected = new ArrayList<>();
- expected.add("${jetty.home}/start.d/jmx.ini");
- expected.add("${jetty.home}/start.d/jndi.ini");
- expected.add("${jetty.home}/start.d/jsp.ini");
- expected.add("${jetty.home}/start.d/logging.ini");
- expected.add("${jetty.home}/start.d/ssl.ini");
- FSTest.toOsSeparators(expected);
-
- assertPathList(hb,"Paths found",expected,paths);
- }
-
- @Test
- public void testGetPaths_OnlyHome_InisOnly() throws IOException
- {
- File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
-
- ConfigSources config = new ConfigSources();
- config.add(new JettyHomeConfigSource(homeDir.toPath()));
-
- BaseHome hb = new BaseHome(config);
- List paths = hb.getPaths("start.d/*.ini");
-
- List expected = new ArrayList<>();
- expected.add("${jetty.home}/start.d/jmx.ini");
- expected.add("${jetty.home}/start.d/jndi.ini");
- expected.add("${jetty.home}/start.d/jsp.ini");
- expected.add("${jetty.home}/start.d/logging.ini");
- expected.add("${jetty.home}/start.d/ssl.ini");
- FSTest.toOsSeparators(expected);
-
- assertPathList(hb,"Paths found",expected,paths);
- }
-
- @Test
- public void testGetPaths_Both() throws IOException
- {
- File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
- File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
-
- ConfigSources config = new ConfigSources();
- config.add(new JettyBaseConfigSource(baseDir.toPath()));
- config.add(new JettyHomeConfigSource(homeDir.toPath()));
-
- BaseHome hb = new BaseHome(config);
- List paths = hb.getPaths("start.d/*.ini");
-
- List expected = new ArrayList<>();
- expected.add("${jetty.base}/start.d/jmx.ini");
- expected.add("${jetty.home}/start.d/jndi.ini");
- expected.add("${jetty.home}/start.d/jsp.ini");
- expected.add("${jetty.base}/start.d/logging.ini");
- expected.add("${jetty.home}/start.d/ssl.ini");
- expected.add("${jetty.base}/start.d/myapp.ini");
- FSTest.toOsSeparators(expected);
-
- assertPathList(hb,"Paths found",expected,paths);
- }
-
- @Test
- public void testDefault() throws IOException
- {
- BaseHome bh = new BaseHome();
- Assert.assertThat("Home",bh.getHome(),notNullValue());
- Assert.assertThat("Base",bh.getBase(),notNullValue());
- }
-
- @Test
- public void testGetPath_Both() throws IOException
- {
- File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
- File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
-
- ConfigSources config = new ConfigSources();
- config.add(new JettyBaseConfigSource(baseDir.toPath()));
- config.add(new JettyHomeConfigSource(homeDir.toPath()));
-
- BaseHome hb = new BaseHome(config);
- Path startIni = hb.getPath("start.ini");
-
- String ref = hb.toShortForm(startIni);
- Assert.assertThat("Reference",ref,startsWith("${jetty.base}"));
-
- String contents = IO.readToString(startIni.toFile());
- Assert.assertThat("Contents",contents,containsString("Base Ini"));
- }
-}
+//
+// ========================================================================
+// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.start;
+
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.startsWith;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jetty.start.config.ConfigSources;
+import org.eclipse.jetty.start.config.JettyBaseConfigSource;
+import org.eclipse.jetty.start.config.JettyHomeConfigSource;
+import org.eclipse.jetty.toolchain.test.IO;
+import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class BaseHomeTest
+{
+ public static void assertPathList(BaseHome hb, String message, List expected, PathFinder finder)
+ {
+ List actual = new ArrayList<>();
+ for (Path path : finder.getHits())
+ {
+ actual.add(hb.toShortForm(path.toFile()));
+ }
+
+ if (actual.size() != expected.size())
+ {
+ System.out.printf("Actual Path(s): %,d hits%n",actual.size());
+ for (String path : actual)
+ {
+ System.out.printf(" %s%n",path);
+ }
+ System.out.printf("Expected Path(s): %,d entries%n",expected.size());
+ for (String path : expected)
+ {
+ System.out.printf(" %s%n",path);
+ }
+ }
+ Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
+ }
+
+ public static void assertPathList(BaseHome hb, String message, List expected, List paths)
+ {
+ List actual = new ArrayList<>();
+ for (Path path : paths)
+ {
+ actual.add(hb.toShortForm(path.toFile()));
+ }
+
+ if (actual.size() != expected.size())
+ {
+ System.out.printf("Actual Path(s): %,d hits%n",actual.size());
+ for (String path : actual)
+ {
+ System.out.printf(" %s%n",path);
+ }
+ System.out.printf("Expected Path(s): %,d entries%n",expected.size());
+ for (String path : expected)
+ {
+ System.out.printf(" %s%n",path);
+ }
+ }
+ Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
+ }
+
+ public static void assertFileList(BaseHome hb, String message, List expected, List files)
+ {
+ List actual = new ArrayList<>();
+ for (File file : files)
+ {
+ actual.add(hb.toShortForm(file));
+ }
+ Assert.assertThat(message + ": " + Utils.join(actual,", "),actual,containsInAnyOrder(expected.toArray()));
+ }
+
+ @Test
+ public void testGetPath_OnlyHome() throws IOException
+ {
+ File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
+
+ ConfigSources config = new ConfigSources();
+ config.add(new JettyHomeConfigSource(homeDir.toPath()));
+
+ BaseHome hb = new BaseHome(config);
+ Path startIni = hb.getPath("start.ini");
+
+ String ref = hb.toShortForm(startIni);
+ Assert.assertThat("Reference",ref,startsWith("${jetty.home}"));
+
+ String contents = IO.readToString(startIni.toFile());
+ Assert.assertThat("Contents",contents,containsString("Home Ini"));
+ }
+
+ @Test
+ public void testGetPaths_OnlyHome() throws IOException
+ {
+ File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
+
+ ConfigSources config = new ConfigSources();
+ config.add(new JettyHomeConfigSource(homeDir.toPath()));
+
+ BaseHome hb = new BaseHome(config);
+ List paths = hb.getPaths("start.d/*");
+
+ List expected = new ArrayList<>();
+ expected.add("${jetty.home}/start.d/jmx.ini");
+ expected.add("${jetty.home}/start.d/jndi.ini");
+ expected.add("${jetty.home}/start.d/jsp.ini");
+ expected.add("${jetty.home}/start.d/logging.ini");
+ expected.add("${jetty.home}/start.d/ssl.ini");
+ FSTest.toOsSeparators(expected);
+
+ assertPathList(hb,"Paths found",expected,paths);
+ }
+
+ @Test
+ public void testGetPaths_OnlyHome_InisOnly() throws IOException
+ {
+ File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
+
+ ConfigSources config = new ConfigSources();
+ config.add(new JettyHomeConfigSource(homeDir.toPath()));
+
+ BaseHome hb = new BaseHome(config);
+ List paths = hb.getPaths("start.d/*.ini");
+
+ List expected = new ArrayList<>();
+ expected.add("${jetty.home}/start.d/jmx.ini");
+ expected.add("${jetty.home}/start.d/jndi.ini");
+ expected.add("${jetty.home}/start.d/jsp.ini");
+ expected.add("${jetty.home}/start.d/logging.ini");
+ expected.add("${jetty.home}/start.d/ssl.ini");
+ FSTest.toOsSeparators(expected);
+
+ assertPathList(hb,"Paths found",expected,paths);
+ }
+
+ @Test
+ public void testGetPaths_Both() throws IOException
+ {
+ File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
+ File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
+
+ ConfigSources config = new ConfigSources();
+ config.add(new JettyBaseConfigSource(baseDir.toPath()));
+ config.add(new JettyHomeConfigSource(homeDir.toPath()));
+
+ BaseHome hb = new BaseHome(config);
+ List paths = hb.getPaths("start.d/*.ini");
+
+ List expected = new ArrayList<>();
+ expected.add("${jetty.base}/start.d/jmx.ini");
+ expected.add("${jetty.home}/start.d/jndi.ini");
+ expected.add("${jetty.home}/start.d/jsp.ini");
+ expected.add("${jetty.base}/start.d/logging.ini");
+ expected.add("${jetty.home}/start.d/ssl.ini");
+ expected.add("${jetty.base}/start.d/myapp.ini");
+ FSTest.toOsSeparators(expected);
+
+ assertPathList(hb,"Paths found",expected,paths);
+ }
+
+ @Test
+ public void testDefault() throws IOException
+ {
+ BaseHome bh = new BaseHome();
+ Assert.assertThat("Home",bh.getHome(),notNullValue());
+ Assert.assertThat("Base",bh.getBase(),notNullValue());
+ }
+
+ @Test
+ public void testGetPath_Both() throws IOException
+ {
+ File homeDir = MavenTestingUtils.getTestResourceDir("hb.1/home");
+ File baseDir = MavenTestingUtils.getTestResourceDir("hb.1/base");
+
+ ConfigSources config = new ConfigSources();
+ config.add(new JettyBaseConfigSource(baseDir.toPath()));
+ config.add(new JettyHomeConfigSource(homeDir.toPath()));
+
+ BaseHome hb = new BaseHome(config);
+ Path startIni = hb.getPath("start.ini");
+
+ String ref = hb.toShortForm(startIni);
+ Assert.assertThat("Reference",ref,startsWith("${jetty.base}"));
+
+ String contents = IO.readToString(startIni.toFile());
+ Assert.assertThat("Contents",contents,containsString("Base Ini"));
+ }
+}
diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java b/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java
index 70b4da00e95..8a1cd189e57 100644
--- a/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java
+++ b/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java
@@ -1,271 +1,272 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.start;
-
-import static org.hamcrest.Matchers.greaterThan;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import org.eclipse.jetty.start.Props.Prop;
-import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
-import org.eclipse.jetty.toolchain.test.PathAssert;
-import org.hamcrest.Matchers;
-import org.junit.Assert;
-
-public class ConfigurationAssert
-{
- /**
- * Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
- *
- * @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
- * @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
- * @param filename the filename of the assertion values
- * @throws FileNotFoundException if unable to find the configuration
- * @throws IOException if unable to process the configuration
- */
- public static void assertConfiguration(BaseHome baseHome, StartArgs args, String filename) throws FileNotFoundException, IOException
- {
- assertConfiguration(baseHome, args, null, MavenTestingUtils.getTestResourceFile(filename));
- }
-
- /**
- * Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
- *
- * @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
- * @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
- * @param output the captured output that you want to assert against
- * @param filename the filename of the assertion values
- * @throws FileNotFoundException if unable to find the configuration
- * @throws IOException if unable to process the configuration
- */
- public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, String filename) throws FileNotFoundException, IOException
- {
- assertConfiguration(baseHome, args, output, MavenTestingUtils.getTestResourceFile(filename));
- }
-
- /**
- * Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
- *
- * @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
- * @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
- * @param file the file of the assertion values
- * @throws FileNotFoundException if unable to find the configuration
- * @throws IOException if unable to process the configuration
- */
- public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, File file) throws FileNotFoundException, IOException
- {
- if(output != null)
- {
- System.err.println(output);
- }
- Path testResourcesDir = MavenTestingUtils.getTestResourcesDir().toPath().toRealPath();
- TextFile textFile = new TextFile(file.toPath());
-
- // Validate XMLs (order is important)
- List expectedXmls = new ArrayList<>();
- for (String line : textFile)
- {
- if (line.startsWith("XML|"))
- {
- expectedXmls.add(FS.separators(getValue(line)));
- }
- }
- List actualXmls = new ArrayList<>();
- for (Path xml : args.getXmlFiles())
- {
- actualXmls.add(shorten(baseHome, xml, testResourcesDir));
- }
- assertOrdered("XML Resolution Order", expectedXmls, actualXmls);
-
- // Validate LIBs (order is not important)
- List expectedLibs = new ArrayList<>();
- for (String line : textFile)
- {
- if (line.startsWith("LIB|"))
- {
- expectedLibs.add(FS.separators(getValue(line)));
- }
- }
- List actualLibs = new ArrayList<>();
- for (File path : args.getClasspath())
- {
- actualLibs.add(shorten(baseHome, path.toPath(), testResourcesDir));
- }
- assertContainsUnordered("Libs", expectedLibs, actualLibs);
-
- // Validate PROPERTIES (order is not important)
- Set expectedProperties = new HashSet<>();
- for (String line : textFile)
- {
- if (line.startsWith("PROP|") || line.startsWith("SYS|"))
- {
- expectedProperties.add(getValue(line));
- }
- }
- List actualProperties = new ArrayList<>();
- for (Prop prop : args.getProperties())
- {
- String name = prop.key;
- if ("jetty.home".equals(name) ||
- "jetty.base".equals(name) ||
- "jetty.home.uri".equals(name) ||
- "jetty.base.uri".equals(name) ||
- "user.dir".equals(name) ||
- prop.origin.equals(Props.ORIGIN_SYSPROP) ||
- name.startsWith("java."))
- {
- // strip these out from assertion, to make assertions easier.
- continue;
- }
- actualProperties.add(prop.key + "=" + args.getProperties().expand(prop.value));
- }
- assertContainsUnordered("Properties", expectedProperties, actualProperties);
-
- // Validate PROPERTIES (order is not important)
- for (String line : textFile)
- {
- if (line.startsWith("SYS|"))
- {
- String[] expected = getValue(line).split("=",2);
- String actual = System.getProperty(expected[0]);
- assertThat("System property "+expected[0],actual,Matchers.equalTo(expected[1]));
- }
- }
-
- // Validate Downloads
- List expectedDownloads = new ArrayList<>();
- for (String line : textFile)
- {
- if (line.startsWith("DOWNLOAD|"))
- {
- expectedDownloads.add(getValue(line));
- }
- }
- List actualDownloads = new ArrayList<>();
- for (FileArg darg : args.getFiles())
- {
- if (darg.uri != null)
- {
- actualDownloads.add(String.format("%s|%s", darg.uri, darg.location));
- }
- }
- assertContainsUnordered("Downloads", expectedDownloads, actualDownloads);
-
- // File / Path Existence Checks
- streamOf(textFile, "EXISTS").forEach(f ->
- {
- Path path = baseHome.getPath(f);
- if (f.endsWith("/"))
- {
- PathAssert.assertDirExists("Required Directory", path);
- }
- else
- {
- PathAssert.assertFileExists("Required File", path);
- }
- });
-
- // Output Validation
- streamOf(textFile, "OUTPUT").forEach(regex ->
- {
- Pattern pat = Pattern.compile(regex);
- Matcher mat = pat.matcher(output);
- assertTrue("Output [\n" + output + "]\nContains Regex Match: " + pat.pattern(), mat.find());
- });
- }
-
- private static String shorten(BaseHome baseHome, Path path, Path testResourcesDir)
- {
- String value = baseHome.toShortForm(path);
- if (value.startsWith("${"))
- {
- return value;
- }
-
- if (path.startsWith(testResourcesDir))
- {
- int len = testResourcesDir.toString().length();
- value = "${maven-test-resources}" + value.substring(len);
- }
- return value;
- }
-
- public static void assertContainsUnordered(String msg, Collection expectedSet, Collection actualSet)
- {
- try
- {
- Assert.assertEquals(msg, expectedSet.size(), actualSet.size());
- if (!expectedSet.isEmpty())
- assertThat(msg, actualSet, Matchers.containsInAnyOrder(expectedSet.toArray()));
- }
- catch (AssertionError e)
- {
- System.err.println("Expected: " + expectedSet.stream().sorted().collect(Collectors.toList()));
- System.err.println("Actual : " + actualSet.stream().sorted().collect(Collectors.toList()));
- throw e;
- }
-
- }
-
- public static void assertOrdered(String msg, List expectedList, List actualList)
- {
- try
- {
- Assert.assertEquals(msg, expectedList.size(), actualList.size());
- if (!expectedList.isEmpty())
- assertThat(msg, actualList, Matchers.contains(expectedList.toArray()));
- }
- catch (AssertionError e)
- {
- System.err.println("Expected: " + expectedList);
- System.err.println("Actual : " + actualList);
- throw e;
- }
- }
-
- private static Stream streamOf(TextFile textFile, String key)
- {
- return textFile.stream()
- .filter(s -> s.startsWith(key + "|")).map(f -> getValue(f));
- }
-
- private static String getValue(String arg)
- {
- int idx = arg.indexOf('|');
- assertThat("Expecting '|' sign in [" + arg + "]", idx, greaterThanOrEqualTo(0));
- String value = arg.substring(idx + 1).trim();
- assertThat("Expecting Value after '|' in [" + arg + "]", value.length(), greaterThan(0));
- return value;
- }
-}
+//
+// ========================================================================
+// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.start;
+
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.greaterThanOrEqualTo;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.eclipse.jetty.start.Props.Prop;
+import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.eclipse.jetty.toolchain.test.PathAssert;
+import org.hamcrest.Matchers;
+import org.junit.Assert;
+
+public class ConfigurationAssert
+{
+ /**
+ * Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
+ *
+ * @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
+ * @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
+ * @param filename the filename of the assertion values
+ * @throws FileNotFoundException if unable to find the configuration
+ * @throws IOException if unable to process the configuration
+ */
+ public static void assertConfiguration(BaseHome baseHome, StartArgs args, String filename) throws FileNotFoundException, IOException
+ {
+ assertConfiguration(baseHome, args, null, MavenTestingUtils.getTestResourceFile(filename));
+ }
+
+ /**
+ * Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
+ *
+ * @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
+ * @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
+ * @param output the captured output that you want to assert against
+ * @param filename the filename of the assertion values
+ * @throws FileNotFoundException if unable to find the configuration
+ * @throws IOException if unable to process the configuration
+ */
+ public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, String filename) throws FileNotFoundException, IOException
+ {
+ assertConfiguration(baseHome, args, output, MavenTestingUtils.getTestResourceFile(filename));
+ }
+
+ /**
+ * Given a provided StartArgs, assert that the configuration it has determined is valid based on values in a assert text file.
+ *
+ * @param baseHome the BaseHome used. Access it via {@link Main#getBaseHome()}
+ * @param args the StartArgs that has been processed via {@link Main#processCommandLine(String[])}
+ * @param file the file of the assertion values
+ * @throws FileNotFoundException if unable to find the configuration
+ * @throws IOException if unable to process the configuration
+ */
+ public static void assertConfiguration(BaseHome baseHome, StartArgs args, String output, File file) throws FileNotFoundException, IOException
+ {
+ if(output != null)
+ {
+ System.err.println(output);
+ }
+ Path testResourcesDir = MavenTestingUtils.getTestResourcesDir().toPath().toRealPath();
+ TextFile textFile = new TextFile(file.toPath());
+
+ // Validate XMLs (order is important)
+ List expectedXmls = new ArrayList<>();
+ for (String line : textFile)
+ {
+ if (line.startsWith("XML|"))
+ {
+ expectedXmls.add(FS.separators(getValue(line)));
+ }
+ }
+ List actualXmls = new ArrayList<>();
+ for (Path xml : args.getXmlFiles())
+ {
+ actualXmls.add(shorten(baseHome, xml, testResourcesDir));
+ }
+ assertOrdered("XML Resolution Order", expectedXmls, actualXmls);
+
+ // Validate LIBs (order is not important)
+ List expectedLibs = new ArrayList<>();
+ for (String line : textFile)
+ {
+ if (line.startsWith("LIB|"))
+ {
+ expectedLibs.add(FS.separators(getValue(line)));
+ }
+ }
+ List actualLibs = new ArrayList<>();
+ for (File path : args.getClasspath())
+ {
+ actualLibs.add(shorten(baseHome, path.toPath(), testResourcesDir));
+ }
+ assertContainsUnordered("Libs", expectedLibs, actualLibs);
+
+ // Validate PROPERTIES (order is not important)
+ Set expectedProperties = new HashSet<>();
+ for (String line : textFile)
+ {
+ if (line.startsWith("PROP|") || line.startsWith("SYS|"))
+ {
+ expectedProperties.add(getValue(line));
+ }
+ }
+ List actualProperties = new ArrayList<>();
+ for (Prop prop : args.getProperties())
+ {
+ String name = prop.key;
+ if ("jetty.home".equals(name) ||
+ "jetty.base".equals(name) ||
+ "jetty.home.uri".equals(name) ||
+ "jetty.base.uri".equals(name) ||
+ "user.dir".equals(name) ||
+ prop.origin.equals(Props.ORIGIN_SYSPROP) ||
+ name.startsWith("java."))
+ {
+ // strip these out from assertion, to make assertions easier.
+ continue;
+ }
+ actualProperties.add(prop.key + "=" + args.getProperties().expand(prop.value));
+ }
+ assertContainsUnordered("Properties", expectedProperties, actualProperties);
+
+ // Validate PROPERTIES (order is not important)
+ for (String line : textFile)
+ {
+ if (line.startsWith("SYS|"))
+ {
+ String[] expected = getValue(line).split("=",2);
+ String actual = System.getProperty(expected[0]);
+ assertThat("System property "+expected[0],actual,Matchers.equalTo(expected[1]));
+ }
+ }
+
+ // Validate Downloads
+ List expectedDownloads = new ArrayList<>();
+ for (String line : textFile)
+ {
+ if (line.startsWith("DOWNLOAD|"))
+ {
+ expectedDownloads.add(getValue(line));
+ }
+ }
+ List actualDownloads = new ArrayList<>();
+ for (FileArg darg : args.getFiles())
+ {
+ if (darg.uri != null)
+ {
+ actualDownloads.add(String.format("%s|%s", darg.uri, darg.location));
+ }
+ }
+ assertContainsUnordered("Downloads", expectedDownloads, actualDownloads);
+
+ // File / Path Existence Checks
+ streamOf(textFile, "EXISTS").forEach(f ->
+ {
+ Path path = baseHome.getPath(f);
+ if (f.endsWith("/"))
+ {
+ PathAssert.assertDirExists("Required Directory", path);
+ }
+ else
+ {
+ PathAssert.assertFileExists("Required File", path);
+ }
+ });
+
+ // Output Validation
+ streamOf(textFile, "OUTPUT").forEach(regex ->
+ {
+ Pattern pat = Pattern.compile(regex);
+ Matcher mat = pat.matcher(output);
+ assertTrue("Output [\n" + output + "]\nContains Regex Match: " + pat.pattern(), mat.find());
+ });
+ }
+
+ private static String shorten(BaseHome baseHome, Path path, Path testResourcesDir)
+ {
+ String value = baseHome.toShortForm(path);
+ if (value.startsWith("${"))
+ {
+ return value;
+ }
+
+ if (path.startsWith(testResourcesDir))
+ {
+ int len = testResourcesDir.toString().length();
+ value = "${maven-test-resources}" + value.substring(len);
+ }
+ return value;
+ }
+
+ public static void assertContainsUnordered(String msg, Collection expectedSet, Collection actualSet)
+ {
+ try
+ {
+ Assert.assertEquals(msg, expectedSet.size(), actualSet.size());
+ if (!expectedSet.isEmpty())
+ assertThat(msg, actualSet, Matchers.containsInAnyOrder(expectedSet.toArray()));
+ }
+ catch (AssertionError e)
+ {
+ System.err.println("Expected: " + expectedSet.stream().sorted().collect(Collectors.toList()));
+ System.err.println("Actual : " + actualSet.stream().sorted().collect(Collectors.toList()));
+ throw e;
+ }
+
+ }
+
+ @SuppressWarnings("Duplicates")
+ public static void assertOrdered(String msg, List expectedList, List actualList)
+ {
+ try
+ {
+ Assert.assertEquals(msg, expectedList.size(), actualList.size());
+ if (!expectedList.isEmpty())
+ assertThat(msg, actualList, Matchers.contains(expectedList.toArray()));
+ }
+ catch (AssertionError e)
+ {
+ System.err.println("Expected: " + expectedList);
+ System.err.println("Actual : " + actualList);
+ throw e;
+ }
+ }
+
+ private static Stream streamOf(TextFile textFile, String key)
+ {
+ return textFile.stream()
+ .filter(s -> s.startsWith(key + "|")).map(f -> getValue(f));
+ }
+
+ private static String getValue(String arg)
+ {
+ int idx = arg.indexOf('|');
+ assertThat("Expecting '|' sign in [" + arg + "]", idx, greaterThanOrEqualTo(0));
+ String value = arg.substring(idx + 1).trim();
+ assertThat("Expecting Value after '|' in [" + arg + "]", value.length(), greaterThan(0));
+ return value;
+ }
+}
diff --git a/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_131.mod b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_131.mod
index 4eb78ef5fb2..eb50f520252 100644
--- a/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_131.mod
+++ b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_131.mod
@@ -1,6 +1,3 @@
-[name]
-alpn-boot
-
[files]
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar
diff --git a/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_144.mod b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_144.mod
index 4eb78ef5fb2..eb50f520252 100644
--- a/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_144.mod
+++ b/jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_144.mod
@@ -1,6 +1,3 @@
-[name]
-alpn-boot
-
[files]
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.1.11.v20170118/alpn-boot-8.1.11.v20170118.jar|lib/alpn/alpn-boot-8.1.11.v20170118.jar
diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml
index 0f155a2773d..8b0b7c19fdd 100644
--- a/jetty-util-ajax/pom.xml
+++ b/jetty-util-ajax/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-util-ajax
@@ -14,54 +14,6 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
-
- manifest
-
-
-
- javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.5,2.0)";resolution:=optional,org.slf4j.impl;version="[1.5,2.0)";resolution:=optional,*
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
-
org.codehaus.mojo
findbugs-maven-plugin
diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml
index 174e2d33cc3..bf31ba5db57 100644
--- a/jetty-util/pom.xml
+++ b/jetty-util/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-util
@@ -14,52 +14,6 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
-
- manifest
-
-
-
- javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.6,2.0)";resolution:=optional,org.slf4j.impl;version="[1.6,2.0)";resolution:=optional,*
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- package
-
- single
-
-
-
- config
-
-
-
-
-
org.codehaus.mojo
findbugs-maven-plugin
@@ -68,6 +22,19 @@
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ ${settings.localRepository}
+
+
+
+
+
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java b/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java
index f90be361b39..98b3ef261ac 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/RolloverFileOutputStream.java
@@ -24,7 +24,9 @@ import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
-import java.util.Calendar;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import java.util.Timer;
@@ -50,13 +52,12 @@ public class RolloverFileOutputStream extends FilterOutputStream
final static String ROLLOVER_FILE_DATE_FORMAT = "yyyy_MM_dd";
final static String ROLLOVER_FILE_BACKUP_FORMAT = "HHmmssSSS";
final static int ROLLOVER_FILE_RETAIN_DAYS = 31;
-
+
private RollTask _rollTask;
private SimpleDateFormat _fileBackupFormat;
private SimpleDateFormat _fileDateFormat;
-
- private final TimeZone _timeZone;
- private final String _filename;
+
+ private String _filename;
private File _file;
private boolean _append;
private int _retainDays;
@@ -117,7 +118,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
TimeZone zone)
throws IOException
{
- this(filename,append,retainDays,zone,null,null);
+ this(filename,append,retainDays,zone,null,null,ZonedDateTime.now(zone.toZoneId()));
}
/* ------------------------------------------------------------ */
@@ -139,21 +140,20 @@ public class RolloverFileOutputStream extends FilterOutputStream
String backupFormat)
throws IOException
{
- this(filename,append,retainDays,zone,dateFormat,backupFormat,Calendar.getInstance(zone));
+ this(filename,append,retainDays,zone,dateFormat,backupFormat,ZonedDateTime.now(zone.toZoneId()));
}
+
RolloverFileOutputStream(String filename,
boolean append,
int retainDays,
TimeZone zone,
String dateFormat,
String backupFormat,
- Calendar now)
+ ZonedDateTime now)
throws IOException
{
super(null);
-
- _timeZone = zone;
if (dateFormat==null)
dateFormat=ROLLOVER_FILE_DATE_FORMAT;
@@ -174,9 +174,8 @@ public class RolloverFileOutputStream extends FilterOutputStream
}
if (filename==null)
throw new IllegalArgumentException("Invalid filename");
-
- File testfile = new File(filename);
- _filename=testfile.getCanonicalPath();
+
+ _filename=filename;
_append=append;
_retainDays=retainDays;
@@ -186,7 +185,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
__rollover=new Timer(RolloverFileOutputStream.class.getName(),true);
// Calculate Today's Midnight, based on Configured TimeZone (will be in past, even if by a few milliseconds)
- setFile(now);
+ setFile(now);
// This will schedule the rollover event to the next midnight
scheduleNextRollover(now);
}
@@ -196,32 +195,23 @@ public class RolloverFileOutputStream extends FilterOutputStream
/**
* Get the "start of day" for the provided DateTime at the zone specified.
*
- * @param cal the date time to calculate from
+ * @param now the date time to calculate from
* @return start of the day of the date provided
*/
- public static Calendar toMidnight(Calendar cal)
+ public static ZonedDateTime toMidnight(ZonedDateTime now)
{
- Calendar ret = Calendar.getInstance();
- ret.setTimeZone(cal.getTimeZone());
- ret.setTime(cal.getTime());
- ret.set(Calendar.HOUR_OF_DAY, 0);
- ret.set(Calendar.MINUTE, 0);
- ret.set(Calendar.SECOND, 0);
- ret.set(Calendar.MILLISECOND, 0);
- // next days midnight
- ret.add(Calendar.DAY_OF_MONTH, 1);
- return ret;
+ return now.toLocalDate().atStartOfDay(now.getZone()).plus(1, ChronoUnit.DAYS);
}
/* ------------------------------------------------------------ */
- private void scheduleNextRollover(Calendar now)
+ private void scheduleNextRollover(ZonedDateTime now)
{
_rollTask = new RollTask();
- // Establish next day's midnight of provided calendar
- Calendar midnight = toMidnight(now);
+ // Get tomorrow's midnight based on Configured TimeZone
+ ZonedDateTime midnight = toMidnight(now);
// Schedule next rollover event to occur, based on local machine's Unix Epoch milliseconds
- long delay = midnight.getTimeInMillis() - now.getTimeInMillis();
+ long delay = midnight.toInstant().toEpochMilli() - now.toInstant().toEpochMilli();
__rollover.schedule(_rollTask,delay);
}
@@ -246,11 +236,13 @@ public class RolloverFileOutputStream extends FilterOutputStream
}
/* ------------------------------------------------------------ */
- synchronized void setFile(Calendar now)
+ synchronized void setFile(ZonedDateTime now)
throws IOException
{
// Check directory
- File file=new File(_filename);
+ File file = new File(_filename);
+ _filename=file.getCanonicalPath();
+ file=new File(_filename);
File dir= new File(file.getParent());
if (!dir.isDirectory() || !dir.canWrite())
throw new IOException("Cannot write log directory "+dir);
@@ -262,7 +254,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
{
file=new File(dir,
filename.substring(0,i)+
- _fileDateFormat.format(now.getTime()) +
+ _fileDateFormat.format(new Date(now.toInstant().toEpochMilli()))+
filename.substring(i+YYYY_MM_DD.length()));
}
@@ -275,7 +267,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
// Yep
_file=file;
if (!_append && file.exists())
- file.renameTo(new File(file.toString()+"."+_fileBackupFormat.format(now.getTime())));
+ file.renameTo(new File(file.toString()+"."+_fileBackupFormat.format(new Date(now.toInstant().toEpochMilli()))));
OutputStream oldOut=out;
out=new FileOutputStream(file.toString(),_append);
if (oldOut!=null)
@@ -285,13 +277,12 @@ public class RolloverFileOutputStream extends FilterOutputStream
}
/* ------------------------------------------------------------ */
- void removeOldFiles(Calendar now)
+ void removeOldFiles(ZonedDateTime now)
{
if (_retainDays>0)
{
// Establish expiration time, based on configured TimeZone
- now.add(Calendar.DAY_OF_MONTH, (-1)*_retainDays);
- long expired = now.getTimeInMillis();
+ long expired = now.minus(_retainDays, ChronoUnit.DAYS).toInstant().toEpochMilli();
File file= new File(_filename);
File dir = new File(file.getParent());
@@ -365,7 +356,7 @@ public class RolloverFileOutputStream extends FilterOutputStream
{
synchronized(RolloverFileOutputStream.class)
{
- Calendar now = Calendar.getInstance(_timeZone);
+ ZonedDateTime now = ZonedDateTime.now(_fileDateFormat.getTimeZone().toZoneId());
RolloverFileOutputStream.this.setFile(now);
RolloverFileOutputStream.this.scheduleNextRollover(now);
RolloverFileOutputStream.this.removeOldFiles(now);
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java b/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java
index bb7b504b9aa..d839ad50667 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/SharedBlockingCallback.java
@@ -29,7 +29,6 @@ import java.util.concurrent.locks.ReentrantLock;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
-import org.eclipse.jetty.util.thread.Invocable.InvocationType;
/**
* Provides a reusable {@link Callback} that can block the thread
@@ -168,6 +167,7 @@ public class SharedBlockingCallback
}
else
{
+ cause.printStackTrace(System.err);
throw new IllegalStateException(_state);
}
}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/RolloverFileOutputStreamTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/RolloverFileOutputStreamTest.java
index 2b6aeaa5493..56947e9e3fb 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/RolloverFileOutputStreamTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/RolloverFileOutputStreamTest.java
@@ -26,70 +26,87 @@ import java.io.FileReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.attribute.FileTime;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalAccessor;
import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.hamcrest.Matchers;
-import org.junit.Rule;
import org.junit.Test;
public class RolloverFileOutputStreamTest
{
- @Rule
- public TestingDir testingDir = new TestingDir();
-
- private static TimeZone toZoneId(String timezoneId)
+ private static ZoneId toZoneId(String timezoneId)
{
- TimeZone zone = TimeZone.getTimeZone(timezoneId);
- // System.err.printf("toZoneId('%s'): displayName=%s, id=%s%n", timezoneId, zone.getDisplayName(), zone.getID());
+ ZoneId zone = TimeZone.getTimeZone(timezoneId).toZoneId();
+ // System.out.printf(".toZoneId(\"%s\") = [id=%s,normalized=%s]%n", timezoneId, zone.getId(), zone.normalized());
return zone;
}
- private static Calendar toDateTime(String timendate, TimeZone zone) throws ParseException
+ private static ZonedDateTime toDateTime(String timendate, ZoneId zone)
{
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd-hh:mm:ss.S a z");
- formatter.setTimeZone(zone);
- Date parsed = formatter.parse(timendate);
- Calendar cal = Calendar.getInstance(zone);
- cal.setTime(parsed);
- return cal;
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd-hh:mm:ss.S a z")
+ .withZone(zone);
+ return ZonedDateTime.parse(timendate, formatter);
}
- private static String toString(Calendar date)
+ private static String toString(TemporalAccessor date)
{
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd-hh:mm:ss.S a z");
- formatter.setTimeZone(date.getTimeZone());
- return formatter.format(date.getTime());
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd-hh:mm:ss.S a z");
+ return formatter.format(date);
}
- private void assertSequence(Calendar midnight, Object[][] expected)
+ private void assertSequence(ZonedDateTime midnight, Object[][] expected)
{
- Calendar nextEvent = midnight;
+ ZonedDateTime nextEvent = midnight;
for (int i = 0; i < expected.length; i++)
{
- long lastMs = nextEvent.getTimeInMillis();
- nextEvent = RolloverFileOutputStream.toMidnight(nextEvent);
+ long currentMillis = nextEvent.toInstant().toEpochMilli();
+ nextEvent = nextEvent.toLocalDate().plus(1, ChronoUnit.DAYS).atStartOfDay(nextEvent.getZone());
assertThat("Next Event", toString(nextEvent), is(expected[i][0]));
- long duration = (nextEvent.getTimeInMillis() - lastMs);
+ long duration = (nextEvent.toInstant().toEpochMilli() - currentMillis);
assertThat("Duration to next event", duration, is((long) expected[i][1]));
}
}
+ /**
+ * https://github.com/eclipse/jetty.project/issues/1507
+ */
@Test
- public void testMidnightRolloverCalc_PST_DST_Start() throws ParseException
+ public void testMidnightRolloverCalc_PDT_Issue1507()
{
- TimeZone zone = toZoneId("PST");
- Calendar initialDate = toDateTime("2016.03.10-01:23:45.0 PM PST", zone);
+ ZoneId zone = toZoneId("PST");
+ ZonedDateTime initialDate = toDateTime("2017.04.26-08:00:00.0 PM PDT", zone);
- Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
+ ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
+ assertThat("Midnight", toString(midnight), is("2017.04.27-12:00:00.0 AM PDT"));
+
+ Object expected[][] = {
+ {"2017.04.27-12:00:00.0 AM PDT", 14_400_000L},
+ {"2017.04.28-12:00:00.0 AM PDT", 86_400_000L},
+ {"2017.04.29-12:00:00.0 AM PDT", 86_400_000L},
+ {"2017.04.30-12:00:00.0 AM PDT", 86_400_000L},
+ {"2017.05.01-12:00:00.0 AM PDT", 86_400_000L},
+ {"2017.05.02-12:00:00.0 AM PDT", 86_400_000L},
+ };
+
+ assertSequence(initialDate, expected);
+ }
+
+ @Test
+ public void testMidnightRolloverCalc_PST_DST_Start()
+ {
+ ZoneId zone = toZoneId("PST");
+ ZonedDateTime initialDate = toDateTime("2016.03.10-01:23:45.0 PM PST", zone);
+
+ ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
assertThat("Midnight", toString(midnight), is("2016.03.11-12:00:00.0 AM PST"));
Object expected[][] = {
@@ -104,12 +121,12 @@ public class RolloverFileOutputStreamTest
}
@Test
- public void testMidnightRolloverCalc_PST_DST_End() throws ParseException
+ public void testMidnightRolloverCalc_PST_DST_End()
{
- TimeZone zone = toZoneId("PST");
- Calendar initialDate = toDateTime("2016.11.03-11:22:33.0 AM PDT", zone);
+ ZoneId zone = toZoneId("PST");
+ ZonedDateTime initialDate = toDateTime("2016.11.03-11:22:33.0 AM PDT", zone);
- Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
+ ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
assertThat("Midnight", toString(midnight), is("2016.11.04-12:00:00.0 AM PDT"));
Object expected[][] = {
@@ -124,12 +141,12 @@ public class RolloverFileOutputStreamTest
}
@Test
- public void testMidnightRolloverCalc_Sydney_DST_Start() throws ParseException
+ public void testMidnightRolloverCalc_Sydney_DST_Start()
{
- TimeZone zone = toZoneId("Australia/Sydney");
- Calendar initialDate = toDateTime("2016.09.30-01:23:45.0 PM AEST", zone);
+ ZoneId zone = toZoneId("Australia/Sydney");
+ ZonedDateTime initialDate = toDateTime("2016.09.31-01:23:45.0 PM AEST", zone);
- Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
+ ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
assertThat("Midnight", toString(midnight), is("2016.10.01-12:00:00.0 AM AEST"));
Object expected[][] = {
@@ -144,12 +161,12 @@ public class RolloverFileOutputStreamTest
}
@Test
- public void testMidnightRolloverCalc_Sydney_DST_End() throws ParseException
+ public void testMidnightRolloverCalc_Sydney_DST_End()
{
- TimeZone zone = toZoneId("Australia/Sydney");
- Calendar initialDate = toDateTime("2016.04.01-11:22:33.0 AM AEDT", zone);
+ ZoneId zone = toZoneId("Australia/Sydney");
+ ZonedDateTime initialDate = toDateTime("2016.04.01-11:22:33.0 AM AEDT", zone);
- Calendar midnight = RolloverFileOutputStream.toMidnight(initialDate);
+ ZonedDateTime midnight = RolloverFileOutputStream.toMidnight(initialDate);
assertThat("Midnight", toString(midnight), is("2016.04.02-12:00:00.0 AM AEDT"));
Object expected[][] = {
@@ -169,23 +186,23 @@ public class RolloverFileOutputStreamTest
File testDir = MavenTestingUtils.getTargetTestingDir(RolloverFileOutputStreamTest.class.getName() + "_testFileHandling");
Path testPath = testDir.toPath();
FS.ensureEmpty(testDir);
-
- TimeZone zone = toZoneId("Australia/Sydney");
- Calendar now = toDateTime("2016.04.10-08:30:12.3 AM AEST", zone);
+
+ ZoneId zone = toZoneId("Australia/Sydney");
+ ZonedDateTime now = toDateTime("2016.04.10-08:30:12.3 AM AEDT", zone);
File template = new File(testDir,"test-rofos-yyyy_mm_dd.log");
try (RolloverFileOutputStream rofos =
- new RolloverFileOutputStream(template.getAbsolutePath(),false,3,zone,null,null,now))
+ new RolloverFileOutputStream(template.getAbsolutePath(),false,3,TimeZone.getTimeZone(zone),null,null,now))
{
rofos.write("TICK".getBytes());
rofos.flush();
}
- now.add(Calendar.MINUTE, 5);
+ now = now.plus(5,ChronoUnit.MINUTES);
try (RolloverFileOutputStream rofos =
- new RolloverFileOutputStream(template.getAbsolutePath(),false,3,zone,null,null,now))
+ new RolloverFileOutputStream(template.getAbsolutePath(),false,3,TimeZone.getTimeZone(zone),null,null,now))
{
rofos.write("TOCK".getBytes());
rofos.flush();
@@ -200,37 +217,32 @@ public class RolloverFileOutputStreamTest
assertThat(Arrays.asList(ls),Matchers.containsInAnyOrder(backup,"test-rofos-2016_04_10.log"));
- Files.setLastModifiedTime(testPath.resolve(backup),FileTime.fromMillis(now.getTimeInMillis()));
- Files.setLastModifiedTime(testPath.resolve("test-rofos-2016_04_10.log"),FileTime.fromMillis(now.getTimeInMillis()));
+ Files.setLastModifiedTime(testPath.resolve(backup),FileTime.from(now.toInstant()));
+ Files.setLastModifiedTime(testPath.resolve("test-rofos-2016_04_10.log"),FileTime.from(now.toInstant()));
- // Copy calendar (don't want to change "now")
- Calendar time = Calendar.getInstance();
- time.setTimeZone(now.getTimeZone());
- time.setTime(now.getTime());
- time.add(Calendar.DAY_OF_MONTH, -1);
-
+ ZonedDateTime time = now.minus(1,ChronoUnit.DAYS);
for (int i=10;i-->5;)
{
String file = "test-rofos-2016_04_0"+i+".log";
Path path = testPath.resolve(file);
FS.touch(path);
- Files.setLastModifiedTime(path,FileTime.fromMillis(time.getTimeInMillis()));
+ Files.setLastModifiedTime(path,FileTime.from(time.toInstant()));
if (i%2==0)
{
file = "test-rofos-2016_04_0"+i+".log.083512300";
path = testPath.resolve(file);
FS.touch(path);
- Files.setLastModifiedTime(path,FileTime.fromMillis(time.getTimeInMillis()));
- time.add(Calendar.DAY_OF_MONTH, -1);
+ Files.setLastModifiedTime(path,FileTime.from(time.toInstant()));
+ time = time.minus(1,ChronoUnit.DAYS);
}
file = "unrelated-"+i;
path = testPath.resolve(file);
FS.touch(path);
- Files.setLastModifiedTime(path,FileTime.fromMillis(time.getTimeInMillis()));
-
- time.add(Calendar.DAY_OF_MONTH, -1);
+ Files.setLastModifiedTime(path,FileTime.from(time.toInstant()));
+
+ time = time.minus(1,ChronoUnit.DAYS);
}
ls = testDir.list();
@@ -242,9 +254,9 @@ public class RolloverFileOutputStreamTest
"test-rofos-2016_04_08.log",
"test-rofos-2016_04_09.log",
"test-rofos-2016_04_10.log",
- "test-rofos-2016_04_06.log.083512300",
- "test-rofos-2016_04_08.log.083512300",
- "test-rofos-2016_04_10.log.083512003",
+ "test-rofos-2016_04_06.log.083512300",
+ "test-rofos-2016_04_08.log.083512300",
+ "test-rofos-2016_04_10.log.083512300",
"unrelated-9",
"unrelated-8",
"unrelated-7",
@@ -260,7 +272,7 @@ public class RolloverFileOutputStreamTest
"test-rofos-2016_04_09.log",
"test-rofos-2016_04_10.log",
"test-rofos-2016_04_08.log.083512300",
- "test-rofos-2016_04_10.log.083512003",
+ "test-rofos-2016_04_10.log.083512300",
"unrelated-9",
"unrelated-8",
"unrelated-7",
@@ -279,14 +291,14 @@ public class RolloverFileOutputStreamTest
{
File testDir = MavenTestingUtils.getTargetTestingDir(RolloverFileOutputStreamTest.class.getName() + "_testRollover");
FS.ensureEmpty(testDir);
-
- TimeZone zone = toZoneId("Australia/Sydney");
- Calendar now = toDateTime("2016.04.10-11:59:58.0 PM AEST", zone);
+
+ ZoneId zone = toZoneId("Australia/Sydney");
+ ZonedDateTime now = toDateTime("2016.04.10-11:59:55.0 PM AEDT", zone);
File template = new File(testDir,"test-rofos-yyyy_mm_dd.log");
try (RolloverFileOutputStream rofos =
- new RolloverFileOutputStream(template.getAbsolutePath(),false,0,zone,null,null,now))
+ new RolloverFileOutputStream(template.getAbsolutePath(),false,0,TimeZone.getTimeZone(zone),null,null,now))
{
rofos.write("BEFORE".getBytes());
rofos.flush();
@@ -294,7 +306,7 @@ public class RolloverFileOutputStreamTest
assertThat(ls.length,is(1));
assertThat(ls[0],is("test-rofos-2016_04_10.log"));
- TimeUnit.SECONDS.sleep(5);
+ TimeUnit.SECONDS.sleep(10);
rofos.write("AFTER".getBytes());
ls = testDir.list();
assertThat(ls.length,is(2));
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilCanonicalPathTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilCanonicalPathTest.java
index dd260b9d013..f29a394fc0c 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilCanonicalPathTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/URIUtilCanonicalPathTest.java
@@ -1,135 +1,135 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.util;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-@RunWith(Parameterized.class)
-public class URIUtilCanonicalPathTest
-{
- @Parameterized.Parameters(name = "{0}")
- public static List data()
- {
- String[][] canonical =
- {
- // Basic examples (no changes expected)
- {"/hello.html", "/hello.html"},
- {"/css/main.css", "/css/main.css"},
- {"/", "/"},
- {"", ""},
- {"/aaa/bbb/", "/aaa/bbb/"},
- {"/aaa/bbb", "/aaa/bbb"},
- {"aaa/bbb", "aaa/bbb"},
- {"aaa/", "aaa/"},
- {"aaa", "aaa"},
- {"a", "a"},
- {"a/", "a/"},
-
- // Extra slashes
- {"/aaa//bbb/", "/aaa//bbb/"},
- {"/aaa//bbb", "/aaa//bbb"},
- {"/aaa///bbb/", "/aaa///bbb/"},
-
- // Path traversal with current references "./"
- {"/aaa/./bbb/", "/aaa/bbb/"},
- {"/aaa/./bbb", "/aaa/bbb"},
- {"./bbb/", "bbb/"},
- {"./aaa/../bbb/", "bbb/"},
- {"/foo/.", "/foo/"},
- {"./", ""},
- {".", ""},
- {".//", "/"},
- {".///", "//"},
- {"/.", "/"},
- {"//.", "//"},
- {"///.", "///"},
-
- // Path traversal directory (but not past root)
- {"/aaa/../bbb/", "/bbb/"},
- {"/aaa/../bbb", "/bbb"},
- {"/aaa..bbb/", "/aaa..bbb/"},
- {"/aaa..bbb", "/aaa..bbb"},
- {"/aaa/..bbb/", "/aaa/..bbb/"},
- {"/aaa/..bbb", "/aaa/..bbb"},
- {"/aaa/./../bbb/", "/bbb/"},
- {"/aaa/./../bbb", "/bbb"},
- {"/aaa/bbb/ccc/../../ddd/", "/aaa/ddd/"},
- {"/aaa/bbb/ccc/../../ddd", "/aaa/ddd"},
- {"/foo/../bar//", "/bar//"},
- {"/ctx/../bar/../ctx/all/index.txt", "/ctx/all/index.txt"},
- {"/down/.././index.html", "/index.html"},
-
- // Path traversal up past root
- {"..", null},
- {"./..", null},
- {"aaa/../..", null},
- {"/foo/bar/../../..", null},
- {"/../foo", null},
- {"a/.", "a/"},
- {"a/..", ""},
- {"a/../..", null},
- {"/foo/../../bar", null},
-
- // Query parameter specifics
- {"/ctx/dir?/../index.html", "/ctx/index.html"},
- {"/get-files?file=/etc/passwd", "/get-files?file=/etc/passwd"},
- {"/get-files?file=../../../../../passwd", null},
-
- // Known windows shell quirks
- {"file.txt ", "file.txt "}, // with spaces
- {"file.txt...", "file.txt..."}, // extra dots ignored by windows
- // BREAKS Jenkins: {"file.txt\u0000", "file.txt\u0000"}, // null terminated is ignored by windows
- {"file.txt\r", "file.txt\r"}, // CR terminated is ignored by windows
- {"file.txt\n", "file.txt\n"}, // LF terminated is ignored by windows
- {"file.txt\"\"\"\"", "file.txt\"\"\"\""}, // extra quotes ignored by windows
- {"file.txt<<<>>><", "file.txt<<<>>><"}, // angle brackets at end of path ignored by windows
- {"././././././file.txt", "file.txt"},
-
- // Oddball requests that look like path traversal, but are not
- {"/....", "/...."},
- {"/..../ctx/..../blah/logo.jpg", "/..../ctx/..../blah/logo.jpg"},
-
- // paths with encoded segments should remain encoded
- // canonicalPath() is not responsible for decoding characters
- {"%2e%2e/", "%2e%2e/"},
- };
- return Arrays.asList(canonical);
- }
-
- @Parameterized.Parameter(0)
- public String input;
-
- @Parameterized.Parameter(1)
- public String expectedResult;
-
- @Test
- public void testCanonicalPath()
- {
- assertThat("Canonical", URIUtil.canonicalPath(input), is(expectedResult));
- }
-
-}
+//
+// ========================================================================
+// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.util;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+@RunWith(Parameterized.class)
+public class URIUtilCanonicalPathTest
+{
+ @Parameterized.Parameters(name = "{0}")
+ public static List data()
+ {
+ String[][] canonical =
+ {
+ // Basic examples (no changes expected)
+ {"/hello.html", "/hello.html"},
+ {"/css/main.css", "/css/main.css"},
+ {"/", "/"},
+ {"", ""},
+ {"/aaa/bbb/", "/aaa/bbb/"},
+ {"/aaa/bbb", "/aaa/bbb"},
+ {"aaa/bbb", "aaa/bbb"},
+ {"aaa/", "aaa/"},
+ {"aaa", "aaa"},
+ {"a", "a"},
+ {"a/", "a/"},
+
+ // Extra slashes
+ {"/aaa//bbb/", "/aaa//bbb/"},
+ {"/aaa//bbb", "/aaa//bbb"},
+ {"/aaa///bbb/", "/aaa///bbb/"},
+
+ // Path traversal with current references "./"
+ {"/aaa/./bbb/", "/aaa/bbb/"},
+ {"/aaa/./bbb", "/aaa/bbb"},
+ {"./bbb/", "bbb/"},
+ {"./aaa/../bbb/", "bbb/"},
+ {"/foo/.", "/foo/"},
+ {"./", ""},
+ {".", ""},
+ {".//", "/"},
+ {".///", "//"},
+ {"/.", "/"},
+ {"//.", "//"},
+ {"///.", "///"},
+
+ // Path traversal directory (but not past root)
+ {"/aaa/../bbb/", "/bbb/"},
+ {"/aaa/../bbb", "/bbb"},
+ {"/aaa..bbb/", "/aaa..bbb/"},
+ {"/aaa..bbb", "/aaa..bbb"},
+ {"/aaa/..bbb/", "/aaa/..bbb/"},
+ {"/aaa/..bbb", "/aaa/..bbb"},
+ {"/aaa/./../bbb/", "/bbb/"},
+ {"/aaa/./../bbb", "/bbb"},
+ {"/aaa/bbb/ccc/../../ddd/", "/aaa/ddd/"},
+ {"/aaa/bbb/ccc/../../ddd", "/aaa/ddd"},
+ {"/foo/../bar//", "/bar//"},
+ {"/ctx/../bar/../ctx/all/index.txt", "/ctx/all/index.txt"},
+ {"/down/.././index.html", "/index.html"},
+
+ // Path traversal up past root
+ {"..", null},
+ {"./..", null},
+ {"aaa/../..", null},
+ {"/foo/bar/../../..", null},
+ {"/../foo", null},
+ {"a/.", "a/"},
+ {"a/..", ""},
+ {"a/../..", null},
+ {"/foo/../../bar", null},
+
+ // Query parameter specifics
+ {"/ctx/dir?/../index.html", "/ctx/index.html"},
+ {"/get-files?file=/etc/passwd", "/get-files?file=/etc/passwd"},
+ {"/get-files?file=../../../../../passwd", null},
+
+ // Known windows shell quirks
+ {"file.txt ", "file.txt "}, // with spaces
+ {"file.txt...", "file.txt..."}, // extra dots ignored by windows
+ // BREAKS Jenkins: {"file.txt\u0000", "file.txt\u0000"}, // null terminated is ignored by windows
+ {"file.txt\r", "file.txt\r"}, // CR terminated is ignored by windows
+ {"file.txt\n", "file.txt\n"}, // LF terminated is ignored by windows
+ {"file.txt\"\"\"\"", "file.txt\"\"\"\""}, // extra quotes ignored by windows
+ {"file.txt<<<>>><", "file.txt<<<>>><"}, // angle brackets at end of path ignored by windows
+ {"././././././file.txt", "file.txt"},
+
+ // Oddball requests that look like path traversal, but are not
+ {"/....", "/...."},
+ {"/..../ctx/..../blah/logo.jpg", "/..../ctx/..../blah/logo.jpg"},
+
+ // paths with encoded segments should remain encoded
+ // canonicalPath() is not responsible for decoding characters
+ {"%2e%2e/", "%2e%2e/"},
+ };
+ return Arrays.asList(canonical);
+ }
+
+ @Parameterized.Parameter(0)
+ public String input;
+
+ @Parameterized.Parameter(1)
+ public String expectedResult;
+
+ @Test
+ public void testCanonicalPath()
+ {
+ assertThat("Canonical", URIUtil.canonicalPath(input), is(expectedResult));
+ }
+
+}
diff --git a/jetty-webapp/pom.xml b/jetty-webapp/pom.xml
index 1c3dfe2e58c..e5777924d80 100644
--- a/jetty-webapp/pom.xml
+++ b/jetty-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-webapp
@@ -27,54 +27,6 @@
-
- org.apache.maven.plugins
- maven-assembly-plugin
-
-
- package
-
- single
-
-
-
- config
-
-
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
-
- manifest
-
-
-
- javax.servlet.*;version="[2.6.0,3.2]",*
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
-
org.codehaus.mojo
findbugs-maven-plugin
@@ -82,6 +34,17 @@
org.eclipse.jetty.webapp.*
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ org.eclipse.jetty.webapp.WebAppClassLoaderUrlStreamTest
+
+ 1
+ false
+
+
diff --git a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/URLStreamHandlerUtil.java b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/URLStreamHandlerUtil.java
index aae6de59eed..2e6addb4684 100644
--- a/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/URLStreamHandlerUtil.java
+++ b/jetty-webapp/src/test/java/org/eclipse/jetty/webapp/URLStreamHandlerUtil.java
@@ -1,78 +1,78 @@
-//
-// ========================================================================
-// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
-// ------------------------------------------------------------------------
-// All rights reserved. This program and the accompanying materials
-// are made available under the terms of the Eclipse Public License v1.0
-// and Apache License v2.0 which accompanies this distribution.
-//
-// The Eclipse Public License is available at
-// http://www.eclipse.org/legal/epl-v10.html
-//
-// The Apache License v2.0 is available at
-// http://www.opensource.org/licenses/apache2.0.php
-//
-// You may elect to redistribute this code under either of these licenses.
-// ========================================================================
-//
-
-package org.eclipse.jetty.webapp;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.net.URL;
-import java.net.URLStreamHandlerFactory;
-import java.util.Arrays;
-import java.util.Optional;
-
-public final class URLStreamHandlerUtil
-{
- public static void setFactory(URLStreamHandlerFactory factory)
- {
- try
- {
- // First, reset the factory field
- Field factoryField = getURLStreamHandlerFactoryField();
- factoryField.setAccessible(true);
- factoryField.set(null, null);
-
- if(factory != null)
- {
- // Next, set the factory
- URL.setURLStreamHandlerFactory(factory);
- }
- }
- catch(Throwable ignore)
- {
- // ignore.printStackTrace(System.err);
- }
- }
-
- public static URLStreamHandlerFactory getFactory()
- {
- try
- {
- // First, reset the factory field
- Field factoryField = getURLStreamHandlerFactoryField();
- factoryField.setAccessible(true);
- return (URLStreamHandlerFactory) factoryField.get(null);
- }
- catch(Throwable ignore)
- {
- return null;
- }
- }
-
- private static Field getURLStreamHandlerFactoryField()
- {
- Optional optFactoryField = Arrays.stream(URL.class.getDeclaredFields())
- .filter((f) -> Modifier.isStatic(f.getModifiers()) &&
- f.getType().equals(URLStreamHandlerFactory.class))
- .findFirst();
-
- if(optFactoryField.isPresent())
- return optFactoryField.get();
-
- throw new RuntimeException( "Cannot find URLStreamHandlerFactory field in " + URL.class.getName() );
- }
-}
+//
+// ========================================================================
+// Copyright (c) 1995-2017 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.webapp;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.net.URL;
+import java.net.URLStreamHandlerFactory;
+import java.util.Arrays;
+import java.util.Optional;
+
+public final class URLStreamHandlerUtil
+{
+ public static void setFactory(URLStreamHandlerFactory factory)
+ {
+ try
+ {
+ // First, reset the factory field
+ Field factoryField = getURLStreamHandlerFactoryField();
+ factoryField.setAccessible(true);
+ factoryField.set(null, null);
+
+ if(factory != null)
+ {
+ // Next, set the factory
+ URL.setURLStreamHandlerFactory(factory);
+ }
+ }
+ catch(Throwable ignore)
+ {
+ // ignore.printStackTrace(System.err);
+ }
+ }
+
+ public static URLStreamHandlerFactory getFactory()
+ {
+ try
+ {
+ // First, reset the factory field
+ Field factoryField = getURLStreamHandlerFactoryField();
+ factoryField.setAccessible(true);
+ return (URLStreamHandlerFactory) factoryField.get(null);
+ }
+ catch(Throwable ignore)
+ {
+ return null;
+ }
+ }
+
+ private static Field getURLStreamHandlerFactoryField()
+ {
+ Optional optFactoryField = Arrays.stream(URL.class.getDeclaredFields())
+ .filter((f) -> Modifier.isStatic(f.getModifiers()) &&
+ f.getType().equals(URLStreamHandlerFactory.class))
+ .findFirst();
+
+ if(optFactoryField.isPresent())
+ return optFactoryField.get();
+
+ throw new RuntimeException( "Cannot find URLStreamHandlerFactory field in " + URL.class.getName() );
+ }
+}
diff --git a/jetty-xml/pom.xml b/jetty-xml/pom.xml
index 7f722aec9a8..35eaeb44849 100644
--- a/jetty-xml/pom.xml
+++ b/jetty-xml/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jetty-xml
@@ -14,30 +14,6 @@
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
-
- manifest
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
org.codehaus.mojo
findbugs-maven-plugin
diff --git a/pom.xml b/pom.xml
index 9b662be2dce..e53667acd88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
4.0.0
org.eclipse.jetty
jetty-project
- 9.3.20-SNAPSHOT
+ 9.4.7-SNAPSHOT
Jetty :: Project
The Eclipse Jetty Project
pom
@@ -861,92 +861,6 @@
-
-
-
- org.apache.maven.plugins
- maven-jxr-plugin
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
-
- 512m
- true
- true
- true
-
-
-
- org.apache.maven.plugins
- maven-pmd-plugin
-
- 1.7
-
- jetty/pmd_ruleset.xml
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
-
-
-
-
- jetty-ant
- jetty-util
- jetty-jmx
- jetty-io
- jetty-http
- jetty-http2
- jetty-continuation
- jetty-server
- jetty-xml
- jetty-security
- jetty-servlet
- jetty-webapp
- jetty-fcgi
- jetty-websocket
- jetty-servlets
- jetty-util-ajax
- apache-jsp
- apache-jstl
- jetty-maven-plugin
- jetty-jspc-maven-plugin
- jetty-deploy
- jetty-start
- jetty-plus
- jetty-annotations
- jetty-jndi
- jetty-jaas
- jetty-cdi
- jetty-spring
- jetty-client
- jetty-proxy
- jetty-jaspi
- jetty-rewrite
- jetty-nosql
- jetty-infinispan
- jetty-hazelcast
- jetty-gcloud
- tests
- examples
- jetty-quickstart
- jetty-distribution
- jetty-runner
- jetty-monitor
- jetty-http-spi
- jetty-osgi
- jetty-alpn
- jetty-bom
- jetty-documentation
-
-
-
-
-
@@ -957,7 +871,7 @@
javax.websocket
javax.websocket-api
- 1.0
+ 1.1
javax.annotation
@@ -1033,7 +947,7 @@
org.eclipse.jetty.toolchain
jetty-test-helper
- 4.0
+ 4.1
org.eclipse.jetty.toolchain
@@ -1665,6 +1579,17 @@
https://webtide.com
+
+
+ jetty-snapshots
+ jetty-snapshots
+ http://oss.sonatype.org/content/repositories/jetty-snapshots
+
+ true
+
+
+
+
oss.sonatype.org
diff --git a/tests/pom.xml b/tests/pom.xml
index ea58838cf0e..40115df2764 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -1,27 +1,10 @@
-
4.0.0
org.eclipse.jetty
jetty-project
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
../pom.xml
org.eclipse.jetty.tests
@@ -75,5 +58,6 @@
test-integration
test-quickstart
test-jmx
+ test-http-client-transport
diff --git a/tests/test-continuation/pom.xml b/tests/test-continuation/pom.xml
index 883694e88b0..0cc371b0dc2 100644
--- a/tests/test-continuation/pom.xml
+++ b/tests/test-continuation/pom.xml
@@ -1,26 +1,9 @@
-
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
../pom.xml
4.0.0
@@ -28,6 +11,9 @@
jar
Test :: Continuation
Asynchronous API
+
+ ${project.groupId}.continuation
+
@@ -42,11 +28,11 @@
- org.eclipse.jetty
+ org.eclipse.jetty
jetty-servlet
${project.version}
provided
-
+
org.eclipse.jetty
jetty-continuation
@@ -57,6 +43,6 @@
jetty-test-helper
compile
-
+
diff --git a/tests/test-integration/pom.xml b/tests/test-integration/pom.xml
index c6ba1f95946..8910c3f7934 100644
--- a/tests/test-integration/pom.xml
+++ b/tests/test-integration/pom.xml
@@ -1,26 +1,9 @@
-
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
test-integration
@@ -31,6 +14,8 @@
${project.build.directory}/test-wars
${project.build.directory}/test-libs
${project.build.directory}/test-dist
+ ${project.groupId}.integrations
+
@@ -116,6 +101,13 @@
${project.version}
pom
+
+ org.eclipse.jetty
+ jetty-http
+ ${project.version}
+ tests
+ test
+
org.eclipse.jetty.toolchain
jetty-test-helper
@@ -123,7 +115,7 @@
org.eclipse.jetty
- jetty-jsp
+ apache-jsp
${project.version}
@@ -133,5 +125,17 @@
war
test
+
+ org.eclipse.jetty.alpn
+ alpn-api
+ ${alpn.api.version}
+ provided
+
+
+ org.eclipse.jetty
+ jetty-alpn-server
+ ${project.version}
+ test
+
diff --git a/tests/test-jmx/jmx-webapp-it/pom.xml b/tests/test-jmx/jmx-webapp-it/pom.xml
index 5401ae8e540..92d843ba518 100644
--- a/tests/test-jmx/jmx-webapp-it/pom.xml
+++ b/tests/test-jmx/jmx-webapp-it/pom.xml
@@ -1,26 +1,9 @@
-
org.eclipse.jetty.tests
test-jmx-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
jmx-webapp-it
@@ -31,17 +14,18 @@
UTF-8
UTF-8
${project.groupId}.jmx.webapp.it
- ${project.basedir}/src/test/scripts
${project.build.directory}/test-base
- ${project.build.directory}/test-home
org.eclipse.jetty
- jetty-distribution
+ jetty-annotations
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-jmx
${project.version}
- zip
- runtime
org.eclipse.jetty.tests
@@ -72,136 +56,14 @@
jmx-webapp
runtime
war
- true
- true
+ true
+ true
true
${test-base-dir}/webapps
-
- unpack-jetty-distro
- process-test-resources
-
- unpack-dependencies
-
-
- jetty-distribution
- runtime
- zip
- true
- ${test-home-dir}
- true
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- 2.17
-
-
-
- integration-test
- verify
-
-
-
-
-
- org.apache.maven.plugins
- maven-antrun-plugin
- 1.7
-
-
- start-jetty
- pre-integration-test
-
- run
-
-
-
-
-
- Integration Test : Setup Jetty
-
-
-
-
-
-
-
-
- Integration Test : Starting Jetty ...
-
-
-
-
-
-
-
-
-
-
- Integration Test : Jetty is now available
-
-
-
-
- stop-jetty
- post-integration-test
-
- run
-
-
-
-
-
- Integration Test : Stop Jetty
-
-
-
-
-
-
-
-
-
-
-
-
- it-windows
-
-
- Windows
-
-
-
- cmd
- /c
- start-jetty.bat
- stop-jetty.bat
-
-
-
- it-unix
-
-
- unix
-
-
-
- sh
- --
- setup-jetty.sh
- start-jetty.sh
- stop-jetty.sh
-
-
-
diff --git a/tests/test-jmx/jmx-webapp/pom.xml b/tests/test-jmx/jmx-webapp/pom.xml
index 0e81a58516e..d742b4c7c93 100644
--- a/tests/test-jmx/jmx-webapp/pom.xml
+++ b/tests/test-jmx/jmx-webapp/pom.xml
@@ -1,27 +1,10 @@
-
4.0.0
org.eclipse.jetty.tests
test-jmx-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
jmx-webapp
war
@@ -54,12 +37,6 @@
true
-
- org.apache.maven.plugins
- maven-war-plugin
-
-
-
diff --git a/tests/test-jmx/pom.xml b/tests/test-jmx/pom.xml
index 895efd6c865..4698c64f29d 100644
--- a/tests/test-jmx/pom.xml
+++ b/tests/test-jmx/pom.xml
@@ -1,26 +1,9 @@
-
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
4.0.0
test-jmx-parent
diff --git a/tests/test-loginservice/pom.xml b/tests/test-loginservice/pom.xml
index c81bfae9e94..48701d05068 100644
--- a/tests/test-loginservice/pom.xml
+++ b/tests/test-loginservice/pom.xml
@@ -1,31 +1,17 @@
-
4.0.0
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-loginservice
Jetty Tests :: Login Service
http://www.eclipse.org/jetty
+
+ ${project.groupId}.loginservice
+
org.eclipse.jetty
diff --git a/tests/test-quickstart/pom.xml b/tests/test-quickstart/pom.xml
index 2d746a1a3d8..1e9b2b46451 100644
--- a/tests/test-quickstart/pom.xml
+++ b/tests/test-quickstart/pom.xml
@@ -1,8 +1,9 @@
+
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
../pom.xml
4.0.0
@@ -11,6 +12,9 @@
Test :: Jetty Quick Start
Jetty Quick Start Test
http://www.eclipse.org/jetty
+
+ ${project.groupId}.tests.quickstart
+
org.eclipse.jetty
@@ -99,14 +103,13 @@
org.eclipse.jetty.toolchain
jetty-test-helper
-
+
org.codehaus.mojo
appassembler-maven-plugin
- 1.7
unix
diff --git a/tests/test-sessions/pom.xml b/tests/test-sessions/pom.xml
index e8f71588145..962172f91c5 100644
--- a/tests/test-sessions/pom.xml
+++ b/tests/test-sessions/pom.xml
@@ -1,27 +1,10 @@
-
4.0.0
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-sessions-parent
Jetty Tests :: Sessions :: Parent
@@ -32,8 +15,8 @@
test-sessions-common
test-hash-sessions
+ test-file-sessions
test-jdbc-sessions
-
test-mongodb-sessions
test-infinispan-sessions
test-gcloud-sessions
diff --git a/tests/test-sessions/test-hash-sessions/pom.xml b/tests/test-sessions/test-hash-sessions/pom.xml
index 428c9bee4b1..b30d3270bb8 100644
--- a/tests/test-sessions/test-hash-sessions/pom.xml
+++ b/tests/test-sessions/test-hash-sessions/pom.xml
@@ -1,31 +1,17 @@
-
4.0.0
org.eclipse.jetty.tests
test-sessions-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-hash-sessions
Jetty Tests :: Sessions :: Hash
http://www.eclipse.org/jetty
+
+ ${project.groupId}.sessions.hash
+
diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml
index 1381813408f..3d7814d0140 100644
--- a/tests/test-sessions/test-jdbc-sessions/pom.xml
+++ b/tests/test-sessions/test-jdbc-sessions/pom.xml
@@ -1,31 +1,17 @@
-
4.0.0
org.eclipse.jetty.tests
test-sessions-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-jdbc-sessions
Jetty Tests :: Sessions :: JDBC
http://www.eclipse.org/jetty
+
+ ${project.groupId}.sessions.jdbc
+
@@ -62,13 +48,13 @@
org.apache.derby
derby
- 10.4.1.3
+ 10.12.1.1
test
org.apache.derby
derbytools
- 10.4.1.3
+ 10.12.1.1
test
diff --git a/tests/test-sessions/test-mongodb-sessions/pom.xml b/tests/test-sessions/test-mongodb-sessions/pom.xml
index 5ab37303be2..ef3f46f605e 100644
--- a/tests/test-sessions/test-mongodb-sessions/pom.xml
+++ b/tests/test-sessions/test-mongodb-sessions/pom.xml
@@ -1,31 +1,17 @@
-
4.0.0
org.eclipse.jetty.tests
test-sessions-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-mongodb-sessions
Jetty Tests :: Sessions :: Mongo
http://www.eclipse.org/jetty
+
+ ${project.groupId}.sessions.mongo
+
diff --git a/tests/test-sessions/test-sessions-common/pom.xml b/tests/test-sessions/test-sessions-common/pom.xml
index f490464eb28..c4f625724fe 100644
--- a/tests/test-sessions/test-sessions-common/pom.xml
+++ b/tests/test-sessions/test-sessions-common/pom.xml
@@ -1,31 +1,17 @@
-
4.0.0
org.eclipse.jetty.tests
test-sessions-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-sessions-common
Jetty Tests :: Sessions :: Common
http://www.eclipse.org/jetty
+
+ ${project.groupId}.sessions.common
+
diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml
index 0d5ff864c45..ab77e4db250 100644
--- a/tests/test-webapps/pom.xml
+++ b/tests/test-webapps/pom.xml
@@ -1,27 +1,10 @@
-
4.0.0
org.eclipse.jetty.tests
tests-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
../pom.xml
test-webapps-parent
@@ -37,7 +20,7 @@
true
-
+
org.jacoco
jacoco-maven-plugin
diff --git a/tests/test-webapps/test-jaas-webapp/pom.xml b/tests/test-webapps/test-jaas-webapp/pom.xml
index 9f054e9d6c7..02541c39cd3 100644
--- a/tests/test-webapps/test-jaas-webapp/pom.xml
+++ b/tests/test-webapps/test-jaas-webapp/pom.xml
@@ -4,11 +4,14 @@
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-jaas-webapp
Jetty Tests :: WebApp :: JAAS
war
+
+ ${project.groupId}.jaas
+
@@ -28,8 +31,8 @@
- jetty.home
- ${basedir}/src/main/config
+ jetty.base
+ ${basedir}/src/main/config/demo-base
@@ -47,6 +50,13 @@
+
+
+ mysql
+ mysql-connector-java
+ 5.1.19
+
+
org.apache.maven.plugins
diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml
index 5ea2acb91aa..d9309abff25 100644
--- a/tests/test-webapps/test-jetty-webapp/pom.xml
+++ b/tests/test-webapps/test-jetty-webapp/pom.xml
@@ -1,26 +1,9 @@
-
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
../pom.xml
4.0.0
@@ -29,6 +12,9 @@
Test :: Jetty Test Webapp
http://www.eclipse.org/jetty
war
+
+ ${project.groupId}.tests.webapp
+
@@ -70,15 +56,6 @@
-
-
- maven-war-plugin
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
org.apache.felix
maven-bundle-plugin
@@ -87,32 +64,29 @@
war
+
+ javax.servlet.jsp.*;version="[2.2.0,3.0)",org.eclipse.jetty.*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))",*
+ !com.acme*
+
+ /
+
+ .,WEB-INF/classes
+
+
+
+
+
+ maven-war-plugin
+
+
+ ${project.build.outputDirectory}/META-INF/MANIFEST.MF
+
-
-
- bundle-manifest
- process-classes
-
- manifest
-
-
-
- org.eclipse.jetty.test-jetty-webapp
- javax.servlet.jsp.*;version="[2.2.0, 3.0)",javax.servlet.*;version="[2.6,3.2)",org.eclipse.jetty.*;version="9.1",*
- !com.acme*
-
- /
-
- .,WEB-INF/classes
-
-
-
-
org.eclipse.jetty
@@ -143,11 +117,6 @@
/test
${project.build.directory}/work
-
-
- ${basedir}/target/sessions
-
-
@@ -157,6 +126,14 @@
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+ false
+
+
@@ -198,6 +175,13 @@
${project.version}
test
+
+ org.eclipse.jetty
+ jetty-servlet
+ ${project.version}
+ tests
+ test
+
org.eclipse.jetty.toolchain
jetty-test-helper
@@ -215,12 +199,6 @@
2.1
provided
-
- org.eclipse.jetty.spdy
- spdy-http-server
- ${project.version}
- test
-
javax.servlet
jstl
@@ -249,10 +227,14 @@
jspc
+
diff --git a/tests/test-webapps/test-jndi-webapp/pom.xml b/tests/test-webapps/test-jndi-webapp/pom.xml
index 9b004407398..ecfb628637d 100644
--- a/tests/test-webapps/test-jndi-webapp/pom.xml
+++ b/tests/test-webapps/test-jndi-webapp/pom.xml
@@ -4,11 +4,14 @@
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-jndi-webapp
Jetty Tests :: WebApp :: JNDI
war
+
+ ${project.groupId}.jndi
+
@@ -69,7 +72,6 @@
org.apache.maven.plugins
maven-assembly-plugin
- 2.2-beta-3
package
@@ -80,18 +82,11 @@
src/main/assembly/config.xml
-
+
-
- org.apache.maven.plugins
- maven-war-plugin
-
-
-
org.eclipse.jetty
jetty-maven-plugin
diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml
index 600b95e7afa..9aa5f62922e 100644
--- a/tests/test-webapps/test-mock-resources/pom.xml
+++ b/tests/test-webapps/test-mock-resources/pom.xml
@@ -3,11 +3,14 @@
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
Jetty Tests :: WebApp :: Mock Resources
test-mock-resources
jar
+
+ ${project.groupId}.mocks
+
@@ -22,7 +25,6 @@
true
- generate-manifest
manifest
@@ -44,23 +46,6 @@
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- artifact-jar
-
- jar
-
-
-
-
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
-
-
@@ -73,12 +58,6 @@
javax.servlet
javax.servlet-api
-
org.eclipse.jetty.orbit
javax.mail.glassfish
diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml
index eda969b6085..86fffafd9bf 100644
--- a/tests/test-webapps/test-proxy-webapp/pom.xml
+++ b/tests/test-webapps/test-proxy-webapp/pom.xml
@@ -1,26 +1,9 @@
-
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
../pom.xml
4.0.0
@@ -28,6 +11,9 @@
test-proxy-webapp
Test :: Jetty Proxy Webapp
war
+
+ ${project.groupId}.proxy
+
@@ -38,6 +24,14 @@
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+
+ false
+
+
@@ -82,18 +76,30 @@
${project.version}
provided
+
+ org.eclipse.jetty.http2
+ http2-server
+ ${project.version}
+ test
+
+
+ org.eclipse.jetty
+ jetty-alpn-server
+ ${project.version}
+ test
+
+
+ org.eclipse.jetty
+ jetty-annotations
+ ${project.version}
+ test
+
javax.servlet.jsp
jsp-api
2.1
provided
-
- org.eclipse.jetty.spdy
- spdy-http-server
- ${project.version}
- test
-
javax.servlet
jstl
diff --git a/tests/test-webapps/test-servlet-spec/pom.xml b/tests/test-webapps/test-servlet-spec/pom.xml
index 03af8117aa7..7e412ae69ed 100644
--- a/tests/test-webapps/test-servlet-spec/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-servlet-spec-parent
Jetty Tests :: Spec Test WebApp :: Parent
diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
index 8cb75bbd495..6b1fa7d3eb7 100644
--- a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
@@ -3,49 +3,20 @@
org.eclipse.jetty.tests
test-servlet-spec-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-container-initializer
jar
Jetty Tests :: WebApp :: Servlet Spec :: ServletContainerInitializer Test Jar
+
+ ${project.groupId}.sci
+
-
- maven-compiler-plugin
-
- false
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- artifact-jar
-
- jar
-
-
-
-
-
- target/classes/META-INF/MANIFEST.MF
-
-
-
org.apache.felix
maven-bundle-plugin
true
-
-
- bundle-manifest
- process-classes
-
- manifest
-
-
-
org.eclipse.jetty.tests.test-servlet-container-initializer;singleton:=true
diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
index 2a9186175c3..81d9032b4ec 100644
--- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
@@ -4,11 +4,14 @@
org.eclipse.jetty.tests
test-servlet-spec-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
Jetty Tests :: Webapps :: Spec Webapp
test-spec-webapp
war
+
+ ${project.groupId}.spec
+
@@ -18,7 +21,7 @@
true
-
+
org.apache.maven.plugins
maven-assembly-plugin
@@ -59,7 +62,6 @@
-
org.apache.felix
maven-bundle-plugin
@@ -68,40 +70,28 @@
war
+
+ org.eclipse.jetty.tests.test-spec-webapp
+ Test Webapp for Servlet 3.1 Features
+
+ javax.servlet.jsp.*;version="[2.2.0, 3.0)",
+ javax.transaction*;version="[1.1,1.3)",
+ javax.servlet*;version="[2.6,3.2)",
+ org.eclipse.jetty*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))",
+ org.eclipse.jetty.webapp;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional",
+ org.eclipse.jetty.plus.jndi;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional",
+ com.acme;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}",
+ *
+
+ <_nouses />
+ com.acme.test;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}";-noimport:=true
+ /
+ .,WEB-INF/classes,WEB-INF/lib
+ /META-INF/plugin-context.xml
+
-
-
- bundle-manifest
- process-classes
-
- manifest
-
-
-
- org.eclipse.jetty.tests.test-spec-webapp
- Test Webapp for Servlet 3.1 Features
-
- javax.servlet.jsp.*;version="[2.2.0, 3.0)",
- javax.transaction.*;version="[1.1, 2.0)",
- javax.servlet.*;version="3.0",
- javax.sql,
- org.eclipse.jetty.webapp;version="9.2",org.eclipse.jetty.plus.jndi;version="9.2",
- org.eclipse.jetty.security;version="9.2",
- com.acme;version="9.2",
- *
-
- com.acme.test;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
- /
- .,WEB-INF/classes,WEB-INF/lib
- ./META-INF/plugin-context.xml
- <_nouses>true
-
-
-
-
-
maven-antrun-plugin
@@ -149,24 +139,6 @@
-
org.eclipse.jetty
jetty-maven-plugin
@@ -200,6 +172,7 @@
+
javax.transaction
diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
index 39e96fc4152..21722e8cdbb 100644
--- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
@@ -3,12 +3,15 @@
org.eclipse.jetty.tests
test-servlet-spec-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
Jetty Tests :: WebApp :: Servlet Spec :: Fragment Jar
org.eclipse.jetty.tests
test-web-fragment
jar
+
+ ${project.groupId}.fragment
+
@@ -17,46 +20,6 @@
false
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
- artifact-jar
-
- jar
-
-
-
-
-
- target/classes/META-INF/MANIFEST.MF
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- true
-
-
- bundle-manifest
- process-classes
-
- manifest
-
-
-
-
-
- org.eclipse.jetty.tests.test-web-fragment;singleton:=true
- A bundle containing web fragment for testing
- com.acme.fragment;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
- <_nouses>true
-
-
-
-
@@ -64,5 +27,12 @@
javax.servlet
javax.servlet-api
+
+
diff --git a/tests/test-webapps/test-webapp-rfc2616/pom.xml b/tests/test-webapps/test-webapp-rfc2616/pom.xml
index a3e0aecc037..7f6f901ee26 100644
--- a/tests/test-webapps/test-webapp-rfc2616/pom.xml
+++ b/tests/test-webapps/test-webapp-rfc2616/pom.xml
@@ -1,32 +1,18 @@
-
4.0.0
org.eclipse.jetty.tests
test-webapps-parent
- 9.2.23-SNAPSHOT
+ 9.4.7-SNAPSHOT
test-webapp-rfc2616
Jetty Tests :: WebApp :: RFC2616
http://www.eclipse.org/jetty
war
+
+ ${project.groupId}.rfc2616
+