@@ -0,0 +1,3210 @@
+/*%0A * Copyright 2012 Shared Learning Collaborative, LLC%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.slc.sli.modeling.uml.helpers;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport org.slc.sli.modeling.uml.Attribute;%0Aimport org.slc.sli.modeling.uml.ClassType;%0Aimport org.slc.sli.modeling.uml.DataType;%0Aimport org.slc.sli.modeling.uml.Identifier;%0Aimport org.slc.sli.modeling.uml.Model;%0Aimport org.slc.sli.modeling.uml.NamespaceOwnedElement;%0Aimport org.slc.sli.modeling.uml.TaggedValue;%0Aimport org.slc.sli.modeling.uml.Type;%0Aimport org.slc.sli.modeling.uml.UmlPackage;%0Aimport org.slc.sli.modeling.uml.index.DefaultModelIndex;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * JUnit test for NamespaceHelper class.%0A *%0A * @author wscott%0A */%0Apublic class NamespaceHelperTest %7B%0A%0A    private DefaultModelIndex modelIndex;%0A%0A    private static final String DATATYPE_NAME = %22dataTypeName%22;%0A    private static final Identifier DATATYPE_ID = Identifier.random();%0A    private static final String CLASSTYPE_NAME = %22classTypeName%22;%0A    private static final Identifier CLASSTYPE_ID = Identifier.random();%0A    private static final String UMLPACKAGE_NAME = %22umlPackageName%22;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        List%3CNamespaceOwnedElement%3E packageElements = new ArrayList%3CNamespaceOwnedElement%3E();%0A        List%3CNamespaceOwnedElement%3E modelElements = new ArrayList%3CNamespaceOwnedElement%3E();%0A%0A        ClassType classType = new ClassType(CLASSTYPE_ID, CLASSTYPE_NAME, true, new ArrayList%3CAttribute%3E(0), new ArrayList%3CTaggedValue%3E(0));%0A        packageElements.add(classType);%0A        DataType dataType = new DataType(DATATYPE_ID, DATATYPE_NAME);%0A        packageElements.add(dataType);%0A        UmlPackage umlPackage = new UmlPackage(UMLPACKAGE_NAME, packageElements);%0A        modelElements.add(umlPackage);%0A%0A        Model model = new Model(CLASSTYPE_ID, %22modelName%22, new ArrayList%3CTaggedValue%3E(0), modelElements);%0A        modelIndex = new DefaultModelIndex(model);%0A    %7D%0A%0A    @Test%0A    public void testGetNamespace() throws Exception %7B%0A        Type classType = modelIndex.getType(CLASSTYPE_ID);%0A        assertEquals(UMLPACKAGE_NAME, NamespaceHelper.getNamespace(classType, modelIndex));%0A    %7D%0A%0A    @Test%0A    public void testGetNamespaceNonusedType() %7B%0A        Type nonusedType = mock(Type.class);%0A        when(nonusedType.getId()).thenReturn(Identifier.random());%0A        assertEquals(%22%22, NamespaceHelper.getNamespace(nonusedType, modelIndex));%0A    %7D%0A%0A    @Test%0A    public void testConstructor() %7B%0A        new NamespaceHelper();%0A    %7D%0A%7D%0A

Add JUnit test for NamespaceHelper class.