From 8737254257941b5fd3798b14c45bc680503f12e2 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 10 Jul 2008 18:47:16 +0000 Subject: Fix the test case failure git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@675675 13f79535-47bb-0310-9956-ffa450edef68 --- .../warning/NoMatchingBindingTestCase.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'java/sca/itest') diff --git a/java/sca/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java b/java/sca/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java index eb1f514240..514e45b88e 100644 --- a/java/sca/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java +++ b/java/sca/itest/validation/src/test/java/calculator/warning/NoMatchingBindingTestCase.java @@ -20,13 +20,19 @@ package calculator.warning; import java.io.File; -import junit.framework.Assert; import junit.framework.TestCase; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.UtilityExtensionPoint; +import org.apache.tuscany.sca.monitor.Monitor; +import org.apache.tuscany.sca.monitor.MonitorFactory; +import org.apache.tuscany.sca.monitor.Problem; +import org.apache.tuscany.sca.monitor.logging.impl.DefaultLoggingMonitorImpl; import org.apache.tuscany.sca.node.SCAClient; import org.apache.tuscany.sca.node.SCAContribution; import org.apache.tuscany.sca.node.SCANode2; import org.apache.tuscany.sca.node.SCANode2Factory; +import org.apache.tuscany.sca.node.impl.NodeImpl; /** * This shows how to test the Calculator service component. @@ -38,19 +44,14 @@ public class NoMatchingBindingTestCase extends TestCase { @Override protected void setUp() throws Exception { - try { - SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); - node = nodeFactory.createSCANode(new File("src/main/resources/NoMatchingBinding/Calculator.composite").toURL().toString(), - new SCAContribution("TestContribution", - new File("src/main/resources/NoMatchingBinding").toURL().toString())); - - node.start(); - calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); - } catch (Exception ex){ - // do nothing - return; - } - Assert.fail(); + SCANode2Factory nodeFactory = SCANode2Factory.newInstance(); + node = + nodeFactory.createSCANode(new File("src/main/resources/NoMatchingBinding/Calculator.composite").toURL() + .toString(), new SCAContribution("TestContribution", new File("src/main/resources/NoMatchingBinding") + .toURL().toString())); + + node.start(); + calculatorService = ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent"); } @Override @@ -59,16 +60,15 @@ public class NoMatchingBindingTestCase extends TestCase { } public void testCalculator() throws Exception { - /* + ExtensionPointRegistry registry = ((NodeImpl)node).getExtensionPointRegistry(); UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); Monitor monitor = monitorFactory.createMonitor(); Problem problem = ((DefaultLoggingMonitorImpl)monitor).getLastLoggedProblem(); - + assertNotNull(problem); assertEquals("NoMatchingBinding", problem.getMessageId()); - */ - + } } -- cgit v1.2.3