Examples of TypeNameConverter


Examples of org.junithelper.core.extractor.TypeNameConverter

    }

    @Test
    public void instantiation() throws Exception {
        Configuration config = null;
        TypeNameConverter target = new TypeNameConverter(config);
        assertNotNull(target);
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

    }

    @Test
    public void toCompilableType_A$String$List$String() throws Exception {
        Configuration config = new Configuration();
        TypeNameConverter target = new TypeNameConverter(config);
        // given
        String packageName = null;
        String className = "InputStream";
        List<String> importedList = new ArrayList<String>();
        importedList.add("java.io.InputStream");
        // when
        String actual = target.toCompilableType(className, importedList, packageName);
        // then
        String expected = "InputStream";
        assertEquals(expected, actual);
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

    }

    @Test
    public void toCompilableType_A$String$List$String_WildcardImport() throws Exception {
        Configuration config = new Configuration();
        TypeNameConverter target = new TypeNameConverter(config);
        // given
        String packageName = null;
        String className = "InputStream";
        List<String> importedList = new ArrayList<String>();
        importedList.add("java.io.*");
        // when
        String actual = target.toCompilableType(className, importedList, packageName);
        // then
        String expected = "InputStream";
        assertEquals(expected, actual);
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

    }

    @Test
    public void toCompilableType_A$String$List$List$String() throws Exception {
        Configuration config = null;
        TypeNameConverter target = new TypeNameConverter(config);
        // given
        String packageName = null;
        String className = "List";
        List<String> generics = new ArrayList<String>();
        generics.add("String");
        List<String> importedList = new ArrayList<String>();
        importedList.add("java.util.List");
        // when
        String actual = target.toCompilableType(className, generics, importedList, packageName);
        // then
        String expected = "List<String>";
        assertEquals(expected, actual);
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

        assertEquals(expected, actual);
    }

    @Test
    public void toAvailableInMethodName_A$String_StringIsNull() throws Exception {
        TypeNameConverter target = new TypeNameConverter(config);
        String typeName = null;
        try {
            target.toAvailableInMethodName(typeName);
            fail();
        } catch (JUnitHelperCoreException e) {
        }
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

        }
    }

    @Test
    public void toAvailableInMethodName_A$String_StringIsEmpty() throws Exception {
        TypeNameConverter target = new TypeNameConverter(config);
        String typeName = "";
        try {
            target.toAvailableInMethodName(typeName);
            fail();
        } catch (JUnitHelperCoreException e) {
        }
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

        }
    }

    @Test
    public void toCompilableType_A$String$List$String_StringIsNull() throws Exception {
        TypeNameConverter target = new TypeNameConverter(config);
        String typeName = null;
        List<String> importedList = new ArrayList<String>();
        String callerClassPackageName = null;
        String actual = target.toCompilableType(typeName, importedList, callerClassPackageName);
        String expected = null;
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

        assertThat(actual, is(equalTo(expected)));
    }

    @Test
    public void toCompilableType_A$String$List$String_StringIsEmpty() throws Exception {
        TypeNameConverter target = new TypeNameConverter(config);
        String typeName = "";
        List<String> importedList = new ArrayList<String>();
        String callerClassPackageName = "";
        String actual = target.toCompilableType(typeName, importedList, callerClassPackageName);
        String expected = "Object";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

        assertThat(actual, is(equalTo(expected)));
    }

    @Test
    public void toCompilableType_A$String$List$List$String_StringIsNull() throws Exception {
        TypeNameConverter target = new TypeNameConverter(config);
        String typeName = null;
        List<String> generics = new ArrayList<String>();
        List<String> importedList = new ArrayList<String>();
        String callerClassPackageName = null;
        String actual = target.toCompilableType(typeName, generics, importedList, callerClassPackageName);
        String expected = null;
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

Examples of org.junithelper.core.extractor.TypeNameConverter

        assertThat(actual, is(equalTo(expected)));
    }

    @Test
    public void toCompilableType_A$String$List$List$String_StringIsEmpty() throws Exception {
        TypeNameConverter target = new TypeNameConverter(config);
        String typeName = "";
        List<String> generics = new ArrayList<String>();
        List<String> importedList = new ArrayList<String>();
        String callerClassPackageName = "";
        String actual = target.toCompilableType(typeName, generics, importedList, callerClassPackageName);
        String expected = "Object";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.