001package org.andromda.core.configuration; 002 003import junit.framework.TestCase; 004 005/** 006 * JUnit test for {@link org.andromda.core.configuration.Namespaces} 007 * 008 * @author Chad Brandon 009 */ 010public class NamespacesTest 011 extends TestCase 012{ 013 private static final String TEST_LOCATION = "C:/some/directory/location"; 014 private static final String TEST_OUTLET = "test-outlet"; 015 private static final String TEST_NAMESPACE = "testNS"; 016 017 /** 018 * Constructor for NamespacesTest. 019 * 020 * @param name 021 */ 022 public NamespacesTest(String name) 023 { 024 super(name); 025 } 026 027 /** 028 * 029 */ 030 public void testAddAndFindNamespaceProperty() 031 { 032 Namespace namespace = new Namespace(); 033 namespace.setName(TEST_NAMESPACE); 034 Property outletLocation = new Property(); 035 outletLocation.setName(TEST_OUTLET); 036 outletLocation.setValue(TEST_LOCATION); 037 namespace.addProperty(outletLocation); 038 Namespaces.instance().addNamespace(namespace); 039 040 assertEquals( 041 outletLocation, 042 Namespaces.instance().getProperty(TEST_NAMESPACE, TEST_OUTLET)); 043 } 044}