You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ed...@apache.org on 2008/12/05 10:37:02 UTC

svn commit: r723692 - /tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java

Author: edwardsmj
Date: Fri Dec  5 01:37:00 2008
New Revision: 723692

URL: http://svn.apache.org/viewvc?rev=723692&view=rev
Log:
Updated FileTransferMTOMTestCase to reflect new interfaces for starting Nodes with Contributions

Modified:
    tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java

Modified: tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java?rev=723692&r1=723691&r2=723692&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java (original)
+++ tuscany/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java Fri Dec  5 01:37:00 2008
@@ -23,27 +23,60 @@
 import javax.activation.FileDataSource;
 import junit.framework.TestCase;
 import org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.FileTransferService;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
+// Added imports to new Node / Launcher framework
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.equinox.launcher.Contribution;
+import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
 
+// Removed imports of old host.embedded function
+// import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * 
+ * Modified by Mike Edwards, 4th Dec 2008, to adjust to new interfaces in the 2.0 stream.
+ *
+ */
 public class FileTransferMTOMTestCase extends TestCase {
 
-    private SCADomain domain;
+    // private SCADomain domain;
+    protected NodeLauncher launcher;
+    protected Node node;
 
     public void testFileTransfer() throws Exception {
         // For testing purpose lets try uploading FileTransferClient.java file.
         DataHandler dataHandler = new DataHandler(new FileDataSource("FileTransferClient.java"));
-        FileTransferService filetransfer = domain.getService(FileTransferService.class, "FileTransferServiceComponent");
+        FileTransferService filetransfer = node.getService(FileTransferService.class, "FileTransferServiceComponent");
         assertEquals("File uploaded Sucessfully", filetransfer.uploadFile(dataHandler));
     }
 
     @Override
     protected void setUp() throws Exception {
-        domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite");
+        // domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite");
+    	// Tuscany specific code which starts the contribution holding the test
+        launcher = NodeLauncher.newInstance();
+        node = launcher.createNode( "filetransferservice.composite", // testConfiguration.getComposite(), 
+        		                   new Contribution("FileTransferMTOMTestCase", 
+        		                		            getContributionURI()));
     }
    
     @Override
     protected void tearDown() throws Exception {
-        domain.close();
+        //domain.close();
+        if (node != null) {
+            node.stop();
+            node.destroy();
+        }
+        if (launcher != null) {
+            launcher.destroy();
+        }
     }
+    
+    protected String getContributionURI() {
+    	Class<?> clazz = getClass();
+    	String location = ContributionLocationHelper.getContributionLocation(clazz);
+    	return location;
+    	
+    } // end getContributionURI()
 
 }