You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sc...@apache.org on 2011/01/20 16:29:57 UTC

svn commit: r1061343 - in /tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice: OrderServiceBareTestCase.java OrderServiceTestCase.java

Author: scottkurz
Date: Thu Jan 20 15:29:57 2011
New Revision: 1061343

URL: http://svn.apache.org/viewvc?rev=1061343&view=rev
Log:
Expedite test execution by doing static setup/teardown

Modified:
    tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java
    tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java

Modified: tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java?rev=1061343&r1=1061342&r2=1061343&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceBareTestCase.java Thu Jan 20 15:29:57 2011
@@ -30,8 +30,8 @@ import org.apache.tuscany.sca.node.Contr
 import org.apache.tuscany.sca.node.ContributionLocationHelper;
 import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
@@ -39,10 +39,10 @@ import org.junit.Test;
  */
 public class OrderServiceBareTestCase {
 
-    private Node node;
+    private static Node node;
 
-    @Before
-    public void startServer() throws Exception {
+    @BeforeClass
+    public static void startServer() throws Exception {
         try {
 
             NodeFactory factory = NodeFactory.newInstance();
@@ -120,7 +120,7 @@ public class OrderServiceBareTestCase {
     }    
     
     @Test
-    public void testOrderReviewOutHolderSCA() throws IOException {
+    public void testOrderReviewBareOutHolderSCA() throws IOException {
         OrderServiceBare orderServiceBare =
             node.getService(OrderServiceBare.class, "OrderServiceBareComponent/OrderServiceBare");
         assertNotNull(orderServiceBare);            
@@ -128,7 +128,7 @@ public class OrderServiceBareTestCase {
     }
 
     @Test
-    public void testOrderReviewOutHolderWS() throws IOException {
+    public void testOrderReviewBareOutHolderWS() throws IOException {
         OrderServiceBare orderServiceBare =
             node.getService(OrderServiceBare.class, "OrderServiceBareForwardComponent/OrderServiceBare");
         assertNotNull(orderServiceBare);            
@@ -195,8 +195,9 @@ public class OrderServiceBareTestCase {
     }        
 
     
-    @After
-    public void stopServer() throws Exception {
+    
+    @AfterClass
+    public static void stopServer() throws Exception {
         if (node != null)
             node.stop();
     }

Modified: tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java?rev=1061343&r1=1061342&r2=1061343&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/test/java/org/example/orderservice/OrderServiceTestCase.java Thu Jan 20 15:29:57 2011
@@ -30,8 +30,8 @@ import org.apache.tuscany.sca.node.Contr
 import org.apache.tuscany.sca.node.ContributionLocationHelper;
 import org.apache.tuscany.sca.node.Node;
 import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
@@ -39,12 +39,11 @@ import org.junit.Test;
  */
 public class OrderServiceTestCase {
 
-    private Node node;
+    private static Node node;
 
-    @Before
-    public void startServer() throws Exception {
+    @BeforeClass
+    public static void startServer() throws Exception {
         try {
-
             NodeFactory factory = NodeFactory.newInstance();
             String contribution = ContributionLocationHelper.getContributionLocation(OrderService.class);
             node = factory.createNode("ordersca.composite", new Contribution("order", contribution)).start();
@@ -295,9 +294,9 @@ public class OrderServiceTestCase {
         assertEquals("retval2", returnValue[1]);
         assertTrue(outParam.value.floatValue() == 97);
     }
-    
-    @After
-    public void stopServer() throws Exception {
+
+    @AfterClass
+    public static void stopServer() throws Exception {
         if (node != null)
             node.stop();
     }