summaryrefslogtreecommitdiffstats
path: root/branches/sca-equinox/samples/calculator-lean/src/test/java/calculator
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:09:08 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-11-11 23:09:08 +0000
commitcde3d2629677a07aa09e3c7fbe117b680c0f5df7 (patch)
treec6d50048ffad8dfa8a1c0019e7afb207cb6b4fe2 /branches/sca-equinox/samples/calculator-lean/src/test/java/calculator
parent4ef0430519e276c2bdecea75f7a0f42f49f0cf30 (diff)
Moving 2.x branches
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835133 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/samples/calculator-lean/src/test/java/calculator')
-rw-r--r--branches/sca-equinox/samples/calculator-lean/src/test/java/calculator/CalculatorTestCase.java66
1 files changed, 0 insertions, 66 deletions
diff --git a/branches/sca-equinox/samples/calculator-lean/src/test/java/calculator/CalculatorTestCase.java b/branches/sca-equinox/samples/calculator-lean/src/test/java/calculator/CalculatorTestCase.java
deleted file mode 100644
index f965e710d5..0000000000
--- a/branches/sca-equinox/samples/calculator-lean/src/test/java/calculator/CalculatorTestCase.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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 junit.framework.TestCase;
-
-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.osoa.sca.annotations.EagerInit;
-import org.osoa.sca.annotations.Reference;
-import org.osoa.sca.annotations.Scope;
-
-/**
- * This shows how to test the Calculator composition.
- */
-@Scope("COMPOSITE") @EagerInit
-public class CalculatorTestCase extends TestCase {
-
- private static CalculatorService calculatorService;
- private Node node;
-
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- CalculatorTestCase.calculatorService = calculatorService;
- }
-
- @Override
- protected void setUp() throws Exception {
- NodeFactory factory = NodeFactory.newInstance();
- String contribution = ContributionLocationHelper.getContributionLocation(CalculatorClient.class);
- node = factory.createNode("CalculatorTest.composite", new Contribution("calculator", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
- public void testCalculator() throws Exception {
- // Calculate
- assertEquals(calculatorService.add(3, 2), 5.0);
- assertEquals(calculatorService.subtract(3, 2), 1.0);
- assertEquals(calculatorService.multiply(3, 2), 6.0);
- assertEquals(calculatorService.divide(3, 2), 1.5);
- }
-}