JdtHelper { public SimpleType getAstSimpleType(AST ast, String typeName) { String javaType = dataTypeUtils.getJavaTypes().get(typeName); SimpleType tp = null; if (javaType != null) { tp = ast.newSimpleType(ast.newName(javaType)); } else { tp = ast.newSimpleType(ast.newName(typeName)); } return tp; }  Name createFullQualifiedTypeAsName(AST ast,
			String fullQualifiedUmlTypeName, String sourceDirectoryPackageName); String createFullQualifiedTypeAsString(AST ast,
			String fullQualifiedUmlTypeName, String sourceDirectoryPackageName); @SuppressWarnings("unchecked") void createReturnType(AST ast, AbstractTypeDeclaration td,
			MethodDeclaration md, String umlTypeName,
			String umlQualifiedTypeName, String sourceDirectoryPackageName); Type getChosenType(AST ast, String umlTypeName,
			String umlQualifiedTypeName, String sourceDirectoryPackageName); @SuppressWarnings("unchecked") void createReturnTypeAsCollection(AST ast,
			AbstractTypeDeclaration td, MethodDeclaration md,
			String umlTypeName, String umlQualifiedTypeName,
			String sourceDirectoryPackageName, String collectionTypeConstant); SimpleType getAstSimpleType(AST ast, String typeName); PrimitiveType getAstPrimitiveType(AST ast, String typeName); ArrayType getAstArrayType(AST ast, String typeName); @SuppressWarnings("unchecked") ParameterizedType getAstParameterizedType(AST ast, String typeName); @SuppressWarnings("unchecked") void createParameterTypes(AST ast, AbstractTypeDeclaration td,
			MethodDeclaration md, String umlTypeName,
			String umlQualifiedTypeName, String umlPropertyName,
			String sourceDirectoryPackageName); @SuppressWarnings("unchecked") void createParameterTypesAsCollection(AST ast,
			AbstractTypeDeclaration td, MethodDeclaration md,
			String umlTypeName, String umlQualifiedTypeName,
			String umlPropertyName, String sourceDirectoryPackageName,
			String collectionTypeConstant); String getClassName(final String fullClassName); static final String JAVA_UTIL_COLLECTION; static final String JAVA_UTIL_LIST; static final String JAVA_UTIL_SET; static final String JAVA_UTIL_SORTEDSET; }
@Test public void testGetAstSimpleTypeJavaTypeNotNull() { Map<String, String> javaTypes = createJavaTypes(); when(dataTypeUtils.getJavaTypes()).thenReturn(javaTypes); String typeName = "Integer"; SimpleType tp = jdtHelper.getAstSimpleType(ast, typeName); assertEquals("Integer", tp.getName().toString()); }
@Test public void testGetAstSimpleTypeJavaTypeNull() { Map<String, String> javaTypes = createJavaTypes(); when(dataTypeUtils.getJavaTypes()).thenReturn(javaTypes); String typeName = "org.codecrowd.Test"; SimpleType tp = jdtHelper.getAstSimpleType(ast, typeName); assertEquals("org.codecrowd.Test", tp.getName().toString()); }
@Test public void testGetAstSimpleTypeJavaTypeCollection() { Map<String, String> javaTypes = createJavaTypes(); when(dataTypeUtils.getJavaTypes()).thenReturn(javaTypes); String typeName = "Collection"; SimpleType tp = jdtHelper.getAstSimpleType(ast, typeName); assertEquals("java.util.Collection", tp.getName().toString()); }
@Test public void testGetAstSimpleTypeJavaTypeList() { Map<String, String> javaTypes = createJavaTypes(); when(dataTypeUtils.getJavaTypes()).thenReturn(javaTypes); String typeName = "List"; SimpleType tp = jdtHelper.getAstSimpleType(ast, typeName); assertEquals("java.util.List", tp.getName().toString()); }