You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/07/22 21:01:52 UTC

svn commit: r558528 - in /incubator/tuscany/java/sca/itest/contribution-import-export: test-import-composite/src/test/java/helloworld/ test-import-java/src/test/java/helloworld/ test-import-wsdl/src/test/java/helloworld/

Author: lresende
Date: Sun Jul 22 12:01:49 2007
New Revision: 558528

URL: http://svn.apache.org/viewvc?view=rev&rev=558528
Log:
Properly removing contribution, stopping and closing EmbeddedSCADomain, as this was causing issues running multiple test cases.

Modified:
    incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java
    incubator/tuscany/java/sca/itest/contribution-import-export/test-import-java/src/test/java/helloworld/HelloWorldServerTestCase.java
    incubator/tuscany/java/sca/itest/contribution-import-export/test-import-wsdl/src/test/java/helloworld/HelloWorldServerTestCase.java

Modified: incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java?view=diff&rev=558528&r1=558527&r2=558528
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/contribution-import-export/test-import-composite/src/test/java/helloworld/HelloWorldServerTestCase.java Sun Jul 22 12:01:49 2007
@@ -75,15 +75,25 @@
 		new Socket("127.0.0.1", 8085);
 	}
 
-//    public void testServiceCall() throws IOException {
-//        HelloWorldService helloWorldService = domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
-//        assertNotNull(helloWorldService);
-//        
-//        assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
-//    }
+    public void testServiceCall() throws IOException {
+        HelloWorldService helloWorldService = domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
+        assertNotNull(helloWorldService);
+        
+        assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
+    }
 
     
 	public void tearDown() throws Exception {
+        ContributionService contributionService = domain.getContributionService();
+
+        // Remove the contribution from the in-memory repository
+        contributionService.remove("http://import-export/helloworld");
+        contributionService.remove("http://import-export/contrib-wsdl");
+        
+        //Stop Components from my composite
+        domain.getDomainCompositeHelper().stopComponent(domain.getDomainCompositeHelper().getComponent("HelloWorldServiceComponent"));
+
+        domain.stop();        
             domain.close();
 	}
 

Modified: incubator/tuscany/java/sca/itest/contribution-import-export/test-import-java/src/test/java/helloworld/HelloWorldServerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-java/src/test/java/helloworld/HelloWorldServerTestCase.java?view=diff&rev=558528&r1=558527&r2=558528
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution-import-export/test-import-java/src/test/java/helloworld/HelloWorldServerTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/contribution-import-export/test-import-java/src/test/java/helloworld/HelloWorldServerTestCase.java Sun Jul 22 12:01:49 2007
@@ -20,7 +20,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.net.Socket;
 import java.net.URL;
 
 import junit.framework.TestCase;
@@ -78,9 +77,27 @@
         assertNotNull(helloWorldService);
         assertEquals("Hello test", helloWorldService.getGreetings("test"));
 	}
+    
+    public void testServiceCall() throws IOException {
+        HelloWorldService helloWorldService = domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
+        assertNotNull(helloWorldService);
+        
+        assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
+    }    
 
 	public void tearDown() throws Exception {
-            domain.close();
+        ContributionService contributionService = domain.getContributionService();
+
+        // Remove the contribution from the in-memory repository
+        contributionService.remove("http://import-export/helloworld");
+        contributionService.remove("http://import-export/contrib-wsdl");
+        
+        //Stop Components from my composite
+        domain.getDomainCompositeHelper().stopComponent(domain.getDomainCompositeHelper().getComponent("HelloWorldServiceComponent"));
+
+        domain.stop();
+        
+        domain.close();
 	}
 
 }

Modified: incubator/tuscany/java/sca/itest/contribution-import-export/test-import-wsdl/src/test/java/helloworld/HelloWorldServerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/contribution-import-export/test-import-wsdl/src/test/java/helloworld/HelloWorldServerTestCase.java?view=diff&rev=558528&r1=558527&r2=558528
==============================================================================
--- incubator/tuscany/java/sca/itest/contribution-import-export/test-import-wsdl/src/test/java/helloworld/HelloWorldServerTestCase.java (original)
+++ incubator/tuscany/java/sca/itest/contribution-import-export/test-import-wsdl/src/test/java/helloworld/HelloWorldServerTestCase.java Sun Jul 22 12:01:49 2007
@@ -81,7 +81,18 @@
     }
 
     public void tearDown() throws Exception {
-            domain.close();
-	}
+        ContributionService contributionService = domain.getContributionService();
+
+        // Remove the contribution from the in-memory repository
+        contributionService.remove("http://import-export/helloworld");
+        contributionService.remove("http://import-export/contrib-wsdl");
+        
+        //Stop Components from my composite
+        domain.getDomainCompositeHelper().stopComponent(domain.getDomainCompositeHelper().getComponent("HelloWorldServiceComponent"));
+
+        domain.stop();
+        
+        domain.close();
+    }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org