summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync')
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/Upper.java33
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncReference.java47
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncService.java36
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java63
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java63
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncReferenceImpl.java70
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncServiceImpl.java39
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java74
-rw-r--r--sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncServiceImpl.java45
9 files changed, 0 insertions, 470 deletions
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/Upper.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/Upper.java
deleted file mode 100644
index 0c29cea1dc..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/Upper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Sample service interface.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Upper {
-
- String upper(String s);
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncReference.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncReference.java
deleted file mode 100644
index ad2e62f85d..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncReference.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync;
-
-import java.util.concurrent.Future;
-
-import javax.xml.ws.AsyncHandler;
-import javax.xml.ws.Response;
-
-import org.oasisopen.sca.annotation.AsyncInvocation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Sample service interface.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-@AsyncInvocation
-public interface UpperAsyncReference {
-
- // Sync
- String upper(String s);
-
- // Aysnc Poll
- public Response<String> upperAsync(String s);
-
- // Async Callback
- public Future<String> upperAsync(String s, AsyncHandler<String> handler);
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncService.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncService.java
deleted file mode 100644
index cb4a1c0b42..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/UpperAsyncService.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync;
-
-import org.oasisopen.sca.ResponseDispatch;
-import org.oasisopen.sca.annotation.AsyncInvocation;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Sample service interface.
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-@AsyncInvocation
-public interface UpperAsyncService {
-
- void upperAsync(String s,ResponseDispatch<String> response);
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java
deleted file mode 100644
index 36fdb76424..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import sampleasync.Upper;
-
-/**
- * Test how to run an SCA contribution containing a test composite on a
- * Tuscany runtime node.
- *
- * @version $Rev$ $Date$
- */
-public class SampleGenericAsyncTestCase {
- static Node node;
-
- @BeforeClass
- public static void setUp() throws Exception {
- final NodeFactory nf = NodeFactory.newInstance();
- String here = SampleGenericAsyncTestCase.class.getProtectionDomain().getCodeSource().getLocation().toString();
- node = nf.createNode(new Contribution("test", here));
- node.start();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- @Test
- public void testReference() {
- System.out.println("SampleAsyncReferenceTestCase.testReference");
- Upper upper = node.getService(Upper.class, "SampleAsyncReference");
- final String r = upper.upper("async");
- System.out.println(r);
- assertEquals("ASYNC", r);
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java
deleted file mode 100644
index bc35a637d1..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync.impl;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import sampleasync.Upper;
-
-/**
- * Test how to run an SCA contribution containing a test composite on a
- * Tuscany runtime node.
- *
- * @version $Rev$ $Date$
- */
-public class SampleNativeAsyncTestCase {
- static Node node;
-
- @BeforeClass
- public static void setUp() throws Exception {
- final NodeFactory nf = NodeFactory.newInstance();
- String here = SampleNativeAsyncTestCase.class.getProtectionDomain().getCodeSource().getLocation().toString();
- node = nf.createNode(new Contribution("test", here));
- node.start();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- @Test
- public void testReference() {
- System.out.println("SampleNaiveAsyncTestCase.testReference");
- Upper upper = node.getService(Upper.class, "SampleNativeAsyncReference");
- final String r = upper.upper("async");
- System.out.println(r);
- assertEquals("ASYNC", r);
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncReferenceImpl.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncReferenceImpl.java
deleted file mode 100644
index 9cf7ff9883..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncReferenceImpl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync.impl;
-
-import static java.lang.System.out;
-
-import java.util.concurrent.ExecutionException;
-
-import javax.xml.ws.Response;
-
-import org.oasisopen.sca.annotation.Reference;
-
-import sampleasync.Upper;
-import sampleasync.UpperAsyncReference;
-
-/**
- * Sample service interface.
- *
- * @version $Rev$ $Date$
- */
-public class UpperJavaAsyncReferenceImpl implements Upper {
-
- @Reference
- UpperAsyncReference upper;
-
- public String upper(String s) {
- out.println("UpperAsyncReferenceImpl.upper(" + s + ")");
-
- // async poll
- Response<String> response = upper.upperAsync(s);
-
- while (!response.isDone()){
- System.out.println("Waiting for poll");
- try {
- Thread.sleep(500);
- } catch (Exception ex) {
- // do nothing
- }
- }
-
- String result = null;
-
- try {
- result = response.get();
- System.out.println("Async client poll patern: result = " + result);
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (ExecutionException e) {
- e.printStackTrace();
- }
- return result;
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncServiceImpl.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncServiceImpl.java
deleted file mode 100644
index fb9ad065ad..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperJavaAsyncServiceImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync.impl;
-
-import static java.lang.System.out;
-
-import org.oasisopen.sca.ResponseDispatch;
-
-import sampleasync.UpperAsyncService;
-
-/**
- * Sample component implementation that uses Java interfaces.
- *
- * @version $Rev$ $Date$
- */
-public class UpperJavaAsyncServiceImpl implements UpperAsyncService {
-
- public void upperAsync(String s,ResponseDispatch<String> response) {
- out.println("UpperJavaAsyncServiceImpl.upperAsync(" + s + ")");
- response.sendResponse(s.toUpperCase());
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
deleted file mode 100644
index 101c6a4399..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncReferenceImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync.impl;
-
-import static java.lang.System.out;
-import static sample.Xutil.elem;
-import static sample.Xutil.text;
-import static sample.Xutil.xdom;
-
-import org.w3c.dom.Element;
-
-import sample.api.Java;
-import sample.api.WSDL;
-import sample.api.WSDLReference;
-import sampleasync.Upper;
-
-/**
- * Sample component implementation that uses Java interfaces.
- *
- * @version $Rev$ $Date$
- */
-@Java(Upper.class)
-public class UpperSampleAsyncReferenceImpl {
-
- @WSDL("http://sample/upper#Upper")
- WSDLReference upper;
- Element response;
-
- public String upper(String s) {
- out.println("UpperSampleAsyncReferenceImpl.upper(" + s + ")");
-
- // TODO - I'm passing in the non-wrapped version of the parameter
- // here which doesn't seem right. If I pass in the wrapped
- // version then the databinding won't unwrap on the reference
- // side as it thinks the target Java interface is bare?
- final Element ureq = xdom("http://sample/upper", "s", text(s));
- upper.callAsync("upper", ureq);
-
- try {
- Thread.sleep(500);
- } catch (Exception ex) {
- // do nothing
- }
-
- return response.getTextContent();
- }
-
- /**
- * In this implementation the convention is that the
- * async callback arrives at an operation named
- * operationName + Callback
- */
- public void upperCallback(Element response) {
- out.println("UpperSampleAsyncReferenceImpl.upperCallback(" + response.getTextContent() + ")");
- this.response = response;
- }
-}
diff --git a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncServiceImpl.java b/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncServiceImpl.java
deleted file mode 100644
index 41a85e44a0..0000000000
--- a/sca-java-2.x/tags/2.0-Beta2-RC3/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/UpperSampleAsyncServiceImpl.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sampleasync.impl;
-
-import static java.lang.System.out;
-import static sample.Xutil.elem;
-import static sample.Xutil.text;
-import static sample.Xutil.xdom;
-
-import org.w3c.dom.Element;
-
-import sample.api.WSDL;
-
-/**
- * Sample component implementation that uses Java interfaces.
- *
- * @version $Rev$ $Date$
- */
-@WSDL("http://sample/upper#Upper")
-public class UpperSampleAsyncServiceImpl {
-
- public Element call(String op, Element e) {
- String input = e.getTextContent();
- out.println("UpperSampleAsyncServiceImpl.upper(" + input + ")");
- String output = input.toUpperCase();
- return xdom("http://sample/upper", "upperResponse", elem("result", text(output)));
- }
-}