You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2019/01/10 18:54:00 UTC

[GitHub] amarkevich closed pull request #498: cxf-systests-databinding: run tests without internet connection

amarkevich closed pull request #498: cxf-systests-databinding: run tests without internet connection
URL: https://github.com/apache/cxf/pull/498
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java b/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
index 41a9ca0a9a3..ecad2313906 100644
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
+++ b/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
@@ -25,14 +25,12 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Logger;
 
 import org.w3c.dom.Document;
 
 import org.apache.cxf.aegis.databinding.AegisDatabinding;
 import org.apache.cxf.authservice.AuthService;
 import org.apache.cxf.authservice.Authenticate;
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
 import org.apache.cxf.ext.logging.LoggingInInterceptor;
@@ -56,7 +54,6 @@
 
 public class AegisClientServerTest extends AbstractBusClientServerTestBase {
     static final String PORT = allocatePort(AegisServer.class);
-    static final Logger LOG = LogUtils.getLogger(AegisClientServerTest.class);
 
     @BeforeClass
     public static void startServers() throws Exception {
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java b/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java
index 6718a6947be..b36920d4191 100644
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java
+++ b/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisServer.java
@@ -19,12 +19,10 @@
 
 package org.apache.cxf.systest.aegis;
 
-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.util.resource.Resource;
 import org.eclipse.jetty.webapp.WebAppContext;
 
 
@@ -39,25 +37,14 @@ protected void run() {
         server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
 
         WebAppContext webappcontext = new WebAppContext();
-        String contextPath = null;
-        try {
-            contextPath = getClass().getResource("/webapp").toURI().getPath();
-        } catch (URISyntaxException e1) {
-            e1.printStackTrace();
-        }
         webappcontext.setContextPath("/");
+        webappcontext.setBaseResource(Resource.newClassPathResource("/webapp"));
 
-        webappcontext.setWar(contextPath);
-
-        HandlerCollection handlers = new HandlerCollection();
-        handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});
-
-        server.setHandler(handlers);
+        server.setHandler(new HandlerCollection(webappcontext, new DefaultHandler()));
         try {
             server.start();
-
         } catch (Exception e) {
-            e.printStackTrace();
+            throw new RuntimeException(e);
         }
 
     }
diff --git a/systests/databinding/src/test/resources/webapp/WEB-INF/web.xml b/systests/databinding/src/test/resources/webapp/WEB-INF/web.xml
index a8cae3fe794..97aba6e038f 100644
--- a/systests/databinding/src/test/resources/webapp/WEB-INF/web.xml
+++ b/systests/databinding/src/test/resources/webapp/WEB-INF/web.xml
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
 <!--
         Licensed to the Apache Software Foundation (ASF) under one
         or more contributor license agreements. See the NOTICE file
@@ -19,7 +18,9 @@
         under the License.
 -->
 <!-- START SNIPPET: webxml -->
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+    version="3.0">
     <context-param>
         <param-name>contextConfigLocation</param-name>
         <param-value>WEB-INF/beans.xml</param-value>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services