summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/itest
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-28 09:44:35 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-28 09:44:35 +0000
commitf0df0024c7d0a9836a231900b76b312c865e3e85 (patch)
treedd635a66e92a87ad5ea3a01eaa4733d3de8e1248 /sca-java-2.x/trunk/itest
parentbf194fefee106cfcf91728671d30193f54f46564 (diff)
Add another test using default and explicitly spcified domain URIs
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@904017 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/itest')
-rw-r--r--sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java b/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.java
new file mode 100644
index 0000000000..efcd47421e
--- /dev/null
+++ b/sca-java-2.x/trunk/itest/scaclient-api/src/test/java/test/scaclient/DomainURITestCase.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 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"));
+ }
+}