01: package org.andromda.core.configuration;
02:
03: import junit.framework.TestCase;
04:
05: import org.andromda.core.configuration.Namespace;
06: import org.andromda.core.configuration.Namespaces;
07: import org.andromda.core.configuration.Property;
08:
09: /**
10: * JUnit test for {@link org.andromda.core.configuration.Namespaces}
11: *
12: * @author Chad Brandon
13: */
14: public class NamespacesTest extends TestCase {
15: private static final String TEST_LOCATION = "C:/some/directory/location";
16: private static final String TEST_OUTLET = "test-outlet";
17: private static final String TEST_NAMESPACE = "testNS";
18:
19: /**
20: * Constructor for NamespacesTest.
21: *
22: * @param name
23: */
24: public NamespacesTest(String name) {
25: super (name);
26: }
27:
28: public void testAddAndFindNamespaceProperty() {
29: Namespace namespace = new Namespace();
30: namespace.setName(TEST_NAMESPACE);
31: Property outletLocation = new Property();
32: outletLocation.setName(TEST_OUTLET);
33: outletLocation.setValue(TEST_LOCATION);
34: namespace.addProperty(outletLocation);
35: Namespaces.instance().addNamespace(namespace);
36:
37: assertEquals(outletLocation, Namespaces.instance().getProperty(
38: TEST_NAMESPACE, TEST_OUTLET));
39: }
40: }
|