summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-ws-axis2/src/test/java
diff options
context:
space:
mode:
authoredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2008-12-05 09:37:00 +0000
committeredwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68>2008-12-05 09:37:00 +0000
commitc6223c6711073e0ff9d0500feac15971416b75d8 (patch)
tree6d980d5cdd949ee90304b0f971b16904a1a2cafd /java/sca/modules/binding-ws-axis2/src/test/java
parent73edd945c4222e07e79df6e471fedb385c966ea4 (diff)
Updated FileTransferMTOMTestCase to reflect new interfaces for starting Nodes with Contributions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@723692 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-ws-axis2/src/test/java')
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java43
1 files changed, 38 insertions, 5 deletions
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
index e592134037..d551560ff9 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
@@ -23,27 +23,60 @@ import javax.activation.DataHandler;
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()
}