diff options
Diffstat (limited to '')
17 files changed, 0 insertions, 1212 deletions
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/pom.xml b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/pom.xml deleted file mode 100644 index 25216d3cbd..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<!-- - A set of tests dealing with Asynchronous services ---> -<project> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-itest</artifactId> - <version>2.0-Beta2</version> - <relativePath>../pom.xml</relativePath> - </parent> - <artifactId>itest-async-services</artifactId> - <name>Apache Tuscany SCA iTest Asynchronous Services</name> - - <dependencies> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-base-runtime-pom</artifactId> - <type>pom</type> - <version>2.0-Beta2</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-ws-runtime-axis2</artifactId> - <version>2.0-Beta2</version> - </dependency> - - <dependency> - <groupId>org.apache.tuscany.sca</groupId> - <artifactId>tuscany-binding-jms-runtime</artifactId> - <version>2.0-Beta2</version> - </dependency> - - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty</artifactId> - <version>6.1.19</version> - </dependency> - - </dependencies> -</project> diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/ASM_0002_Client.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/ASM_0002_Client.java deleted file mode 100644 index 2fb9c069ad..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/ASM_0002_Client.java +++ /dev/null @@ -1,89 +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.itest; - -import org.oasisopen.sca.annotation.Service; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Property; -import org.apache.tuscany.sca.itest.Service1; -import org.apache.tuscany.sca.itest.TestException; -import org.apache.tuscany.sca.itest.TestInvocation; - - -/** - * Test initiation class with a single reference of multiplicity 1..1 - * @author MikeEdwards - * - */ -@Service(TestInvocation.class) -public class ASM_0002_Client implements org.apache.tuscany.sca.itest.TestInvocation { - - @Property - public String testName = "ASM_xxxx"; - - // required=false implies a multiplicity of 0..1 so that this component need not be wired - @Reference(required=false) - public Service1 reference1; - - /** - * This method is offered as a service and is - * invoked by the test client to run the test - */ - public String invokeTest( String input ) throws TestException { - String response = null; - - try { - response = runTest( input ); - } catch( Exception e ) { - System.out.println("TestInvocation: Test service got an exception during execution:" + e.getClass().getName()+ " " + e.getMessage() ); - e.printStackTrace(); - throw new TestException("Test service got an exception during execution: " + e.getClass().getName()+ " " + e.getMessage() ); - } // end try - return response; - } // end method invokeTest - - /** - * This method actually runs the test - and is subclassed by classes that run other tests. - * @param input - an input string - * @return - a response string = "ASM_0001 inputString xxxxx" where xxxxx depends on the invoked service - * - */ - public String runTest( String input ){ - String response = null; - // Deals with cases where this component reference is not wired - if( reference1 != null ) { - String response1 = reference1.operation1(input); - - response = testName + " " + input + " " + response1; - } else { - response = testName + " " + input + " no invocation"; - } // end if - - return response; - } // end method runTest - - /** - * Sets the name of the test - * @param name - the test name - */ - protected void setTestName( String name ) { - testName = name; - } - -} // diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault1.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault1.java deleted file mode 100644 index 01446c88e5..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault1.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.itest; - -/** - * A business exception - * - */ -public class BusinessFault1 extends Exception { - - // Serialization UID - private static final long serialVersionUID = 44240525335368929L; - - public BusinessFault1() { - super(); - } - - public BusinessFault1(String arg0) { - super(arg0); - } - - public BusinessFault1(Throwable arg0) { - super(arg0); - } - - public BusinessFault1(String arg0, Throwable arg1) { - super(arg0, arg1); - } - -} // end class BusinessFault1 diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault2.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault2.java deleted file mode 100644 index 7f9d965820..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault2.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.itest; - -/** - * A business exception - * - */ -public class BusinessFault2 extends Exception { - - // Serialization UID - private static final long serialVersionUID = 44240525335368929L; - - public BusinessFault2() { - super(); - } - - public BusinessFault2(String arg0) { - super(arg0); - } - - public BusinessFault2(Throwable arg0) { - super(arg0); - } - - public BusinessFault2(String arg0, Throwable arg1) { - super(arg0, arg1); - } - -} // end class BusinessFault1 diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1.java deleted file mode 100644 index 84ba75e0e2..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1.java +++ /dev/null @@ -1,38 +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.itest; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * A test service interface - * @author MikeEdwards - * - */ -@Remotable -public interface Service1 { - - /** - * Method for invoking testcase service - * @param input - input parameter(s) as a String - * @return - output data as a String - */ - public String operation1( String input ); - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServer.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServer.java deleted file mode 100644 index 1500cbdb07..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServer.java +++ /dev/null @@ -1,50 +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.itest; - -import org.oasisopen.sca.ResponseDispatch; -import org.oasisopen.sca.annotation.AsyncFault; -import org.oasisopen.sca.annotation.AsyncInvocation; -import org.oasisopen.sca.annotation.Remotable; - -/** - * Service1 service interface - * - Asynchronous server version - */ -@AsyncInvocation -@Remotable -public interface Service1AsyncServer { - - /** - * Synchronous method for invoking testcase service - * @param input - input parameter as a String - * @return - output data as a String - * Listed here for documentation purposes - this is the operation that the async server operation maps to - */ - // public String operation1( String input ); - - /** - * Async server version of the synchronous operation1 method - * @param input - input parameter as a String - * @param handler - the ResponseDispatch<String> handler used to send the response message (a String in this case) - */ - @AsyncFault( {BusinessFault1.class, BusinessFault2.class} ) - public void operation1Async( String input, ResponseDispatch<String> handler ); - -} // end interface Service1AsyncServer diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl.java deleted file mode 100644 index e4e17ca860..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl.java +++ /dev/null @@ -1,180 +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.itest; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.oasisopen.sca.ResponseDispatch; -import org.oasisopen.sca.ServiceUnavailableException; -import org.oasisopen.sca.annotation.*; - - -/** - * Java component implementation - * 1 service with interface Service1AsyncServer - * 0 references - * - * Async server implementation of the Service1 service - * - */ -@Service(Service1AsyncServer.class) -public class Service1AsyncServerImpl implements Service1AsyncServer { - - private volatile ResponseDispatch<String> responseHandler = null; - - private volatile String tmpFilePath = null; - - @Property(required=true) - public volatile String serviceName = "service1"; - - /* - public String operation1(String input) { - return serviceName + " operation1 invoked"; - } - */ - - public void operation1Async(String input, ResponseDispatch<String> handler) { - // Store the ResponseDispatch object - responseHandler = handler; - - serializeResponseHandler(responseHandler); - - // Now kick off processing on a separate thread that will dispatch the response some time after this - // initial method returns... - runResponseThread( input ); - - // return - return; - } // end method operation1Async - - /** - * Serialize the response handler to a file - * @param responseHandler2 - */ - private void serializeResponseHandler( - ResponseDispatch<String> responseHandler2) { - if( responseHandler2 instanceof Serializable ) { - Serializable obj = (Serializable)responseHandler2; - FileOutputStream fos; - try { - File tmpFile = File.createTempFile("Async_Server", null); - tmpFilePath = tmpFile.getCanonicalPath(); - fos = new FileOutputStream(tmpFile); - ObjectOutputStream oos = new ObjectOutputStream(fos); - - oos.writeObject(obj); - - oos.close(); - } catch (FileNotFoundException e) { - } catch (IOException e) { - e.printStackTrace(); - } // end try - - } // end if - } // end method serializeResponseHandler - - @SuppressWarnings("unchecked") - public ResponseDispatch<String> deserializeResponseHandler() { - try { - if( tmpFilePath == null ) return null; - FileInputStream fis = new FileInputStream( tmpFilePath ); - ObjectInputStream ois = new ObjectInputStream(fis); - - ResponseDispatch<String> responseDispatch = (ResponseDispatch<String>) ois.readObject(); - - ois.close(); - return responseDispatch; - } catch (Exception e) { - e.printStackTrace(); - } // end try - - return null; - } // end method deserializeResponseHandler - - /** - * Method used to run a separate thread, to invoke the ResponseDispatch - */ - private void runResponseThread( String input ) { - - int invocationCount = 2; // # of threads to use - long maxWaitTime = 5000; // Max wait time for completion = 5sec - - // Run the tests using a ThreadPoolExecutor - ThreadPoolExecutor theExecutor = new ThreadPoolExecutor( invocationCount, invocationCount, - maxWaitTime, TimeUnit.MILLISECONDS, - new ArrayBlockingQueue<Runnable>( invocationCount ) ); - - - - // Perform the invocations on separate thread... - theExecutor.execute( new separateThreadInvoker( input ) ); - - } // end method runResponseThread - - /** - * An inner class which acts as a runnable task for invoking APIs on threads that are not processing - * either a service operation or a callback operation - */ - private class separateThreadInvoker implements Runnable { - - private long pauseTime = 1000; // Pause interval to allow initiating thread to complete - private String input; // Input parameter - - public separateThreadInvoker( String input ) { - super(); - this.input = input; - } // end constructor - - public void run() { - - // Wait for a short time to ensure that the invoking thread has time to return - try { - Thread.sleep(pauseTime); - } catch (InterruptedException e) { - // Nothing to do here... - } // end try - - ResponseDispatch<String> responseHandler2 = deserializeResponseHandler(); - if( responseHandler2 != null ) { - responseHandler = responseHandler2; - } // end if - - if( "exception".equals(input) ) { - // Invoke the response dispatch object to return a an exception - responseHandler.sendFault( new BusinessFault1(serviceName + " operation1 invoked asynchronously")); - - } else { - // Invoke the response dispatch object to return a response - responseHandler.sendResponse( serviceName + " operation1 invoked asynchronously"); - } // end if - } // end method run - - } // end class separateThreadInvoker - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestException.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestException.java deleted file mode 100644 index 1de688dfcd..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestException.java +++ /dev/null @@ -1,39 +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.itest; - -/* - * Exception thrown by SCA Test services - */ -public class TestException extends Exception { - - /** - * Required serialVersionUID field - */ - private static final long serialVersionUID = -6978058912756564824L; - - public TestException() { super(); }; - - public TestException( String msg ) { super( msg ); }; - - public TestException( String msg, Throwable cause ) { super( msg, cause); }; - - public TestException( Throwable cause ) { super( cause ); }; - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestInvocation.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestInvocation.java deleted file mode 100644 index 5b624d4712..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestInvocation.java +++ /dev/null @@ -1,44 +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.itest; - -import javax.jws.WebMethod; -import org.oasisopen.sca.annotation.Remotable; -import org.apache.tuscany.sca.itest.TestException; - - -/** - * Basic interface to invoke testcases - * 1 operation - * - "invokeTest", string input, string output - * - */ -@Remotable -public interface TestInvocation { - - /** - * Method for invoking testcase - * @param input - input parameter(s) as a String - * @return - output data as a String - * @throws - a TestException is thrown in cases where the test service fails internally - */ - @WebMethod - public String invokeTest( String input ) throws TestException ; - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/TestClient.wsdl b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/TestClient.wsdl deleted file mode 100644 index 92cabda65d..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/TestClient.wsdl +++ /dev/null @@ -1,127 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<!-- Produced from the TestInvocation.java interface by running a service - based on that interface in an SCA runtime using a Web services binding - - Mike Edwards, 6th January 2008 ---> -<wsdl:definitions name="TestInvocationService" - targetNamespace="http://test.sca.oasisopen.org/" - xmlns:tns="http://test.sca.oasisopen.org/" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:xs="http://www.w3.org/2001/XMLSchema" - xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/" - xmlns:SOAP12="http://schemas.xmlsoap.org/wsdl/soap12/"> - <wsdl:types> - <xs:schema targetNamespace="http://test.sca.oasisopen.org/" version="1.0" - xmlns:tns="http://test.sca.oasisopen.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="TestException" type="tns:TestException"/> - <xs:complexType name="TestException"> - <xs:sequence> - <xs:element minOccurs="0" name="message" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:schema> - <xs:schema attributeFormDefault="qualified" elementFormDefault="unqualified" - targetNamespace="http://test.sca.oasisopen.org/" - xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="invokeTest"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="invokeTestResponse"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:schema> - </wsdl:types> - <wsdl:message name="invokeTest"> - <wsdl:part name="parameters" element="tns:invokeTest"> - </wsdl:part> - </wsdl:message> - <wsdl:message name="invokeTestResponse"> - <wsdl:part name="parameters" element="tns:invokeTestResponse"> - </wsdl:part> - </wsdl:message> - <wsdl:message name="TestException"> - <wsdl:part name="TestException" element="tns:TestException"> - </wsdl:part> - </wsdl:message> - <wsdl:portType name="TestInvocation"> - <wsdl:operation name="invokeTest"> - <wsdl:input message="tns:invokeTest"> - </wsdl:input> - <wsdl:output message="tns:invokeTestResponse"> - </wsdl:output> - <wsdl:fault name="TestException" message="tns:TestException"> - </wsdl:fault> - </wsdl:operation> - </wsdl:portType> - <!-- Binding for Service1 that uses SOAP v1.1 protocol --> - <wsdl:binding name="TestInvocationBinding" type="tns:TestInvocation"> - <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="invokeTest"> - <SOAP:operation soapAction=""/> - <wsdl:input> - <SOAP:body use="literal"/> - </wsdl:input> - <wsdl:output> - <SOAP:body use="literal"/> - </wsdl:output> - <wsdl:fault name="TestException"> - <SOAP:fault name="TestException" use="literal"/> - </wsdl:fault> - </wsdl:operation> - </wsdl:binding> - <!-- Binding for Service1 that uses SOAP v1.2 protocol --> - <wsdl:binding name="TestInvocationBindingSOAP12" type="tns:TestInvocation"> - <SOAP12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> - <wsdl:operation name="invokeTest"> - <SOAP12:operation soapAction=""/> - <wsdl:input> - <SOAP12:body use="literal"/> - </wsdl:input> - <wsdl:output> - <SOAP12:body use="literal"/> - </wsdl:output> - <wsdl:fault name="TestException"> - <SOAP12:fault name="TestException" use="literal"/> - </wsdl:fault> - </wsdl:operation> - </wsdl:binding> - - <wsdl:service name="TestInvocationService"> - <wsdl:port name="TestInvocationPort" binding="tns:TestInvocationBinding"> - <SOAP:address location="http://localhost:8080/TestClient/TestInvocation"/> - </wsdl:port> - </wsdl:service> - <wsdl:service name="TestInvocationServiceSOAP12"> - <wsdl:port name="TestInvocationPortSOAP12" binding="tns:TestInvocationBindingSOAP12"> - <SOAP12:address location="http://localhost:8080/TestClient/TestInvocation"/> - </wsdl:port> - </wsdl:service> -</wsdl:definitions> diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/TestInvocation.wsdl b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/TestInvocation.wsdl deleted file mode 100644 index a1030a4881..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/TestInvocation.wsdl +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. - * - * WSDL version of the client TestInvocation interface ---> -<wsdl:definitions name="TestInvocationService" - targetNamespace="http://test.sca.oasisopen.org/" - xmlns:tns="http://test.sca.oasisopen.org/" - xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" - xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <wsdl:types> - <xs:schema - targetNamespace="http://test.sca.oasisopen.org/" version="1.0" - xmlns:tns="http://test.sca.oasisopen.org/" - xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="TestException" type="tns:TestException"/> - <xs:complexType name="TestException"> - <xs:sequence> - <xs:element minOccurs="0" name="message" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:schema> - <xs:schema attributeFormDefault="qualified" - elementFormDefault="unqualified" - targetNamespace="http://test.sca.oasisopen.org/" - xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="invokeTest"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" name="arg0" nillable="true" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="invokeTestResponse"> - <xs:complexType> - <xs:sequence> - <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:schema> - </wsdl:types> - <wsdl:message name="invokeTest"> - <wsdl:part name="invokeTest" element="tns:invokeTest"> - </wsdl:part> - </wsdl:message> - <wsdl:message name="invokeTestResponse"> - <wsdl:part name="parameters" element="tns:invokeTestResponse"> - </wsdl:part> - </wsdl:message> - <wsdl:message name="TestException"> - <wsdl:part name="TestException" element="tns:TestException"> - </wsdl:part> - </wsdl:message> - <wsdl:portType name="TestInvocation"> - <wsdl:operation name="invokeTest"> - <wsdl:input message="tns:invokeTest"> - </wsdl:input> - <wsdl:output message="tns:invokeTestResponse"> - </wsdl:output> - <wsdl:fault name="TestException" message="tns:TestException"> - </wsdl:fault> - </wsdl:operation> - </wsdl:portType> -</wsdl:definitions>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_001.composite b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_001.composite deleted file mode 100644 index 5c51f4a7b6..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_001.composite +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<!-- - Async test 001 - Tests that an async service can be invoked over the SCA binding - - the async service: - a) returns the response from a different thread than the one that receives the service request - b) serializes the ResponseDispatch object between the request thread and the response thread ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" - targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903" - xmlns:test="http://docs.oasis-open.org/ns/opencsa/scatests/200903" - name="TEST_Async_001"> - - <component name="TestClient"> - <implementation.java class="org.apache.tuscany.sca.itest.ASM_0002_Client"/> - <service name="TestInvocation"> - <interface.java interface="org.apache.tuscany.sca.itest.TestInvocation"/> - <binding.ws/> - </service> - <reference name="reference1" target="Async_001Component1/Service1AsyncServer" /> - <property name="testName">Async_001</property> - </component> - - <component name="Async_001Component1"> - <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl"/> - <service name="Service1AsyncServer"> - <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/> - <binding.jms/> - </service> - <property name="serviceName">service1</property> - </component> - -</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_002.composite b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_002.composite deleted file mode 100644 index 1eee9501d6..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_002.composite +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<!-- - Async test 002 - Tests that an async service can be invoked over the SCA binding - - the async service: - a) returns the response from a different thread than the one that receives the service request - b) serializes the ResponseDispatch object between the request thread and the response thread ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" - targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903" - xmlns:test="http://docs.oasis-open.org/ns/opencsa/scatests/200903" - name="TEST_Async_002"> - - <component name="TestClient"> - <implementation.java class="org.apache.tuscany.sca.itest.ASM_0002_Client"/> - <service name="TestInvocation"> - <interface.java interface="org.apache.tuscany.sca.itest.TestInvocation"/> - <binding.ws/> - </service> - <reference name="reference1" target="Async_002Component1/Service1AsyncServer" /> - <property name="testName">Async_002</property> - </component> - - <component name="Async_002Component1"> - <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl"/> - <service name="Service1AsyncServer"> - <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/> - <binding.sca/> - </service> - <property name="serviceName">service1</property> - </component> - -</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_003.composite b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_003.composite deleted file mode 100644 index ae56034ccf..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/main/resources/Test_Async_003.composite +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * 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. ---> -<!-- - Async test 003 - Tests that an async service can be invoked over the Web services binding - - the async service: - a) returns the response from a different thread than the one that receives the service request - b) serializes the ResponseDispatch object between the request thread and the response thread ---> -<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" - targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903" - xmlns:test="http://docs.oasis-open.org/ns/opencsa/scatests/200903" - name="TEST_Async_003"> - - <component name="TestClient"> - <implementation.java class="org.apache.tuscany.sca.itest.ASM_0002_Client"/> - <service name="TestInvocation"> - <interface.java interface="org.apache.tuscany.sca.itest.TestInvocation"/> - <binding.ws/> - </service> - <reference name="reference1" target="Async_003Component1/Service1AsyncServer" /> - <property name="testName">Async_003</property> - </component> - - <component name="Async_003Component1"> - <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl"/> - <service name="Service1AsyncServer"> - <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/> - <binding.ws/> - </service> - <property name="serviceName">service1</property> - </component> - -</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_001_TestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_001_TestCase.java deleted file mode 100644 index 27ff4da34b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_001_TestCase.java +++ /dev/null @@ -1,87 +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.itest; - -import static org.junit.Assert.assertEquals; - -//import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -//import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; - -import org.apache.tuscany.sca.itest.TestInvocation; - -/** - * Client for Async_001_TestCase - * Async service invocation test #001 - * Tests that an async service can be invoked over the JMS Binding - */ -public class Async_001_TestCase { - - //protected NodeLauncher launcher; - protected Node node; - - private String testName = this.getClass().getSimpleName().substring(0, 9); - private String input = "request"; - private String[] output = new String[] { "Async_001 request service1 operation1 invoked asynchronously" }; - private String composite = "Test_" + testName + ".composite"; - private String[] contributionNames = new String[] { "Async_001" }; - - @Before - public void setUp() throws Exception { - - final NodeFactory nf = NodeFactory.newInstance(); - String here = ASM_0002_Client.class.getProtectionDomain().getCodeSource().getLocation().toString(); - // Create the node using the pattern "name of composite file to start" / Contribution to use - node = nf.createNode(this.composite, new Contribution("test", here)); - - node.start(); - } - - @After - public void tearDown() throws Exception { - node.stop(); - } - - @Test - public void testReference() { - TestInvocation test = node.getService(TestInvocation.class, "TestClient/TestInvocation"); - try { - final String response = test.invokeTest(this.input); - System.out.println(response); - assertEquals(this.output[0], response); - } catch (Throwable t) { - assertEquals("exception", this.output[0]); - } // end try - } // end testReference - - /** - * Dummy method to ensure that things work with JUnit 3 eg within Eclipse Ganymede - */ - @Ignore - @Test - public void testFoo() throws Exception { - } - -} // end class Async_001_TestCase diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_002_TestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_002_TestCase.java deleted file mode 100644 index d18b8d3b73..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_002_TestCase.java +++ /dev/null @@ -1,85 +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.itest; - -import static org.junit.Assert.assertEquals; - -//import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -//import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; - -import org.apache.tuscany.sca.itest.TestInvocation; - -/** - * Client for Async_002_TestCase - * Async service invocation test #001 - * Tests that an async service can be invoked over the SCA Binding - */ -public class Async_002_TestCase { - - //protected NodeLauncher launcher; - protected Node node; - - private String input = "request"; - private String[] output = new String[] { "Async_002 request service1 operation1 invoked asynchronously" }; - private String composite = "Test_Async_002.composite"; - - @Before - public void setUp() throws Exception { - - final NodeFactory nf = NodeFactory.newInstance(); - String here = ASM_0002_Client.class.getProtectionDomain().getCodeSource().getLocation().toString(); - // Create the node using the pattern "name of composite file to start" / Contribution to use - node = nf.createNode(this.composite, new Contribution("test", here)); - - node.start(); - } - - @After - public void tearDown() throws Exception { - node.stop(); - } - - @Test - public void testReference() { - TestInvocation test = node.getService(TestInvocation.class, "TestClient/TestInvocation"); - try { - final String response = test.invokeTest(this.input); - System.out.println(response); - assertEquals(this.output[0], response); - } catch (Throwable t) { - assertEquals("exception", this.output[0]); - } // end try - } // end testReference - - /** - * Dummy method to ensure that things work with JUnit 3 eg within Eclipse Ganymede - */ - @Ignore - @Test - public void testFoo() throws Exception { - } - -} // end class Async_001_TestCase diff --git a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_003_TestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_003_TestCase.java deleted file mode 100644 index fafe522da8..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC2/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_003_TestCase.java +++ /dev/null @@ -1,85 +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.itest; - -import static org.junit.Assert.assertEquals; - -//import org.apache.tuscany.sca.node.equinox.launcher.Contribution; -//import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.Ignore; - -import org.apache.tuscany.sca.itest.TestInvocation; - -/** - * Client for Async_003_TestCase - * Async service invocation test #003 - * Tests that an async service can be invoked over the Web services Binding - */ -public class Async_003_TestCase { - - //protected NodeLauncher launcher; - protected Node node; - - private String input = "request"; - private String[] output = new String[] { "Async_003 request service1 operation1 invoked asynchronously" }; - private String composite = "Test_Async_003.composite"; - - @Before - public void setUp() throws Exception { - - final NodeFactory nf = NodeFactory.newInstance(); - String here = ASM_0002_Client.class.getProtectionDomain().getCodeSource().getLocation().toString(); - // Create the node using the pattern "name of composite file to start" / Contribution to use - node = nf.createNode(this.composite, new Contribution("test", here)); - - node.start(); - } - - @After - public void tearDown() throws Exception { - node.stop(); - } - - @Test - public void testReference() { - TestInvocation test = node.getService(TestInvocation.class, "TestClient/TestInvocation"); - try { - final String response = test.invokeTest(this.input); - System.out.println(response); - assertEquals(this.output[0], response); - } catch (Throwable t) { - assertEquals("exception", this.output[0]); - } // end try - } // end testReference - - /** - * Dummy method to ensure that things work with JUnit 3 eg within Eclipse Ganymede - */ - @Ignore - @Test - public void testFoo() throws Exception { - } - -} // end class Async_001_TestCase |