use of org.mybatis.generator.eclipse.tests.harness.summary.ClassSummary in project generator by mybatis.
the class SummarizerTest method testClassSummarizer.
@Test
public void testClassSummarizer() throws IOException {
InputStream resource = getClass().getResourceAsStream("/org/mybatis/generator/eclipse/tests/harness/tests/resources/OuterClass.src");
CompilationUnitSummary cuSummary = getCompilationUnitSummaryFromResource(resource);
assertThat(cuSummary, hasImportCount(2));
assertThat(cuSummary, hasImport(IMPORT_JAVA_IO_SERIALIZABLE));
assertThat(cuSummary, hasImport("import java.util.ArrayList"));
assertThat(cuSummary, hasClassCount(2));
assertThat(cuSummary, hasClass("SecondOuterClass"));
assertThat(cuSummary, hasClass("OuterClass"));
assertThat(cuSummary, hasEnumCount(0));
assertThat(cuSummary, hasInterfaceCount(0));
ClassSummary classSummary = cuSummary.getClassSummary("OuterClass");
assertThat(classSummary, hasSuperClass("ArrayList<String>"));
assertThat(classSummary, hasSuperInterface(SERIALIZABLE));
assertThat(classSummary, hasSuperInterfaceCount(1));
assertThat(classSummary, hasField("serialVersionUID", withFieldType("long")));
assertThat(classSummary, hasField("unreliableCount"));
assertThat(classSummary, hasFieldCount(2));
assertThat(classSummary, hasMethod("add(String)"));
assertThat(classSummary, hasMethod("getUnreliableCount()"));
assertThat(classSummary, hasMethodCount(2));
verifyInners(classSummary);
}
Aggregations