diff options
Diffstat (limited to 'branches/sca-java-1.x/modules')
3 files changed, 15 insertions, 11 deletions
diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java index e592134037..69b3b60ea7 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java @@ -30,10 +30,15 @@ public class FileTransferMTOMTestCase extends TestCase { private SCADomain domain;
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");
- assertEquals("File uploaded Sucessfully", filetransfer.uploadFile(dataHandler));
+ try {
+ // For testing purpose lets try uploading FileTransferClient.java file.
+ DataHandler dataHandler = new DataHandler(new FileDataSource("./LICENSE"));
+ FileTransferService filetransfer = domain.getService(FileTransferService.class, "FileTransferClientComponent");
+ //dataHandler.writeTo(System.out);
+ assertEquals("File uploaded Sucessfully", filetransfer.uploadFile(dataHandler));
+ } catch (Exception ex){
+ ex.printStackTrace();
+ }
}
@Override
diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java index 8d4a020560..51e31e9f95 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java @@ -43,7 +43,8 @@ public class FileTransferServiceImpl implements FileTransferService { fileOutputStream.flush();
fileOutputStream.close();*/
- System.out.println(attachment.getContentType());
+ System.out.println("Content type = " + attachment.getContentType() + "\nContent = ");
+ //attachment.writeTo(System.out);
return "File uploaded Sucessfully";
}
diff --git a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite index 03a16d9433..0edea98cf9 100644 --- a/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite +++ b/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite @@ -26,17 +26,15 @@ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.FileTransferServiceImpl" />
<service name="FileTransferService">
<interface.wsdl interface="http://filetransfer#wsdl.interface(FileTransfer)" />
- <binding.ws uri="http://localhost:8085/FileTransferService"/>
+ <binding.ws uri="http://localhost:8085/FileTransferService" requires="MTOM"/>
</service>
</component>
<component name="FileTransferClientComponent">
<implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.FileTransferClient"/>
- <reference name="fileTransferWS" />
+ <reference name="fileTransferWS">
+ <binding.ws uri="http://localhost:8085/FileTransferService" requires="MTOM"/>
+ </reference>
</component>
- <reference name="fileTransferWS" promote="FileTransferClientComponent/fileTransferWS">
- <binding.ws uri="http://localhost:8085/FileTransferService"/>
- </reference>
-
</composite>
|