Search in sources :

Example 1 with DefaultJavaFormatter

use of org.mybatis.generator.api.dom.DefaultJavaFormatter in project generator by mybatis.

the class GeneratedJavaFileTest method testGenericInterface.

@Test
public void testGenericInterface() {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType("org.mybatis.test.TestInterface");
    fqjt.addTypeArgument(new FullyQualifiedJavaType("T"));
    Interface ifc = new Interface(fqjt);
    JavaFormatter jf = new DefaultJavaFormatter();
    GeneratedJavaFile gjf = new GeneratedJavaFile(ifc, "src", jf);
    assertEquals("TestInterface.java", gjf.getFileName());
    assertEquals("org.mybatis.test", gjf.getTargetPackage());
}
Also used : DefaultJavaFormatter(org.mybatis.generator.api.dom.DefaultJavaFormatter) DefaultJavaFormatter(org.mybatis.generator.api.dom.DefaultJavaFormatter) FullyQualifiedJavaType(org.mybatis.generator.api.dom.java.FullyQualifiedJavaType) Interface(org.mybatis.generator.api.dom.java.Interface) Test(org.junit.Test)

Example 2 with DefaultJavaFormatter

use of org.mybatis.generator.api.dom.DefaultJavaFormatter in project generator by mybatis.

the class GeneratedJavaFileTest method testReqularInterface.

@Test
public void testReqularInterface() {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType("org.mybatis.test.TestInterface");
    Interface ifc = new Interface(fqjt);
    JavaFormatter jf = new DefaultJavaFormatter();
    GeneratedJavaFile gjf = new GeneratedJavaFile(ifc, "src", jf);
    assertEquals("TestInterface.java", gjf.getFileName());
    assertEquals("org.mybatis.test", gjf.getTargetPackage());
}
Also used : DefaultJavaFormatter(org.mybatis.generator.api.dom.DefaultJavaFormatter) DefaultJavaFormatter(org.mybatis.generator.api.dom.DefaultJavaFormatter) FullyQualifiedJavaType(org.mybatis.generator.api.dom.java.FullyQualifiedJavaType) Interface(org.mybatis.generator.api.dom.java.Interface) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 DefaultJavaFormatter (org.mybatis.generator.api.dom.DefaultJavaFormatter)2 FullyQualifiedJavaType (org.mybatis.generator.api.dom.java.FullyQualifiedJavaType)2 Interface (org.mybatis.generator.api.dom.java.Interface)2