summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-16 08:44:44 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-16 08:44:44 +0000
commit3d3b8834b93b98cc7d7534e693e937179067eb58 (patch)
tree1c31b939872ea8455118a16009a2abb96179ecf1 /branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom
parent86101a456fb21b25abc09533769805911efd1c7f (diff)
Delete previous 1.5 branch thats now old and unused and will be replaced with the current 1.x trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom')
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java57
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java122
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java46
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceClient.java42
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java57
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyException.java26
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionAdapter.java31
-rw-r--r--branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionImpl.java26
8 files changed, 0 insertions, 407 deletions
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
deleted file mode 100644
index cf5e4947d6..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.activation.DataHandler;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Service;
-import java.awt.Image;
-import org.apache.axiom.om.OMElement;
-import javax.xml.transform.Source;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * locate the FileTransfer service and invoke it.
- */
-@Service(FileTransferServiceClient.class)
-public class FileTransferClient implements FileTransferServiceClient {
-
- @Reference
- public FileTransferService fileTransferService;
-
- public String uploadImageFileForward (Image attachment) throws Exception {
- return fileTransferService.uploadImageFile(attachment);
- }
-
- public String uploadSourceFileForward (Source attachment) throws Exception {
- return fileTransferService.uploadSourceFile(attachment);
- }
-
- public String uploadDataHandlerFileForward (DataHandler attachment) throws Exception {
- return fileTransferService.uploadDataHandlerFile(attachment);
- }
-
- public String uploadOMElementFileForward (OMElement attachment) throws Exception {
- return fileTransferService.uploadOMElementFile(attachment);
- }
-
- public String sendMyExceptionForward (MyException attachment) throws Exception {
- return fileTransferService.sendMyException(attachment);
- }
-}
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
deleted file mode 100644
index 35bf6888e3..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCase.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.activation.DataHandler;
-import javax.activation.FileDataSource;
-import java.awt.Image;
-
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMText;
-import javax.xml.transform.dom.DOMSource;
-import org.apache.axiom.om.OMFactory;
-import java.awt.image.BufferedImage;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.sca.host.embedded.SCADomain;
-import org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.FileTransferServiceClient;
-import org.apache.tuscany.sca.databinding.xml.String2Node;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class FileTransferMTOMTestCase extends TestCase {
-
- private SCADomain domain;
- private FileTransferServiceClient filetransfer;
-
- /**
- * Runs once before the tests
- */
- @BeforeClass
- protected void setUp() throws Exception {
- domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite");
- filetransfer = domain.getService(FileTransferServiceClient.class, "FileTransferClientComponent");
- }
-
- /**
- * Runs once after the tests
- */
- @AfterClass
- protected void tearDown() throws Exception {
- domain.close();
- }
-
- @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();
- }
- }
-
- @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();
- }
- }
-
- @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();
- }
- }
-
- @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();
- }
- }
-
- @Test
- public void testSendMyException() throws Exception {
- try {
- MyException exp = new MyExceptionImpl();
- assertEquals("File uploaded Sucessfully", filetransfer.sendMyExceptionForward(exp));
- } catch (Exception ex){
- ex.printStackTrace();
- }
- }
-}
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
deleted file mode 100644
index ab7fc9c43a..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import org.osoa.sca.annotations.Remotable;
-import javax.activation.DataHandler;
-import java.awt.Image;
-import javax.xml.transform.Source;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import org.apache.axiom.om.OMElement;
-
-/**
- * This is the business interface of the MTOM FileTransfer service.
- */
-@Remotable
-public interface FileTransferService {
-
- public String uploadImageFile(Image attachment) throws Exception;
-
- public String uploadSourceFile(Source attachment) throws Exception;
-
- public String uploadDataHandlerFile(DataHandler attachment) throws Exception;
-
- public String uploadOMElementFile(OMElement attachment) throws Exception;
-
- //This method uses an user defined interface MyException as parameter type.
- public String sendMyException(@XmlJavaTypeAdapter(MyExceptionAdapter.class) MyException attachment)
- throws Exception;
-}
-
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceClient.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceClient.java
deleted file mode 100644
index 5fc95441b0..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceClient.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.activation.DataHandler;
-import java.awt.Image;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.transform.Source;
-import org.apache.axiom.om.OMElement;
-
-/**
- * This is the client interface of the File Transfer service.
- */
-public interface FileTransferServiceClient {
-
- public String uploadImageFileForward (Image attachment) throws Exception;
-
- public String uploadSourceFileForward (Source attachment) throws Exception;
-
- public String uploadDataHandlerFileForward (DataHandler attachment) throws Exception;
-
- public String uploadOMElementFileForward (OMElement attachment) throws Exception;
-
- public String sendMyExceptionForward (MyException attachment) throws Exception;
-}
-
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
deleted file mode 100644
index cc757e5e33..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import org.osoa.sca.annotations.Service;
-import javax.activation.DataHandler;
-import java.awt.Image;
-import javax.xml.transform.Source;
-import org.apache.axiom.om.OMElement;
-
-/**
- * This class implements the HelloWorld service.
- */
-@Service(interfaces={FileTransferService.class})
-public class FileTransferServiceImpl implements FileTransferService {
-
- public String uploadImageFile(Image attachment) throws Exception {
- System.out.println("Content type = " + attachment.toString());
- return "File uploaded Sucessfully";
- }
-
- public String uploadSourceFile(Source attachment) throws Exception {
- System.out.println("Content type = " + attachment.toString());
- return "File uploaded Sucessfully";
- }
-
- public String uploadDataHandlerFile(DataHandler attachment) throws Exception {
- System.out.println("Content type = " + attachment.toString());
- return "File uploaded Sucessfully";
- }
-
- public String uploadOMElementFile(OMElement attachment) throws Exception {
- System.out.println("Content type = " + attachment.toString());
- return "File uploaded Sucessfully";
- }
-
- public String sendMyException(MyException attachment) throws Exception {
- System.out.println("Content type = " + attachment.toString());
- return "File uploaded Sucessfully";
- }
-}
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyException.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyException.java
deleted file mode 100644
index 5ecc22572b..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-//@XmlJavaTypeAdapter(MyExceptionAdapter.class)
-public interface MyException {
-
- public String getMessage();
-
-}
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionAdapter.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionAdapter.java
deleted file mode 100644
index 4c4e8a3fcf..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionAdapter.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-public class MyExceptionAdapter extends XmlAdapter<MyExceptionImpl, MyException> {
- public MyException unmarshal(MyExceptionImpl v) {
- return v;
- }
-
- public MyExceptionImpl marshal(MyException v) {
- return (MyExceptionImpl)v;
- }
-}
diff --git a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionImpl.java b/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionImpl.java
deleted file mode 100644
index 1bd9b9b1a0..0000000000
--- a/branches/sca-java-1.5/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/MyExceptionImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-public class MyExceptionImpl extends Exception implements MyException {
-
- public String getMessage() {
- return "good job......";
- }
-}