summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-12-01 21:08:32 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2010-12-01 21:08:32 +0000
commit9a7ae0ac2779abd384017f7622b6f21b127cfd93 (patch)
tree5a800946a225ab361756b9096fd2685506c6b8cb
parentb5183938ecb94be45e21c37cb7b7f6b940fa31f5 (diff)
TUSCANY-3802: Throw test exceptions back to JUnit
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1041170 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-1.x/trunk/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java56
1 files changed, 18 insertions, 38 deletions
diff --git a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
index 35bf6888e3..1291e2160b 100644
--- a/sca-java-1.x/trunk/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
+++ b/sca-java-1.x/trunk/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
@@ -64,59 +64,39 @@ public class FileTransferMTOMTestCase extends TestCase {
@Test
public void testImageFileTransfer() throws Exception {
- try {
- Image image = new BufferedImage(80, 24, BufferedImage.TYPE_INT_RGB);
- assertEquals("File uploaded Sucessfully", filetransfer.uploadImageFileForward(image));
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ Image image = new BufferedImage(80, 24, BufferedImage.TYPE_INT_RGB);
+ assertEquals("File uploaded Sucessfully", filetransfer.uploadImageFileForward(image));
}
@Test
public void testSourceFileTransfer() throws Exception {
- try {
- String xml = "<a>A<b>B</b><c>C</c></a>";
- Source source = new DOMSource(new String2Node().transform(xml, null));
- assertEquals("File uploaded Sucessfully", filetransfer.uploadSourceFileForward(source));
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ String xml = "<a>A<b>B</b><c>C</c></a>";
+ Source source = new DOMSource(new String2Node().transform(xml, null));
+ assertEquals("File uploaded Sucessfully", filetransfer.uploadSourceFileForward(source));
}
@Test
public void testDataHandlerFileTransfer() throws Exception {
- try {
- // For testing purpose lets try uploading LICENSE file.
- DataHandler dataHandler = new DataHandler(new FileDataSource("./LICENSE"));
- assertEquals("File uploaded Sucessfully", filetransfer.uploadDataHandlerFileForward(dataHandler));
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ // For testing purpose lets try uploading LICENSE file.
+ DataHandler dataHandler = new DataHandler(new FileDataSource("./LICENSE"));
+ assertEquals("File uploaded Sucessfully", filetransfer.uploadDataHandlerFileForward(dataHandler));
}
@Test
public void testOMElementFileTransfer() throws Exception {
- try {
- OMFactory factory = OMAbstractFactory.getOMFactory();
- OMElement imageElement = factory.createOMElement(new QName("image"));
-
- DataHandler dataHandler = new DataHandler(new FileDataSource("./LICENSE"));
-
- OMText textData = factory.createOMText(dataHandler, true);
- imageElement.addChild(textData);
- assertEquals("File uploaded Sucessfully", filetransfer.uploadOMElementFileForward(imageElement));
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMElement imageElement = factory.createOMElement(new QName("image"));
+
+ DataHandler dataHandler = new DataHandler(new FileDataSource("./LICENSE"));
+
+ OMText textData = factory.createOMText(dataHandler, true);
+ imageElement.addChild(textData);
+ assertEquals("File uploaded Sucessfully", filetransfer.uploadOMElementFileForward(imageElement));
}
@Test
public void testSendMyException() throws Exception {
- try {
- MyException exp = new MyExceptionImpl();
- assertEquals("File uploaded Sucessfully", filetransfer.sendMyExceptionForward(exp));
- } catch (Exception ex){
- ex.printStackTrace();
- }
+ MyException exp = new MyExceptionImpl();
+ assertEquals("File uploaded Sucessfully", filetransfer.sendMyExceptionForward(exp));
}
}