summaryrefslogtreecommitdiffstats
path: root/java/sca/samples/calculator-osgi
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-07 18:05:26 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-09-07 18:05:26 +0000
commitd6293beb6665b69b91241907d4e735f7d2cc0f26 (patch)
tree8e27e8c815d4f723c3b9dff548e688b8369576a3 /java/sca/samples/calculator-osgi
parent02da36112e4a86565be66a0931e0622d7902e678 (diff)
Simplified the sample a bit to really isolate the test case from the component running inside the OSGi environment.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@692914 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/samples/calculator-osgi')
-rw-r--r--java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java1
-rw-r--r--java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java16
2 files changed, 2 insertions, 15 deletions
diff --git a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java
index 2bb8f96dcf..bfcab602e1 100644
--- a/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java
+++ b/java/sca/samples/calculator-osgi/src/main/java/calculator/CalculatorClient.java
@@ -42,6 +42,7 @@ public class CalculatorClient {
public void calculate() {
// Calculate
+ System.out.println(getClass().getClassLoader());
System.out.println("3 + 2=" + calculatorService.add(3, 2));
System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
diff --git a/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java b/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
index 85bf73b264..48489143f0 100644
--- a/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
+++ b/java/sca/samples/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java
@@ -34,19 +34,13 @@ import org.osoa.sca.annotations.Scope;
@EagerInit
public class CalculatorTestCase extends TestCase {
- private static CalculatorService calculatorService;
private NodeLauncher launcher;
private SCANode node;
- @Reference
- public void setCalculatorService(CalculatorService calculatorService) {
- CalculatorTestCase.calculatorService = calculatorService;
- }
-
@Override
protected void setUp() throws Exception {
launcher = NodeLauncher.newInstance();
- node = launcher.createNodeFromClassLoader("CalculatorTest.composite", getClass().getClassLoader());
+ node = launcher.createNodeFromClassLoader("Calculator.composite", getClass().getClassLoader());
node.start();
}
@@ -61,12 +55,4 @@ public class CalculatorTestCase extends TestCase {
public void testDummy() {
}
- @Init
- public void init() 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);
- }
}