* Created by cliff on 5/9/14.
*/
public class HeapTupleCodeGeneratorTest {
@Test
public void testAccessorsGetGenerated() throws Exception {
HeapTupleSchema schema = TupleSchema.builder().
addField("a", Long.TYPE).
addField("b", Integer.TYPE).
addField("c", Short.TYPE).
addField("d", Character.TYPE).
addField("e", Byte.TYPE).
addField("f", Float.TYPE).
addField("g", Double.TYPE).
heapMemory().
build();
HeapTupleCodeGenerator codegen = new HeapTupleCodeGenerator(null, schema.getFieldNames(), schema.getFieldTypes());
Class clazz = codegen.cookToClass();
assertGetterAndSetterGenerated(clazz, "a", long.class);
assertGetterAndSetterGenerated(clazz, "b", int.class);
assertGetterAndSetterGenerated(clazz, "c", short.class);
assertGetterAndSetterGenerated(clazz, "d", char.class);