Author: dkulp
Date: Sat Jun 2 01:54:23 2012
New Revision: 1345417
URL: http://svn.apache.org/viewvc?rev=1345417&view=rev
Log:
No need for a thread
Modified:
cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
Modified:
cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java?rev=1345417&r1=1345416&r2=1345417&view=diff
==============================================================================
---
cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
(original)
+++
cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ManagedEndpointsTest.java
Sat Jun 2 01:54:23 2012
@@ -19,6 +19,7 @@
package org.apache.cxf.systest.ws.rm;
+import java.util.Arrays;
import java.util.Date;
import java.util.logging.Logger;
@@ -39,6 +40,7 @@ import org.apache.cxf.testutil.common.Ab
import org.apache.cxf.ws.rm.RMManager;
import org.apache.cxf.ws.rm.RMUtils;
+import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -54,11 +56,14 @@ public class ManagedEndpointsTest extend
private static final Logger LOG =
LogUtils.getLogger(ManagedEndpointsTest.class);
private static Bus clientBus;
- private static Bus serverBus;
private static InProcessServer server;
-
- static class InProcessServer implements Runnable {
+ private static Bus serverBus;
+
+ static class InProcessServer {
private boolean ready;
+ private Endpoint ep;
+
+
public void run() {
SpringBusFactory bf = new SpringBusFactory();
serverBus = bf.createBus(SERVER_CFG);
@@ -67,13 +72,16 @@ public class ManagedEndpointsTest extend
GreeterImpl implementor = new GreeterImpl();
String address = "http://localhost:" + PORT +
"/SoapContext/GreeterPort";
- Endpoint ep = Endpoint.create(implementor);
+ ep = Endpoint.create(implementor);
ep.publish(address);
LOG.info("Published greeter endpoint.");
ready = true;
}
-
+ public void stop() {
+ ep.stop();
+ serverBus.shutdown(true);
+ }
public boolean isReady() {
return ready;
}
@@ -82,15 +90,17 @@ public class ManagedEndpointsTest extend
@BeforeClass
public static void startServer() throws Exception {
server = new InProcessServer();
- Thread th = new Thread(server);
- th.start();
+ server.run();
}
@AfterClass
public static void stopServer() throws Exception {
- if (null != serverBus) {
- serverBus.shutdown(false);
- }
+ server.stop();
+ }
+
+ @After
+ public void stopBus() throws Exception {
+ clientBus.shutdown(true);
}
@Test