summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/node-impl/src/test
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-13 01:19:32 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-02-13 01:19:32 +0000
commitc11d800db46ab42e99d7837427dd07dccaffc66a (patch)
tree3f2c5ec0e5f0a6f6e46c2a01bad010450ecaa80e /sca-java-2.x/trunk/modules/node-impl/src/test
parent788e5e52292aad11f345c247b418386138976cea (diff)
Start to make extension points/extensions configurable from NodeFactory/ServiceDiscovery
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@909678 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/node-impl/src/test')
-rw-r--r--sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java b/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
index 3fff10328f..f0e6675e8d 100644
--- a/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
+++ b/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeImplTestCase.java
@@ -25,12 +25,16 @@ import java.io.File;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URI;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint;
import org.apache.tuscany.sca.node.Contribution;
import org.apache.tuscany.sca.node.Node;
import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.runtime.DomainRegistryFactoryExtensionPoint;
import org.junit.Assert;
import org.junit.Test;
@@ -115,4 +119,26 @@ public class NodeImplTestCase {
Assert.assertEquals("Hello, Node", hw.hello("Node"));
node.stop();
}
+
+ @Test
+ public void testNodeFactoryAttributes() {
+ Map<String, Map<String, String>> attrs = new HashMap<String, Map<String, String>>();
+ Map<String, String> map = new HashMap<String, String>();
+ map.put("enabled", "false");
+ attrs.put(ValidationSchemaExtensionPoint.class.getName(), map);
+
+ Map<String, String> map2 = new HashMap<String, String>();
+ map2.put("urn:MyDomain", "multicast://200.0.0.100:50000/MyDomain");
+ attrs.put(DomainRegistryFactoryExtensionPoint.class.getName(), map2);
+
+ NodeFactoryImpl factory = (NodeFactoryImpl)NodeFactory.newInstance(attrs);
+ Assert.assertFalse(factory.getExtensionPoints().getExtensionPoint(ValidationSchemaExtensionPoint.class)
+ .isEnabled());
+
+ DomainRegistryFactoryExtensionPoint domainRegistryFactoryExtensionPoint =
+ factory.getExtensionPoints().getExtensionPoint(DomainRegistryFactoryExtensionPoint.class);
+ Map<String, String> mapping = domainRegistryFactoryExtensionPoint.getDomainRegistryMapping();
+ Assert.assertEquals(1, mapping.size());
+ Assert.assertEquals("multicast://200.0.0.100:50000/MyDomain", mapping.get("urn:MyDomain"));
+ }
}