tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1041090 - in /tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src: main/java/sampleasync/impl/ test/java/sampleasync/impl/ test/resources/
Date Wed, 01 Dec 2010 17:17:56 GMT
Author: slaws
Date: Wed Dec  1 17:17:56 2010
New Revision: 1041090

URL: http://svn.apache.org/viewvc?rev=1041090&view=rev
Log:
Make space for testing native as well as generic async support in bindings

Added:
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java
      - copied, changed from r1040033, tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleAsyncReferenceTestCase.java
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testgenericasync.composite
      - copied unchanged from r1040033, tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testasync.composite
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testnativeasync.composite
Removed:
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/main/java/sampleasync/impl/SampleAsyncInvoker.java
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleAsyncReferenceTestCase.java
    tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testasync.composite

Copied: tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java
(from r1040033, tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleAsyncReferenceTestCase.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java?p2=tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java&p1=tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleAsyncReferenceTestCase.java&r1=1040033&r2=1041090&rev=1041090&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleAsyncReferenceTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleGenericAsyncTestCase.java
Wed Dec  1 17:17:56 2010
@@ -36,13 +36,13 @@ import sampleasync.Upper;
  * 
  * @version $Rev$ $Date$
  */
-public class SampleAsyncReferenceTestCase {
+public class SampleGenericAsyncTestCase {
     static Node node;
 
     @BeforeClass
     public static void setUp() throws Exception {
         final NodeFactory nf = NodeFactory.newInstance();
-        String here = SampleAsyncReferenceTestCase.class.getProtectionDomain().getCodeSource().getLocation().toString();
+        String here = SampleGenericAsyncTestCase.class.getProtectionDomain().getCodeSource().getLocation().toString();
         node = nf.createNode(new Contribution("test", here));
         node.start();
     }

Added: tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java?rev=1041090&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java
(added)
+++ tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/java/sampleasync/impl/SampleNativeAsyncTestCase.java
Wed Dec  1 17:17:56 2010
@@ -0,0 +1,63 @@
+/*
+ * 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);
+    }
+}

Added: tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testnativeasync.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testnativeasync.composite?rev=1041090&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testnativeasync.composite
(added)
+++ tuscany/sca-java-2.x/trunk/unreleased/samples/implementation-sample-async/src/test/resources/testnativeasync.composite
Wed Dec  1 17:17:56 2010
@@ -0,0 +1,35 @@
+<?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"
+  xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+  targetNamespace="http://test"
+  name="testnativeasync">
+    
+    <!-- SampleAsync implementation at reference with Java async at service -->   

+    <component name="SampleNativeAsyncReference">
+        <t:implementation.sampleasync class="sampleasync.impl.UpperSampleAsyncReferenceImpl"/>
+        <reference name="upper" target="SampleAsyncService"/>
+    </component>  
+    
+    <component name="SampleNativeAsyncService">
+        <t:implementation.sampleasync class="sampleasync.impl.UpperSampleAsyncServiceImpl"/>
+    </component>
+ 
+</composite>



Mime
View raw message