Search in sources :

Example 1 with InterfaceSummary

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);
}
Also used : InterfaceSummary(org.mybatis.generator.eclipse.tests.harness.summary.InterfaceSummary) InputStream(java.io.InputStream) CompilationUnitSummary(org.mybatis.generator.eclipse.tests.harness.summary.CompilationUnitSummary) Test(org.junit.Test)

Aggregations

InputStream (java.io.InputStream)1 Test (org.junit.Test)1 CompilationUnitSummary (org.mybatis.generator.eclipse.tests.harness.summary.CompilationUnitSummary)1 InterfaceSummary (org.mybatis.generator.eclipse.tests.harness.summary.InterfaceSummary)1