summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/domain-node/src/test/java
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-06-14 08:57:19 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-06-14 08:57:19 +0000
commit41cfd14858db52e8c3b8abd21a7f1944d14e4b0e (patch)
treefcb3383865e67da6aa30d46967542a4086feb4e1 /sca-java-2.x/trunk/modules/domain-node/src/test/java
parent95bd96114e639620b34b132a0a11079fa9139e25 (diff)
Update to support using a node.xml config file in the domain directory
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1135417 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/domain-node/src/test/java')
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DirectoryDomainTestCase.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DirectoryDomainTestCase.java b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DirectoryDomainTestCase.java
index fb863402c6..5bf1f53690 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DirectoryDomainTestCase.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DirectoryDomainTestCase.java
@@ -69,4 +69,27 @@ public class DirectoryDomainTestCase {
Assert.assertEquals("sample", ic.getJavaExports().get(0));
}
+ @Test
+ public void testNodeXMLFile() throws ContributionReadException, ActivationException, ValidationException, XMLStreamException, IOException {
+ Node node = TuscanyRuntime.newInstance().createNode(new File("src/test/resources/helloworldNode.xml"));
+ Assert.assertEquals("helloworld", node.getDomainName());
+ List<String> cs = node.getInstalledContributionURIs();
+ Assert.assertEquals(1, cs.size());
+ Assert.assertEquals("sample-helloworld", cs.get(0));
+ Map<String, List<String>> startedComposites = node.getStartedCompositeURIs();
+ Assert.assertEquals(1, startedComposites.size());
+ Assert.assertEquals("helloworld.composite", startedComposites.get("sample-helloworld").get(0));
+ }
+
+ @Test
+ public void testNodeXMLDomain() throws ContributionReadException, ActivationException, ValidationException, XMLStreamException, IOException {
+ Node node = TuscanyRuntime.newInstance().createNode(new File("src/test/resources/test-domains/NodeXMLDomain"));
+ Assert.assertEquals("helloworld", node.getDomainName());
+ List<String> cs = node.getInstalledContributionURIs();
+ Assert.assertEquals(1, cs.size());
+ Assert.assertEquals("sample-helloworld", cs.get(0));
+ Map<String, List<String>> startedComposites = node.getStartedCompositeURIs();
+ Assert.assertEquals(1, startedComposites.size());
+ Assert.assertEquals("helloworld.composite", startedComposites.get("sample-helloworld").get(0));
+ }
}