diff options
Diffstat (limited to 'sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services')
49 files changed, 2678 insertions, 0 deletions
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/pom.xml b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/pom.xml new file mode 100644 index 0000000000..40281101f5 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/pom.xml @@ -0,0 +1,78 @@ +<?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.1</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.1</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-ws-runtime-axis2</artifactId> + <version>2.0.1</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jms-runtime</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jms-runtime-activemq</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>activemq-core</artifactId> + <version>5.2.0</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-domain-hazelcast</artifactId> + <version>2.0.1</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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/ASM_0002_Client.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/ASM_0002_Client.java new file mode 100644 index 0000000000..2fb9c069ad --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/ASM_0002_Client.java @@ -0,0 +1,89 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault1.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault1.java new file mode 100644 index 0000000000..01446c88e5 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault1.java @@ -0,0 +1,46 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault2.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault2.java new file mode 100644 index 0000000000..7f9d965820 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/BusinessFault2.java @@ -0,0 +1,46 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1.java new file mode 100644 index 0000000000..84ba75e0e2 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1.java @@ -0,0 +1,38 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncClient.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncClient.java new file mode 100644 index 0000000000..5b76af2e8f --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncClient.java @@ -0,0 +1,33 @@ +/*
+ * 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.util.concurrent.Future;
+
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Service1AsyncClient extends Service1 {
+ Response<String> operation1Async(String input);
+ Future<?> operation1Async(String input, AsyncHandler<String> handler);
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServer.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServer.java new file mode 100644 index 0000000000..1500cbdb07 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServer.java @@ -0,0 +1,50 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl.java new file mode 100644 index 0000000000..e4e17ca860 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl.java @@ -0,0 +1,180 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl2.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl2.java new file mode 100644 index 0000000000..1f653ed8a8 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1AsyncServerImpl2.java @@ -0,0 +1,31 @@ +/*
+ * 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;
+
+public class Service1AsyncServerImpl2 implements Service1AsyncServer {
+
+ @Override
+ public void operation1Async(String input, ResponseDispatch<String> handler) {
+ handler.sendResponse("Service1AsyncServerImpl2.operation1Async " + input);
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1ClientImpl.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1ClientImpl.java new file mode 100644 index 0000000000..d45acdcde9 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1ClientImpl.java @@ -0,0 +1,99 @@ +/*
+ * 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.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.oasisopen.sca.annotation.Reference;
+
+public class Service1ClientImpl implements Service1 {
+
+ @Reference
+ Service1AsyncClient service1;
+
+ Object threeMutex = new Object();
+ String threeResp;
+ Throwable threeEx;
+
+ @Override
+ public String operation1(String input) {
+
+ String resp = "";
+ resp += service1.operation1(input);
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ resp += invokeAsyncType1(input);
+ resp += invokeAsyncType2(input);
+ return resp;
+ }
+
+ private String invokeAsyncType1(String input) {
+ // two
+ Response<String> h = service1.operation1Async(input+"TypeOne");
+ try {
+ return h.get();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private String invokeAsyncType2(String input) {
+ // three
+ System.out.println("invokeAsyncType2 entry");
+ AsyncHandler<String> ah = new AsyncHandler<String>() {
+ @Override
+ public void handleResponse(Response<String> res) {
+ try {
+ System.out.println("invokeAsyncType2 callback handler invoked");
+ threeResp = res.get();
+ } catch (Throwable e) {
+ threeEx = e;
+ }
+ synchronized (threeMutex) {
+ threeMutex.notifyAll();
+ }
+ }
+ };
+ service1.operation1Async(input+"TypeTwo",ah);
+ if (threeResp == null && threeEx == null) {
+ synchronized (threeMutex) {
+ if (threeResp == null && threeEx == null) {
+ try {
+ threeMutex.wait(15000);
+ System.out.println("invokeAsyncType2 mutex notified or wait expired");
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+ }
+
+ if (threeResp == null && threeEx == null) {
+ throw new RuntimeException("no response recieved");
+ }
+ if (threeEx != null) {
+ throw new RuntimeException("got exception", threeEx);
+ }
+ return threeResp;
+ }
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1NonAsyncServer.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1NonAsyncServer.java new file mode 100644 index 0000000000..daafd10ec6 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1NonAsyncServer.java @@ -0,0 +1,46 @@ +/*
+ * 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;
+
+/**
+ * Service1 service interface
+ * - Non-Asynchronous server version
+ */
+@Remotable
+public interface Service1NonAsyncServer {
+
+ /**
+ * Synchronous method for invoking testcase service
+ * @param input - input parameter as a String
+ * @return - output data as a String
+ */
+ 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)
+ * Listed here for documentation purposes - this is the operation that the async server operation maps to
+ */
+// @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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1NonAsyncServerImpl.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1NonAsyncServerImpl.java new file mode 100644 index 0000000000..05d01dda78 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/Service1NonAsyncServerImpl.java @@ -0,0 +1,29 @@ +/*
+ * 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;
+
+public class Service1NonAsyncServerImpl implements Service1NonAsyncServer {
+
+ @Override
+ public String operation1(String input) {
+ return "Service1NonAsyncServerImpl.operation1 " + input;
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestException.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestException.java new file mode 100644 index 0000000000..1de688dfcd --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestException.java @@ -0,0 +1,39 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestInvocation.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestInvocation.java new file mode 100644 index 0000000000..5b624d4712 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/java/org/apache/tuscany/sca/itest/TestInvocation.java @@ -0,0 +1,44 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/main/resources/TestClient.wsdl b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/TestClient.wsdl new file mode 100644 index 0000000000..92cabda65d --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/TestClient.wsdl @@ -0,0 +1,127 @@ +<?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.1-RC1/testing/itest/async-services/src/main/resources/TestInvocation.wsdl b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/TestInvocation.wsdl new file mode 100644 index 0000000000..a1030a4881 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/TestInvocation.wsdl @@ -0,0 +1,81 @@ +<?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.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_001.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_001.composite new file mode 100644 index 0000000000..5c51f4a7b6 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_001.composite @@ -0,0 +1,51 @@ +<?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.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_002.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_002.composite new file mode 100644 index 0000000000..1eee9501d6 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_002.composite @@ -0,0 +1,51 @@ +<?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.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_003.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_003.composite new file mode 100644 index 0000000000..ae56034ccf --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/Test_Async_003.composite @@ -0,0 +1,51 @@ +<?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.1-RC1/testing/itest/async-services/src/main/resources/test1.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1.composite new file mode 100644 index 0000000000..6a2b2c2409 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1.composite @@ -0,0 +1,33 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1Composite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent" />
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1AsyncService.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1AsyncService.composite new file mode 100644 index 0000000000..4d9a1166df --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1AsyncService.composite @@ -0,0 +1,28 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1AsyncServiceComposite">
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1Client.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1Client.composite new file mode 100644 index 0000000000..923e780e06 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1Client.composite @@ -0,0 +1,29 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1ClientComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent" />
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncService.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncService.composite new file mode 100644 index 0000000000..fbe207d7a0 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncService.composite @@ -0,0 +1,33 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1NonAsyncServiceComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent" />
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1NonAsyncServerImpl"/>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncServiceJMS.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncServiceJMS.composite new file mode 100644 index 0000000000..b9527231f0 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncServiceJMS.composite @@ -0,0 +1,37 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1NonAsyncServiceJMSComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent" />
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1NonAsyncServerImpl"/>
+ <service name="Service1NonAsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1NonAsyncServer"/>
+ <binding.jms />
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncServiceWS.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncServiceWS.composite new file mode 100644 index 0000000000..abc4b0ebc4 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1NonAsyncServiceWS.composite @@ -0,0 +1,37 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1NonAsyncServiceWSComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent" />
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1NonAsyncServerImpl"/>
+ <service name="Service1NonAsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1NonAsyncServer"/>
+ <binding.ws />
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1SyncService.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1SyncService.composite new file mode 100644 index 0000000000..8928543f43 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1SyncService.composite @@ -0,0 +1,28 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1SyncServiceComposite">
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1NonAsyncServerImpl"/>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jms.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jms.composite new file mode 100644 index 0000000000..c520805aea --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jms.composite @@ -0,0 +1,37 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1JmsComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/>
+ <binding.jms />
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsbytes.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsbytes.composite new file mode 100644 index 0000000000..d73862f480 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsbytes.composite @@ -0,0 +1,40 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="Test1JmsBytesComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/>
+ <binding.jms>
+ <t:wireFormat.jmsBytes />
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsbytesxml.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsbytesxml.composite new file mode 100644 index 0000000000..e9bd051796 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsbytesxml.composite @@ -0,0 +1,40 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="Test1JmsBytesXmlComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/>
+ <binding.jms>
+ <t:wireFormat.jmsBytesXML />
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsobject.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsobject.composite new file mode 100644 index 0000000000..9d20b1bf1f --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmsobject.composite @@ -0,0 +1,40 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="Test1JmsObjectComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/>
+ <binding.jms>
+ <t:wireFormat.jmsObject />
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmstext.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmstext.composite new file mode 100644 index 0000000000..7d2003351f --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmstext.composite @@ -0,0 +1,40 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="Test1JmsTextComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/>
+ <binding.jms>
+ <t:wireFormat.jmsText />
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmstextxml.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmstextxml.composite new file mode 100644 index 0000000000..ecf67264b8 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1jmstextxml.composite @@ -0,0 +1,40 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="Test1JmsTextXmlComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <interface.java interface="org.apache.tuscany.sca.itest.Service1AsyncServer"/>
+ <binding.jms>
+ <t:wireFormat.jmsTextXML />
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1ws.composite b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1ws.composite new file mode 100644 index 0000000000..573748f373 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/main/resources/test1ws.composite @@ -0,0 +1,36 @@ +<?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.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/scatests/200903"
+ name="Test1WSComposite">
+
+ <component name="Client">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1ClientImpl"/>
+ <reference name="service1" target="AsyncServiceComponent"/>
+ </component>
+
+ <component name="AsyncServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.Service1AsyncServerImpl2"/>
+ <service name="Service1AsyncServer">
+ <binding.ws/>
+ </service>
+ </component>
+
+</composite>
\ No newline at end of file diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_001_TestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_001_TestCase.java new file mode 100644 index 0000000000..27ff4da34b --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_001_TestCase.java @@ -0,0 +1,87 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_002_TestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_002_TestCase.java new file mode 100644 index 0000000000..d18b8d3b73 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_002_TestCase.java @@ -0,0 +1,85 @@ +/* + * 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.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_003_TestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_003_TestCase.java new file mode 100644 index 0000000000..fafe522da8 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Async_003_TestCase.java @@ -0,0 +1,85 @@ +/* + * 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 diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedSyncServiceTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedSyncServiceTestCase.java new file mode 100644 index 0000000000..6b7bf1b8b0 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedSyncServiceTestCase.java @@ -0,0 +1,58 @@ +/*
+ * 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 java.net.URI;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1DistributedSyncServiceTestCase {
+
+ private static final URI DOMAIN = URI.create("uri:Test1DistributedTestCase?bind=127.0.0.1:8765");
+ protected static Node clientNode, serviceNode;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ serviceNode = TuscanyRuntime.runComposite(DOMAIN, "test1SyncService.composite", "target/classes");
+ clientNode = TuscanyRuntime.runComposite(DOMAIN, "test1Client.composite", "target/classes");
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (clientNode != null) clientNode.stop();
+ if (serviceNode != null) serviceNode.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = clientNode.getService(Service1.class, "Client");
+ assertEquals("Service1NonAsyncServerImpl.operation1 foo" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeOne" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java new file mode 100644 index 0000000000..d506441220 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1DistributedTestCase.java @@ -0,0 +1,60 @@ +/*
+ * 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 java.net.URI;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+@Ignore
+public class Test1DistributedTestCase {
+
+ private static final URI DOMAIN = URI.create("uri:Test1DistributedTestCase?bind=127.0.0.1:8765");
+ protected Node clientNode, serviceNode;
+
+ @Before
+ public void setUp() throws Exception {
+ clientNode = TuscanyRuntime.runComposite(DOMAIN, "test1Client.composite", "target/classes");
+ serviceNode = TuscanyRuntime.runComposite(DOMAIN, "test1AsyncService.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (clientNode != null) clientNode.stop();
+ if (serviceNode != null) serviceNode.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = clientNode.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsBytesTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsBytesTestCase.java new file mode 100644 index 0000000000..3ec19f5140 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsBytesTestCase.java @@ -0,0 +1,56 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+@Ignore
+public class Test1JmsBytesTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1jmsbytes.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsBytesXmlTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsBytesXmlTestCase.java new file mode 100644 index 0000000000..76bcd3b631 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsBytesXmlTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1JmsBytesXmlTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1jmsbytesxml.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsObjectTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsObjectTestCase.java new file mode 100644 index 0000000000..09b6fa5ba1 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsObjectTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1JmsObjectTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1jmsobject.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTestCase.java new file mode 100644 index 0000000000..46006f77ac --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1JmsTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1jms.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTextTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTextTestCase.java new file mode 100644 index 0000000000..1c760b1ad5 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTextTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1JmsTextTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1jmstext.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTextXmlTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTextXmlTestCase.java new file mode 100644 index 0000000000..79f3ee69bb --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1JmsTextXmlTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1JmsTextXmlTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1jmstextxml.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ if (node != null) node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceJMSTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceJMSTestCase.java new file mode 100644 index 0000000000..1c0cbbafa2 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceJMSTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1NonAsyncServiceJMSTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1NonAsyncServiceJMS.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1NonAsyncServerImpl.operation1 foo" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeOne" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceTestCase.java new file mode 100644 index 0000000000..b7084a61f8 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1NonAsyncServiceTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1NonAsyncService.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1NonAsyncServerImpl.operation1 foo" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeOne" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceWSTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceWSTestCase.java new file mode 100644 index 0000000000..f7c7544cfa --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1NonAsyncServiceWSTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1NonAsyncServiceWSTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1NonAsyncServiceWS.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1NonAsyncServerImpl.operation1 foo" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeOne" +
+ "Service1NonAsyncServerImpl.operation1 fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1TestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1TestCase.java new file mode 100644 index 0000000000..3c293b2dc8 --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1TestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1TestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1WSTestCase.java b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1WSTestCase.java new file mode 100644 index 0000000000..9fe28c855a --- /dev/null +++ b/sca-java-2.x/tags/2.0.1-RC1/testing/itest/async-services/src/test/java/org/apache/tuscany/sca/itest/Test1WSTestCase.java @@ -0,0 +1,54 @@ +/*
+ * 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;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Test1WSTestCase {
+
+ protected TuscanyRuntime runtime;
+ protected Node node;
+
+ @Before
+ public void setUp() throws Exception {
+ node = TuscanyRuntime.runComposite("test1ws.composite", "target/classes");
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testReference() throws NoSuchServiceException {
+ Service1 test = node.getService(Service1.class, "Client");
+ assertEquals("Service1AsyncServerImpl2.operation1Async foo" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeOne" +
+ "Service1AsyncServerImpl2.operation1Async fooTypeTwo",
+ test.operation1("foo"));
+ }
+
+}
|