summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-sca-runtime/src
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-22 20:22:55 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-22 20:22:55 +0000
commit396bdfd297b947cb7c665cecda3d9ef01948554e (patch)
treef0cc43316a42a9f2379df21845cffd0b1f816399 /java/sca/modules/binding-sca-runtime/src
parentb4ccf4593343639b322b1b986af6489b8a0a24e9 (diff)
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
Diffstat (limited to 'java/sca/modules/binding-sca-runtime/src')
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/SCABindingTestCase.java10
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java10
2 files changed, 18 insertions, 2 deletions
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<Object> 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);