From 586665176220b1fc44db3c6228605931b2a5f9b5 Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 8 Jun 2009 10:45:16 +0000 Subject: Add a testcase to the two-nodes test that uses the SCAClient API git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@782589 13f79535-47bb-0310-9956-ffa450edef68 --- java/sca/itest/nodes/two-nodes-test/pom.xml | 5 +++++ .../src/test/java/itest/TwoNodesTestCase.java | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'java/sca') diff --git a/java/sca/itest/nodes/two-nodes-test/pom.xml b/java/sca/itest/nodes/two-nodes-test/pom.xml index baaddc8738..8d92ab5b05 100644 --- a/java/sca/itest/nodes/two-nodes-test/pom.xml +++ b/java/sca/itest/nodes/two-nodes-test/pom.xml @@ -39,6 +39,11 @@ tuscany-node-impl 2.0-SNAPSHOT + + org.apache.tuscany.sca + tuscany-sca-client-impl + 2.0-SNAPSHOT + org.apache.tuscany.sca tuscany-implementation-java-runtime diff --git a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java index eb1cbea1d5..c4584ac03d 100644 --- a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java +++ b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java @@ -29,6 +29,8 @@ import org.apache.tuscany.sca.node.NodeFactory; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.oasisopen.sca.client.SCAClient; +import org.oasisopen.sca.client.SCAClientFactory; /** * This shows how to test the Calculator service component. @@ -62,6 +64,20 @@ public class TwoNodesTestCase{ assertEquals("Hi Hello Petra", client.sayHello("Petra")); } + @Test + public void testCalculatorClientAPI() throws Exception { + + // Ideally this would use the SCAClient API but leaving that tillwe have the basics working + SCAClient scaClient = SCAClientFactory.newInstance(); + Helloworld service = scaClient.getService(Helloworld.class, "HelloworldService", null); + assertNotNull(service); + assertEquals("Hello Petra", service.sayHello("Petra")); + + Helloworld client = scaClient.getService(Helloworld.class, "HelloworldClient", null); + assertNotNull(client); + assertEquals("Hi Hello Petra", client.sayHello("Petra")); + } + @AfterClass public static void tearDownAfterClass() throws Exception { if (serviceNode != null) { -- cgit v1.2.3