From 396bdfd297b947cb7c665cecda3d9ef01948554e Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 22 Jul 2009 20:22:55 +0000 Subject: TUSCANY-3175 don't build the model without a monitor. It's won't work in the future when we rely on a monitor being present in order to record context git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@796870 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java | 10 +++++++++- .../org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'java/sca/modules/binding-sca-runtime') diff --git a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java index 11fb1f9772..8789ba8a56 100644 --- a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java +++ b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java @@ -36,6 +36,9 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtens import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; +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.policy.PolicyFactory; import org.junit.Assert; import org.junit.Before; @@ -54,6 +57,7 @@ public class SCABindingTestCase { private CompositeModelResolver resolver; private CompositeBuilder compositeBuilder; private ExtensionPointRegistry extensionPoints; + private Monitor monitor; @Before public void init() throws Exception { @@ -71,6 +75,10 @@ public class SCABindingTestCase { PolicyFactory attachPointTypeFactory = modelFactories.getFactory(PolicyFactory.class); compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder"); + + UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + monitor = monitorFactory.createMonitor(); } @@ -98,7 +106,7 @@ public class SCABindingTestCase { staxProcessor.resolve(composite, resolver); - compositeBuilder.build(composite, null, null); + compositeBuilder.build(composite, null, monitor); SCABinding referenceSCABinding = (SCABinding) composite.getComponents().get(0).getReferences().get(0).getBindings().get(0); SCABinding serviceSCABinding = (SCABinding) composite.getComponents().get(1).getServices().get(0).getBindings().get(0); diff --git a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java index 42b2f1c248..06ad188f49 100644 --- a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java +++ b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java @@ -36,6 +36,9 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; 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.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; @@ -50,6 +53,7 @@ public class ReadTestCase { private static XMLInputFactory inputFactory; private static StAXArtifactProcessor staxProcessor; private static CompositeBuilder compositeBuilder; + private static Monitor monitor; @BeforeClass public static void setUp() throws Exception { @@ -60,6 +64,10 @@ public class ReadTestCase { staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null); compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder"); + + UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class); + MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class); + monitor = monitorFactory.createMonitor(); } @Test @@ -85,7 +93,7 @@ public class ReadTestCase { Composite composite = (Composite)staxProcessor.read(reader); assertNotNull(composite); - compositeBuilder.build(composite, null, null); + compositeBuilder.build(composite, null, monitor); SCABinding referenceSCABinding = (SCABinding) composite.getComponents().get(0).getReferences().get(0).getBindings().get(0); SCABinding serviceSCABinding = (SCABinding) composite.getComponents().get(1).getServices().get(0).getBindings().get(0); -- cgit v1.2.3