Author: veithen
Date: Mon Jan  8 01:09:51 2018
New Revision: 1820512

URL: http://svn.apache.org/viewvc?rev=1820512&view=rev
Log:
Avoid PortAllocator because it's not 100% reliable.

Added:
    
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/
    
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpContextImpl.java
   (with props)
    
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpExchangeImpl.java
   (with props)
    
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSEndpoint.java
   (with props)
    
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSHandler.java
   (with props)
Modified:
    
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java
    
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java
    
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java
    
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java

Modified: 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java?rev=1820512&r1=1820511&r2=1820512&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java
 Mon Jan  8 01:09:51 2018
@@ -20,14 +20,12 @@ package org.apache.axis2.databinding.axi
 
 import static com.google.common.truth.Truth.assertThat;
 
-import javax.xml.ws.Endpoint;
-
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axis2.databinding.axis2_5750.client.FixedValue;
 import org.apache.axis2.databinding.axis2_5750.client.FixedValueServiceStub;
 import org.apache.axis2.databinding.axis2_5750.client.NonFixedValue_type1;
 import org.apache.axis2.databinding.axis2_5750.service.FixedValueServiceImpl;
 import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
 import org.junit.ClassRule;
 import org.junit.Test;
 
@@ -35,20 +33,16 @@ public class ServiceTest {
     @ClassRule
     public static final ClientHelper clientHelper = new 
ClientHelper("target/repo/client");
 
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new 
FixedValueServiceImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:"; + port + "/service";
-        Endpoint endpoint = Endpoint.publish(address, new 
FixedValueServiceImpl());
-        try {
-            FixedValue fixedValue = new FixedValue();
-            NonFixedValue_type1 nonFixedValue_type1 = new 
NonFixedValue_type1();
-            nonFixedValue_type1.setNonFixedValue_type0("SomeId");
-            fixedValue.setNonFixedValue(nonFixedValue_type1);
-            FixedValueServiceStub stub = 
clientHelper.createStub(FixedValueServiceStub.class, address);
-            assertThat(stub.test(fixedValue).getOut()).isEqualTo("OK");
-        } finally {
-            endpoint.stop();
-        }
+        FixedValue fixedValue = new FixedValue();
+        NonFixedValue_type1 nonFixedValue_type1 = new NonFixedValue_type1();
+        nonFixedValue_type1.setNonFixedValue_type0("SomeId");
+        fixedValue.setNonFixedValue(nonFixedValue_type1);
+        FixedValueServiceStub stub = 
clientHelper.createStub(FixedValueServiceStub.class, endpoint.getAddress());
+        assertThat(stub.test(fixedValue).getOut()).isEqualTo("OK");
     }
 }

Modified: 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java?rev=1820512&r1=1820511&r2=1820512&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java
 Mon Jan  8 01:09:51 2018
@@ -20,13 +20,11 @@ package org.apache.axis2.databinding.axi
 
 import static com.google.common.truth.Truth.assertThat;
 
-import javax.xml.ws.Endpoint;
-
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axis2.databinding.axis2_5758.client.StockQuoteServiceStub;
 import org.apache.axis2.databinding.axis2_5758.client.TradePriceRequest;
 import org.apache.axis2.databinding.axis2_5758.service.StockQuoteServiceImpl;
 import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
 import org.junit.ClassRule;
 import org.junit.Test;
 
@@ -34,20 +32,16 @@ public class ServiceTest {
     @ClassRule
     public static final ClientHelper clientHelper = new 
ClientHelper("target/repo/client");
 
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new 
StockQuoteServiceImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:"; + port + "/service";
-        Endpoint endpoint = Endpoint.publish(address, new 
StockQuoteServiceImpl());
-        try {
-            StockQuoteServiceStub stub = 
clientHelper.createStub(StockQuoteServiceStub.class, address);
-            TradePriceRequest request = new TradePriceRequest();
-            request.setTickerSymbol(null);
-            assertThat(stub.getLastTradePrice(request).getPrice()).isNaN();
-            request.setTickerSymbol("GOOG");
-            
assertThat(stub.getLastTradePrice(request).getPrice()).isWithin(0.001f).of(100.0f);
-        } finally {
-            endpoint.stop();
-        }
+        StockQuoteServiceStub stub = 
clientHelper.createStub(StockQuoteServiceStub.class, endpoint.getAddress());
+        TradePriceRequest request = new TradePriceRequest();
+        request.setTickerSymbol(null);
+        assertThat(stub.getLastTradePrice(request).getPrice()).isNaN();
+        request.setTickerSymbol("GOOG");
+        
assertThat(stub.getLastTradePrice(request).getPrice()).isWithin(0.001f).of(100.0f);
     }
 }

