This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/master by this push:
new b86a13a [cxf-systests-jaxrs] reuse AbstractSpringServer
b86a13a is described below
commit b86a13abd8839680580e06341bb1d502b296ae8e
Author: amarkevich <[email protected]>
AuthorDate: Thu Mar 14 13:13:28 2019 +0300
[cxf-systests-jaxrs] reuse AbstractSpringServer
---
.../apache/cxf/systest/jaxrs/AtomBookServer.java | 46 ++-------------------
.../cxf/systest/jaxrs/BookDataBindingServer.java | 46 ++-------------------
.../cxf/systest/jaxrs/BookServerProxySpring.java | 46 ++-------------------
.../systest/jaxrs/BookServerRequestDispatch.java | 46 ++-------------------
.../jaxrs/BookServerResourceCreatedSpring.java | 47 ++-------------------
.../BookServerResourceCreatedSpringProviders.java | 48 ++--------------------
.../BookServerResourceJacksonSpringProviders.java | 47 ++-------------------
.../cxf/systest/jaxrs/BookServerRestSoap.java | 46 ++-------------------
.../cxf/systest/jaxrs/BookServerServletFilter.java | 47 ++-------------------
.../apache/cxf/systest/jaxrs/BookServerSpring.java | 46 ++-------------------
.../systest/jaxrs/description/Swagger2Server.java | 45 ++------------------
.../jaxrs/description/openapi/OpenApiServer.java | 46 ++-------------------
.../cxf/systest/jaxrs/nio/NioBookStoreServer.java | 45 ++------------------
13 files changed, 42 insertions(+), 559 deletions(-)
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookServer.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookServer.java
index 910dbc6..a7eba9e 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookServer.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookServer.java
@@ -19,52 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class AtomBookServer extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-public class AtomBookServer extends AbstractBusTestServerBase {
public static final String PORT = allocatePort(AtomBookServer.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_atom").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public AtomBookServer() {
+ super("/jaxrs_atom", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
index 72976ef..66558dc 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookDataBindingServer.java
@@ -19,52 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookDataBindingServer extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookDataBindingServer extends AbstractBusTestServerBase {
public static final String PORT =
allocatePort(BookDataBindingServer.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_databinding").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookDataBindingServer() {
+ super("/jaxrs_databinding", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerProxySpring.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerProxySpring.java
index 0a387e1..d9a63b7 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerProxySpring.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerProxySpring.java
@@ -19,52 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerProxySpring extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerProxySpring extends AbstractBusTestServerBase {
public static final String PORT =
allocatePort(BookServerProxySpring.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_proxy").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerProxySpring() {
+ super("/jaxrs_proxy", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRequestDispatch.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRequestDispatch.java
index a00244f..0e60b65 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRequestDispatch.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRequestDispatch.java
@@ -19,52 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerRequestDispatch extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerRequestDispatch extends AbstractBusTestServerBase {
public static final String PORT =
allocatePort(BookServerRequestDispatch.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_dispatch").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerRequestDispatch() {
+ super("/jaxrs_dispatch", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpring.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpring.java
index 9647397..fe22ac1 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpring.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpring.java
@@ -19,53 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerResourceCreatedSpring extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerResourceCreatedSpring extends AbstractBusTestServerBase
{
public static final String PORT =
allocatePort(BookServerResourceCreatedSpring.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_spring").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/webapp");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerResourceCreatedSpring() {
+ super("/jaxrs_spring", "/webapp", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpringProviders.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpringProviders.java
index d455505..e0530d2 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpringProviders.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceCreatedSpringProviders.java
@@ -19,53 +19,11 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
-
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerResourceCreatedSpringProviders extends
AbstractBusTestServerBase {
+public class BookServerResourceCreatedSpringProviders extends
AbstractSpringServer {
public static final String PORT =
allocatePort(BookServerResourceCreatedSpringProviders.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_spring_providers").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/webapp");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerResourceCreatedSpringProviders() {
+ super("/jaxrs_spring_providers", "/webapp", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceJacksonSpringProviders.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceJacksonSpringProviders.java
index 8245af7..406a01d 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceJacksonSpringProviders.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerResourceJacksonSpringProviders.java
@@ -19,53 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerResourceJacksonSpringProviders extends
AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerResourceJacksonSpringProviders extends
AbstractBusTestServerBase {
public static final String PORT =
allocatePort(BookServerResourceJacksonSpringProviders.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_jackson_provider").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/webapp");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerResourceJacksonSpringProviders() {
+ super("/jaxrs_jackson_provider", "/webapp", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRestSoap.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRestSoap.java
index 1935feb..6cde1fc 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRestSoap.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerRestSoap.java
@@ -19,52 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerRestSoap extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerRestSoap extends AbstractBusTestServerBase {
public static final String PORT = allocatePort(BookServerRestSoap.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_soap_rest").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/test");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerRestSoap() {
+ super("/jaxrs_soap_rest", "/test", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerServletFilter.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerServletFilter.java
index 3ba0cc6..dae93a1 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerServletFilter.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerServletFilter.java
@@ -19,53 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerServletFilter extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerServletFilter extends AbstractBusTestServerBase {
public static final String PORT =
allocatePort(BookServerServletFilter.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/servlet_as_filter").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/webapp");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerServletFilter() {
+ super("/servlet_as_filter", "/webapp", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerSpring.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerSpring.java
index a7a14eb..b98515f 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerSpring.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServerSpring.java
@@ -19,52 +19,12 @@
package org.apache.cxf.systest.jaxrs;
-import java.net.URISyntaxException;
+public class BookServerSpring extends AbstractSpringServer {
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-
-public class BookServerSpring extends AbstractBusTestServerBase {
static final String PORT = allocatePort(BookServerSpring.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath = getClass().getResource("/jaxrs").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public BookServerSpring() {
+ super("/jaxrs", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2Server.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2Server.java
index 4ad3538..1235eaa 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2Server.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/Swagger2Server.java
@@ -19,52 +19,15 @@
package org.apache.cxf.systest.jaxrs.description;
-import java.net.URISyntaxException;
+import org.apache.cxf.systest.jaxrs.AbstractSpringServer;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
+public class Swagger2Server extends AbstractSpringServer {
-public class Swagger2Server extends AbstractBusTestServerBase {
static final String PORT = allocatePort(Swagger2Server.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_swagger2").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public Swagger2Server() {
+ super("/jaxrs_swagger2", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/openapi/OpenApiServer.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/openapi/OpenApiServer.java
index ccde34f..206e917 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/openapi/OpenApiServer.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/openapi/OpenApiServer.java
@@ -19,52 +19,14 @@
package org.apache.cxf.systest.jaxrs.description.openapi;
-import java.net.URISyntaxException;
+import org.apache.cxf.systest.jaxrs.AbstractSpringServer;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
-
-public class OpenApiServer extends AbstractBusTestServerBase {
+public class OpenApiServer extends AbstractSpringServer {
static final String PORT = allocatePort(OpenApiServer.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_openapi_v3").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public OpenApiServer() {
+ super("/jaxrs_openapi_v3", Integer.parseInt(PORT));
}
public static void main(String[] args) {
diff --git
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
index fc663a2..77cefe5 100644
---
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
+++
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/nio/NioBookStoreServer.java
@@ -19,52 +19,15 @@
package org.apache.cxf.systest.jaxrs.nio;
-import java.net.URISyntaxException;
+import org.apache.cxf.systest.jaxrs.AbstractSpringServer;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
-import org.eclipse.jetty.server.Handler;
-import org.eclipse.jetty.server.handler.DefaultHandler;
-import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.webapp.WebAppContext;
+public class NioBookStoreServer extends AbstractSpringServer {
-public class NioBookStoreServer extends AbstractBusTestServerBase {
static final String PORT = allocatePort(NioBookStoreServer.class);
- private org.eclipse.jetty.server.Server server;
-
- protected void run() {
- server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
-
- WebAppContext webappcontext = new WebAppContext();
- String contextPath = null;
- try {
- contextPath =
getClass().getResource("/jaxrs_nio").toURI().getPath();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- webappcontext.setContextPath("/");
-
- webappcontext.setWar(contextPath);
-
- HandlerCollection handlers = new HandlerCollection();
- handlers.setHandlers(new Handler[] {webappcontext, new
DefaultHandler()});
-
- server.setHandler(handlers);
- try {
- server.start();
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public void tearDown() throws Exception {
- super.tearDown();
- if (server != null) {
- server.stop();
- server.destroy();
- server = null;
- }
+ public NioBookStoreServer() {
+ super("/jaxrs_nio", Integer.parseInt(PORT));
}
public static void main(String[] args) {