diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-01 13:17:35 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-09-01 13:17:35 +0000 |
commit | 1323b4697e3fcaec4cc485833aa77887411ac35b (patch) | |
tree | fef516c5d8d1a3bcd1664441288668a306c13f23 /sca-java-2.x/trunk/contrib/samples/domain/distributed-calculator/contribution-add/src/test/java/calculator/AddTestCase.java | |
parent | 5a037b48de68801460c36e928f80f03139cbdd9d (diff) |
some contributions to show the domain in action starting with a version of the distributed calculator
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@991527 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/contrib/samples/domain/distributed-calculator/contribution-add/src/test/java/calculator/AddTestCase.java')
-rw-r--r-- | sca-java-2.x/trunk/contrib/samples/domain/distributed-calculator/contribution-add/src/test/java/calculator/AddTestCase.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/contrib/samples/domain/distributed-calculator/contribution-add/src/test/java/calculator/AddTestCase.java b/sca-java-2.x/trunk/contrib/samples/domain/distributed-calculator/contribution-add/src/test/java/calculator/AddTestCase.java new file mode 100644 index 0000000000..b7baf9b64b --- /dev/null +++ b/sca-java-2.x/trunk/contrib/samples/domain/distributed-calculator/contribution-add/src/test/java/calculator/AddTestCase.java @@ -0,0 +1,56 @@ +/*
+ * 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 calculator;
+
+import static org.junit.Assert.assertEquals;
+
+import java.rmi.Naming;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+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;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class AddTestCase {
+
+ private static Node node;
+ private static AddService addService;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ addService = new AddServiceImpl();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ // Calculate
+ assertEquals(addService.add(3, 2), 5.0, 0.0);
+ }
+}
|