use of io.sundr.model.TypeDef in project sundrio by sundrio.
the class SimpleClassWithInheritanceTest method testBuilder.
@Test
public void testBuilder() throws FileNotFoundException {
TypeDef builder = ClazzAs.BUILDER.apply(simpleClassWithDateDef);
System.out.println(builder);
assertEquals(Kind.CLASS, builder.getKind());
assertEquals("SimpleClassWithDateBuilder", builder.getName());
assertEquals(1, builder.getExtendsList().size());
ClassRef superClass = builder.getImplementsList().iterator().next();
assertEquals(builderContext.getVisitableBuilderInterface().getName(), superClass.getName());
assertEquals(2, superClass.getArguments().size());
Iterator<TypeRef> argIterator = superClass.getArguments().iterator();
TypeRef ref = argIterator.next();
assertEquals("testpackage.SimpleClassWithDate", ref.render());
assertEquals("testpackage.SimpleClassWithDate", ref.toString());
ref = argIterator.next();
assertEquals("testpackage.SimpleClassWithDateBuilder", ref.render());
assertEquals("testpackage.SimpleClassWithDateBuilder", ref.toString());
}
use of io.sundr.model.TypeDef in project sundrio by sundrio.
the class SimpleClassWithInheritanceTest method testFluentImpl.
@Test
public void testFluentImpl() throws FileNotFoundException {
TypeDef fluentImpl = ClazzAs.FLUENT_IMPL.apply(simpleClassWithDateDef);
System.out.println(fluentImpl);
assertEquals(Kind.CLASS, fluentImpl.getKind());
assertEquals("SimpleClassWithDateFluentImpl", fluentImpl.getName());
assertEquals(1, fluentImpl.getExtendsList().size());
ClassRef superClass = fluentImpl.getExtendsList().iterator().next();
assertEquals("SimpleClassFluentImpl", superClass.getName());
assertEquals(1, superClass.getArguments().size());
assertEquals("A", superClass.getArguments().iterator().next().toString());
}
use of io.sundr.model.TypeDef in project sundrio by sundrio.
the class SimpleClassWithParameterTest method testBuilder.
@Test
public void testBuilder() {
TypeDef builder = ClazzAs.BUILDER.apply(simpleClassWithParameterDef);
System.out.println(builder);
assertEquals(Kind.CLASS, builder.getKind());
assertEquals("SimpleClassWithParameterBuilder", builder.getName());
assertEquals(1, builder.getExtendsList().size());
ClassRef superClass = builder.getImplementsList().iterator().next();
assertEquals("VisitableBuilder", superClass.getName());
assertEquals(2, superClass.getArguments().size());
Iterator<TypeRef> argIterator = superClass.getArguments().iterator();
TypeRef ref = argIterator.next();
assertEquals("testpackage.SimpleClassWithParameter<N>", ref.render());
assertEquals("testpackage.SimpleClassWithParameter<N>", ref.toString());
ref = argIterator.next();
assertEquals("testpackage.SimpleClassWithParameterBuilder<N>", ref.render());
assertEquals("testpackage.SimpleClassWithParameterBuilder<N>", ref.toString());
}
use of io.sundr.model.TypeDef in project sundrio by sundrio.
the class SimpleClassWithParameterTest method testFluent.
@Test
public void testFluent() {
TypeDef fluent = ClazzAs.FLUENT_INTERFACE.apply(simpleClassWithParameterDef);
System.out.println(fluent);
assertEquals(Kind.INTERFACE, fluent.getKind());
assertEquals("SimpleClassWithParameterFluent", fluent.getName());
assertEquals(1, fluent.getExtendsList().size());
ClassRef superClass = fluent.getExtendsList().iterator().next();
assertEquals("Fluent", superClass.getName());
assertEquals(1, superClass.getArguments().size());
assertEquals("A", superClass.getArguments().iterator().next().toString());
}
use of io.sundr.model.TypeDef in project sundrio by sundrio.
the class SimpleClassWithParameterTest method testInline.
@Test
public void testInline() {
TypeDef inlineable = BuildableProcessor.inlineableOf(builderContext, simpleClassWithParameterDef, inline);
System.out.println(inlineable);
assertEquals(Kind.CLASS, inlineable.getKind());
assertEquals("CallableSimpleClassWithParameter", inlineable.getName());
}
Aggregations