You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2010/01/28 10:44:35 UTC

svn commit: r904017 - /tuscany/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java

Author: antelder
Date: Thu Jan 28 09:44:35 2010
New Revision: 904017

URL: http://svn.apache.org/viewvc?rev=904017&view=rev
Log:
Add another test using default and explicitly spcified domain URIs

Added:
    tuscany/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java

Added: tuscany/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java?rev=904017&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java Thu Jan 28 09:44:35 2010
@@ -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 test.scaclient;
+
+import itest.HelloworldService;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.runtime.Version;
+import org.junit.Test;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+/**
+ * Tests various permutations of creating Nodes and SCAClients
+ */
+public class DomainURITestCase extends TestCase {
+
+    @Test
+    public void testDefault() throws Exception {
+
+        Node node = NodeFactory.getInstance().createNode((String)null, new String[] {"target/classes"});
+        node.start();
+
+        HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent");
+        assertEquals("Hello petra", service.sayHello("petra"));
+    }
+
+    @Test
+    public void testExplicit() throws Exception {
+
+        Node node = NodeFactory.getInstance().createNode(URI.create("myFooDomain"), new String[] {"target/classes"});
+        node.start();
+
+        HelloworldService service = SCAClientFactory.newInstance(URI.create("myFooDomain")).getService(HelloworldService.class, "HelloworldComponent");
+        assertEquals("Hello petra", service.sayHello("petra"));
+    }
+}