cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r516103 [11/11] - in /incubator/cxf/trunk: ./ common/common/src/test/java/org/apache/cxf/common/annotation/ common/common/src/test/java/org/apache/cxf/common/classloader/ common/common/src/test/java/org/apache/cxf/common/commands/ common/co...
Date Thu, 08 Mar 2007 17:15:05 GMT
Copied: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerTestBase.java
(from r515736, incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerSetupBase.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerTestBase.java?view=diff&rev=516103&p1=incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerSetupBase.java&r1=515736&p2=incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerTestBase.java&r2=516103
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerSetupBase.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/testutil/common/AbstractClientServerTestBase.java
Thu Mar  8 09:14:44 2007
@@ -24,31 +24,16 @@
 import java.util.List;
 import java.util.Map;
 
+import org.junit.AfterClass;
+import org.junit.Assert;
 
-import junit.extensions.TestSetup;
-import junit.framework.Test;
 
-public abstract class AbstractClientServerSetupBase extends TestSetup {
-    private final List<ServerLauncher> launchers = new ArrayList<ServerLauncher>();
 
+public abstract class AbstractClientServerTestBase extends Assert {
+    private static List<ServerLauncher> launchers = new ArrayList<ServerLauncher>();
 
 
-    public AbstractClientServerSetupBase(Test arg0) {
-        super(arg0);
-    }
 
-    public void setUp() throws Exception {
-        startServers();
-    }
-    
-    public abstract void startServers() throws Exception;
-    
-    public void tearDown() throws Exception {
-        boolean serverPassed = stopAllServers();
-        launchers.clear();
-        System.gc();
-        assertTrue("server failed", serverPassed);
-    } 
-    
-    protected boolean stopAllServers() {
+    @AfterClass
+    public static void stopAllServers() throws Exception {
         boolean passed = true;
         for (ServerLauncher sl : launchers) {
             try { 
@@ -65,10 +50,11 @@
             }
         }
         launchers.clear();
-        return passed;
+        System.gc();
+        assertTrue("server failed", passed);
     }
     
-    public boolean launchServer(Class<?> clz) {
+    public static boolean launchServer(Class<?> clz) {
         boolean ok = false;
         try { 
             ServerLauncher sl = new ServerLauncher(clz.getName());
@@ -82,7 +68,7 @@
         
         return ok;
     }
-    public boolean launchServer(Class<?> clz, boolean inProcess) {
+    public static boolean launchServer(Class<?> clz, boolean inProcess) {
         boolean ok = false;
         try { 
             ServerLauncher sl = new ServerLauncher(clz.getName(), inProcess);
@@ -96,10 +82,10 @@
         
         return ok;
     }
-    public boolean launchServer(Class<?> clz, Map<String, String> props, String[]
args) {
+    public static boolean launchServer(Class<?> clz, Map<String, String> props,
String[] args) {
         return launchServer(clz, props, args, false);
     }
-    public boolean launchServer(Class<?> clz, Map<String, String> props, String[]
args,
+    public static boolean launchServer(Class<?> clz, Map<String, String> props,
String[] args,
                                 boolean inProcess) {
         boolean ok = false;
         try { 



Mime
View raw message