Modified: 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java?rev=1820512&r1=1820511&r2=1820512&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java
 Mon Jan  8 01:09:51 2018
@@ -20,13 +20,11 @@ package org.apache.axis2.databinding.axi
 
 import static com.google.common.truth.Truth.assertThat;
 
-import javax.xml.ws.Endpoint;
-
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axis2.databinding.axis2_5799.client.ComplexTypeWithAttribute;
 import org.apache.axis2.databinding.axis2_5799.client.EchoServiceStub;
 import org.apache.axis2.databinding.axis2_5799.service.EchoImpl;
 import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
 import org.junit.ClassRule;
 import org.junit.Test;
 
@@ -34,18 +32,14 @@ public class ServiceTest {
     @ClassRule
     public static final ClientHelper clientHelper = new 
ClientHelper("target/repo/client");
 
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new 
EchoImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:"; + port + "/service";
-        Endpoint endpoint = Endpoint.publish(address, new EchoImpl());
-        try {
-            EchoServiceStub stub = 
clientHelper.createStub(EchoServiceStub.class, address);
-            ComplexTypeWithAttribute request = new ComplexTypeWithAttribute();
-            request.setAttr("value");
-            assertThat(stub.echo(request).getAttr()).isEqualTo("value");
-        } finally {
-            endpoint.stop();
-        }
+        EchoServiceStub stub = clientHelper.createStub(EchoServiceStub.class, 
endpoint.getAddress());
+        ComplexTypeWithAttribute request = new ComplexTypeWithAttribute();
+        request.setAttr("value");
+        assertThat(stub.echo(request).getAttr()).isEqualTo("value");
     }
 }

Modified: 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java?rev=1820512&r1=1820511&r2=1820512&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java
 Mon Jan  8 01:09:51 2018
@@ -19,9 +19,7 @@
 package org.apache.axis2.databinding.mtom;
 
 import javax.activation.DataHandler;
-import javax.xml.ws.Endpoint;
 
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axiom.testutils.activation.RandomDataSource;
 import org.apache.axiom.testutils.io.IOTestUtils;
 import org.apache.axis2.Constants;
@@ -29,6 +27,7 @@ import org.apache.axis2.databinding.mtom
 import org.apache.axis2.databinding.mtom.client.MTOMServiceStub.GetContent;
 import org.apache.axis2.databinding.mtom.service.MTOMServiceImpl;
 import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
 import org.junit.ClassRule;
 import org.junit.Test;
 
@@ -36,21 +35,17 @@ public class MTOMTest {
     @ClassRule
     public static final ClientHelper clientHelper = new 
ClientHelper("target/repo/client");
 
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new 
MTOMServiceImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:"; + port + "/mtom";
-        Endpoint endpoint = Endpoint.publish(address, new MTOMServiceImpl());
-        try {
-            MTOMServiceStub stub = 
clientHelper.createStub(MTOMServiceStub.class, address);
-            // JAX-WS only produces an MTOM response if the request uses MTOM
-            
stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,
 Constants.VALUE_TRUE);
-            DataHandler content = stub.getContent(new 
GetContent()).getContent();
-            IOTestUtils.compareStreams(
-                    new RandomDataSource(654321L, 1000000).getInputStream(), 
"expected",
-                    content.getInputStream(), "actual");
-        } finally {
-            endpoint.stop();
-        }
+        MTOMServiceStub stub = clientHelper.createStub(MTOMServiceStub.class, 
endpoint.getAddress());
+        // JAX-WS only produces an MTOM response if the request uses MTOM
+        
stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM,
 Constants.VALUE_TRUE);
+        DataHandler content = stub.getContent(new GetContent()).getContent();
+        IOTestUtils.compareStreams(
+                new RandomDataSource(654321L, 1000000).getInputStream(), 
"expected",
+                content.getInputStream(), "actual");
     }
 }

Added: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpContextImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpContextImpl.java?rev=1820512&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpContextImpl.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpContextImpl.java
 Mon Jan  8 01:09:51 2018
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.testutils.jaxws;
+
+import java.util.Set;
+
+import javax.xml.ws.spi.http.HttpContext;
+import javax.xml.ws.spi.http.HttpHandler;
+
+final class HttpContextImpl extends HttpContext {
+    HttpHandler getHandler() {
+        return handler;
+    }
+
+    @Override
+    public String getPath() {
+        return "/";
+    }
+
+    @Override
+    public Object getAttribute(String name) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Set<String> getAttributeNames() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+}

