Fix UDP tests on my mac
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0572061e Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0572061e Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0572061e Branch: refs/heads/3.1.x-fixes Commit: 0572061edf5ab349dc61e77fbb8d360c7521d111 Parents: 83846d0 Author: Daniel Kulp <[email protected]> Authored: Tue Jun 7 13:52:42 2016 -0400 Committer: Daniel Kulp <[email protected]> Committed: Fri Jun 10 13:35:29 2016 -0400 ---------------------------------------------------------------------- .../cxf/transport/udp/UDPTransportTest.java | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/0572061e/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java ---------------------------------------------------------------------- diff --git a/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java b/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java index fea6ce1..9c0052c 100644 --- a/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java +++ b/rt/transports/udp/src/test/java/org/apache/cxf/transport/udp/UDPTransportTest.java @@ -22,12 +22,13 @@ package org.apache.cxf.transport.udp; import java.net.NetworkInterface; import java.util.Enumeration; +import javax.jws.WebService; + import org.apache.cxf.endpoint.Server; import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; import org.apache.cxf.jaxws.JaxWsServerFactoryBean; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; import org.apache.hello_world.Greeter; -import org.apache.hello_world.GreeterImpl; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -40,6 +41,23 @@ public class UDPTransportTest extends AbstractBusClientServerTestBase { static final String PORT = allocatePort(UDPTransportTest.class); private static Server server; + @WebService(serviceName = "SOAPService", + endpointInterface = "org.apache.hello_world.Greeter", + targetNamespace = "http://apache.org/hello_world") + static class GreeterImpl implements Greeter { + private String myName = "defaultGreeter"; + GreeterImpl() { + } + public String greetMe(String me) { + return "Hello " + me; + } + public String sayHi() { + return "Bonjour from " + myName; + } + public void pingMe() { + } + } + @BeforeClass public static void setUpBeforeClass() throws Exception { @@ -53,7 +71,9 @@ public class UDPTransportTest extends AbstractBusClientServerTestBase { @AfterClass public static void shutdown() throws Exception { - server.stop(); + if (server != null) { + server.stop(); + } } @Test
