/** * Get full package name, remove sourceDirectoryPackageName and change :: to * dot. * * @param umlPackageNameWithClass * UML2 package name with classifier as String * @param sourceDirectoryPackageName * from the stereotype * @return full package name */ public String getFullPackageName(String umlPackageNameWithClass, String sourceDirectoryPackageName) { // Get package until the beginning of SourceDirectory logger.log(Level.FINE, "Qualified name: " + umlPackageNameWithClass); // Remove UML prefixes String packageName = removeUmlPrefixes(umlPackageNameWithClass); // Remove the sourceDirectoryPackageName String toBeDeleted = sourceDirectoryPackageName + "::"; String fullPackageName = packageName.replace(toBeDeleted, ""); // Change :: to . fullPackageName = fullPackageName.replaceAll("::", "."); logger.log(Level.FINE, "Real package name: " + fullPackageName); return fullPackageName; }
@Test public void testRemoveUmlPrefixes6() { String fullQualifiedName = "Data::datatype::byte[]"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Data::byte[]", result); }
@Test public void testRemoveUmlPrefixes1() { String fullQualifiedName = "UMLPrimitiveTypes::Boolean"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Boolean", result); }
@Test public void testRemoveUmlPrefixes10() { String fullQualifiedName = "MyModel::datatype-bindings::Collection<String>"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("MyModel::Collection<String>", result); }
@Test public void testRemoveUmlPrefixes3() { String fullQualifiedName = "MagicDraw Profile::datatypes::void"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("void", result); }
@Test public void testRemoveUmlPrefixes4() { String fullQualifiedName = "JavaPrimitiveTypes::double"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("double", result); }
@Test public void testRemoveUmlPrefixes11() { String fullQualifiedName = "JavaPrimitiveTypes::Boolean"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Boolean", result); }
@Test public void testRemoveUmlPrefixes2() { String fullQualifiedName = "Data::de.crowdcode.test.Company"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Data::de.crowdcode.test.Company", result); }
@Test public void testRemoveUmlPrefixes9() { String fullQualifiedName = "MyModel::de.crowdcode.test.Company"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("MyModel::de.crowdcode.test.Company", result); }
@Test public void testRemoveUmlPrefixes5() { String fullQualifiedName = "Validation Profile::OCL Library::Collection"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Collection", result); }
@Test public void testRemoveUmlPrefixes7() { String fullQualifiedName = "Data::datatype-bindings::Collection<String>"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Data::Collection<String>", result); }
@Test public void testRemoveUmlPrefixes8() { String fullQualifiedName = "T"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("T", result); }
@Test public void testRemoveUmlPrefixes12() { String fullQualifiedName = "UMLPrimitiveTypes::Integer"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Integer", result); }
@Test public void testRemoveUmlPrefixes13() { String fullQualifiedName = "MagicDraw Profile::datatypes::Boolean"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("Boolean", result); }
@Test public void testRemoveUmlPrefixes14() { String fullQualifiedName = "CompanyAttribute<Data::datatype::String, UMLPrimitiveTypes::UMLPrimitiveTypes::Integer>"; String result = packageHelper.removeUmlPrefixes(fullQualifiedName); assertEquals("CompanyAttribute<Data::String, Integer>", result); } }