use of org.mybatis.generator.eclipse.tests.harness.summary.InterfaceSummary in project generator by mybatis.
the class SummarizerTest method testInterfaceSummarizer.
@Test
public void testInterfaceSummarizer() throws IOException {
InputStream resource = getClass().getResourceAsStream("/org/mybatis/generator/eclipse/tests/harness/tests/resources/OuterInterface.src");
CompilationUnitSummary cuSummary = getCompilationUnitSummaryFromResource(resource);
assertThat(cuSummary, hasImportCount(1));
assertThat(cuSummary, hasImport(IMPORT_JAVA_IO_SERIALIZABLE));
assertThat(cuSummary, hasClassCount(0));
assertThat(cuSummary, hasEnumCount(0));
assertThat(cuSummary, hasInterfaceCount(2));
assertThat(cuSummary, hasInterface("SecondOuterInterface"));
assertThat(cuSummary, hasInterface("OuterInterface"));
InterfaceSummary interfaceSummary = cuSummary.getInterfaceSummary("OuterInterface");
assertThat(interfaceSummary, hasSuperInterface(SERIALIZABLE));
assertThat(interfaceSummary, hasSuperInterfaceCount(1));
assertThat(interfaceSummary, hasField("MY_NAME"));
assertThat(interfaceSummary, hasFieldCount(1));
assertThat(interfaceSummary, hasMethod("doSomething(int)"));
assertThat(interfaceSummary, hasMethod("doSomethingElse()"));
assertThat(interfaceSummary, hasMethodCount(2));
verifyInners(interfaceSummary);
}
Aggregations