tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1238669 - in /tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src: main/java/itest/RemotableHelloworldImpl.java main/resources/Helloworld.composite test/java/test/scaclient/SCAClientTestCase.java
Date Tue, 31 Jan 2012 15:42:24 GMT
Author: antelder
Date: Tue Jan 31 15:42:24 2012
New Revision: 1238669

URL: http://svn.apache.org/viewvc?rev=1238669&view=rev
Log:
Add a test for a component with a single service and multiple bindings

Added:
    tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java
Modified:
    tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
    tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java

Added: tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java?rev=1238669&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java
(added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/java/itest/RemotableHelloworldImpl.java
Tue Jan 31 15:42:24 2012
@@ -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 itest;
+
+public class RemotableHelloworldImpl implements RemoteHelloworldService {
+
+    @Override
+    public String sayHelloRemote(String name) {
+        return "Remote hi " + name;
+    }
+
+}

Modified: tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite?rev=1238669&r1=1238668&r2=1238669&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/main/resources/Helloworld.composite
Tue Jan 31 15:42:24 2012
@@ -46,4 +46,12 @@
         </service>           
     </component>
 
+    <component name="MultipleBindingsSingleServiceComponent">
+        <implementation.java class="itest.RemotableHelloworldImpl"/>
+        <service name="RemoteHelloworldService">
+           <binding.ws name="ws" />
+           <binding.sca />
+           <tuscany:binding.rmi name="rmi" />
+        </service>           
+    </component>
 </composite>

Modified: tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java?rev=1238669&r1=1238668&r2=1238669&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
(original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/scaclient-api/src/test/java/test/scaclient/SCAClientTestCase.java
Tue Jan 31 15:42:24 2012
@@ -143,6 +143,16 @@ public class SCAClientTestCase extends T
         assertEquals("Hello petra", service.sayHelloRemote("petra"));
     }
 
+    @Test
+    public void testMultipleBindingsSingleService() throws Exception {
+        node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[]
{"target/classes"});
+        node.start();
+
+        SCAClientFactory clientFactory = SCAClientFactory.newInstance(URI.create("myFooDomain"));
+        RemoteHelloworldService service = clientFactory.getService(RemoteHelloworldService.class,
"MultipleBindingsSingleServiceComponent");
+        assertEquals("Remote hi petra", service.sayHelloRemote("petra"));
+    }
+    
     //    @Test @Ignore
 //    public void testHTTPURI() throws Exception {
 //        node = NodeFactory.getInstance().createNode(URI.create("http://defaultDomain"),
new String[] {"target/classes"});



Mime
View raw message