Propchange: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpContextImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpExchangeImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpExchangeImpl.java?rev=1820512&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpExchangeImpl.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpExchangeImpl.java
 Mon Jan  8 01:09:51 2018
@@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.testutils.jaxws;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.InetSocketAddress;
+import java.security.Principal;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.spi.http.HttpContext;
+import javax.xml.ws.spi.http.HttpExchange;
+
+final class HttpExchangeImpl extends HttpExchange {
+    private final HttpServletRequest request;
+    private final HttpServletResponse response;
+
+    HttpExchangeImpl(HttpServletRequest request, HttpServletResponse response) 
{
+        this.request = request;
+        this.response = response;
+    }
+
+    @Override
+    public Map<String, List<String>> getRequestHeaders() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getRequestHeader(String name) {
+        return request.getHeader(name);
+    }
+
+    @Override
+    public Map<String, List<String>> getResponseHeaders() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void addResponseHeader(String name, String value) {
+        response.setHeader(name, value);
+    }
+
+    @Override
+    public String getRequestURI() {
+        return request.getRequestURI();
+    }
+
+    @Override
+    public String getContextPath() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getRequestMethod() {
+        return request.getMethod();
+    }
+
+    @Override
+    public HttpContext getHttpContext() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void close() throws IOException {
+        response.getOutputStream().close();
+    }
+
+    @Override
+    public InputStream getRequestBody() throws IOException {
+        return request.getInputStream();
+    }
+
+    @Override
+    public OutputStream getResponseBody() throws IOException {
+        return response.getOutputStream();
+    }
+
+    @Override
+    public void setStatus(int status) {
+        response.setStatus(status);
+    }
+
+    @Override
+    public InetSocketAddress getRemoteAddress() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public InetSocketAddress getLocalAddress() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getProtocol() {
+        return request.getProtocol();
+    }
+
+    @Override
+    public String getScheme() {
+        return request.getScheme();
+    }
+
+    @Override
+    public String getPathInfo() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getQueryString() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Object getAttribute(String name) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Set<String> getAttributeNames() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Principal getUserPrincipal() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean isUserInRole(String role) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+}

Propchange: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/HttpExchangeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSEndpoint.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSEndpoint.java?rev=1820512&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSEndpoint.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSEndpoint.java
 Mon Jan  8 01:09:51 2018
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.testutils.jaxws;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.junit.rules.ExternalResource;
+
+public final class JAXWSEndpoint extends ExternalResource {
+    private static final Log log = LogFactory.getLog(JAXWSEndpoint.class);
+
+    private final Object implementor;
+    private Server server;
+
+    public JAXWSEndpoint(Object implementor) {
+        this.implementor = implementor;
+    }
+
+    @Override
+    protected void before() throws Throwable {
+        server = new Server();
+        SelectChannelConnector connector = new SelectChannelConnector();
+        server.addConnector(connector);
+        HttpContextImpl httpContext = new HttpContextImpl();
+        Endpoint.create(implementor).publish(httpContext);
+        server.setHandler(new JAXWSHandler(httpContext));
+        server.start();
+    }
+
+    @Override
+    protected void after() {
+        if (server != null) {
+            try {
+                server.stop();
+            } catch (Exception ex) {
+                log.error("Failed to stop Jetty server", ex);
+            }
+            server = null;
+        }
+    }
+
+    public String getAddress() {
+        return String.format("http://localhost:%s/";, 
server.getConnectors()[0].getLocalPort());
+    }
+}

Propchange: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSEndpoint.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSHandler.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSHandler.java?rev=1820512&view=auto
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSHandler.java
 (added)
+++ 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSHandler.java
 Mon Jan  8 01:09:51 2018
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis2.testutils.jaxws;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.handler.AbstractHandler;
+
+final class JAXWSHandler extends AbstractHandler {
+    private final HttpContextImpl httpContext;
+    
+    JAXWSHandler(HttpContextImpl httpContext) {
+        this.httpContext = httpContext;
+    }
+
+    @Override
+    public void handle(String target, Request baseRequest, HttpServletRequest 
request,
+            HttpServletResponse response) throws IOException, ServletException 
{
+        httpContext.getHandler().handle(new HttpExchangeImpl(request, 
response));
+    }
+}

Propchange: 
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/jaxws/JAXWSHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to