From f9bf40e621044412c6e5ecc8a435b328e5d135c4 Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 13 Jan 2010 15:43:49 +0000 Subject: Add methods to Node to replicate whats in DomainNode so i can get rid of that. (We still need to do the refactoring of Node as we started discussing on the ML, i'll start that again next week, just want to get the domain changes a bit more done so adding these here for now) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@898806 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sca-java-2.x/trunk/modules/node-impl/src/test') diff --git a/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java b/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java index 5a47465702..70ccf2ab19 100644 --- a/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java +++ b/sca-java-2.x/trunk/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java @@ -19,6 +19,8 @@ package org.apache.tuscany.sca.node.impl; +import java.net.URI; + import org.apache.tuscany.sca.common.java.io.IOHelper; import org.junit.Assert; import org.junit.Test; @@ -36,4 +38,12 @@ public class NodeUtilTestCase { Assert.assertEquals("file:/a%20b", IOHelper.createURI("file:/a b").toString()); Assert.assertEquals("file:/a%20b", IOHelper.createURI("file:/a%20b").toString()); } + + @Test + public void testDomainURI() { + Assert.assertEquals("foo", NodeFactoryImpl.getDomainName(URI.create("tuscany:foo"))); + Assert.assertEquals("foo", NodeFactoryImpl.getDomainName(URI.create("tuscany:vm:foo"))); + Assert.assertEquals("foo", NodeFactoryImpl.getDomainName(URI.create("vm:foo"))); + Assert.assertEquals("foo", NodeFactoryImpl.getDomainName(URI.create("bla://foo"))); + } } -- cgit v1.2.3