assertEquals("The fields were all hosed to pieces", EXPECTED_STANDARD_FIELDS_NO_AUTO, buffer.toString());
}
public void testGenerateMappingFieldDescriptors() {
TorqueFieldGenerator fieldGenerator = new TorqueFieldGenerator(false);
StringBuffer buffer = new StringBuffer();
FieldDescriptor[] descriptors = new FieldDescriptor[2];
descriptors[0] = new FieldDescriptor(null, 1);
descriptors[0].setColumnName("JUnit column 1");
descriptors[0].setColumnType("VARCHAR");
descriptors[1] = new FieldDescriptor(null, 2);
descriptors[1].setColumnName("JUnit column 2");
descriptors[1].setColumnType("DOUBLE");
descriptors[1].setRequired(true);
descriptors[1].setAutoIncrement(true);
descriptors[1].setPrimaryKey(true);
fieldGenerator.generateMappingFieldDescriptors(descriptors, buffer);
assertEquals("The fields were all hosed to pieces", EXPECTED_MAPPING_FIELDS, buffer.toString());
fieldGenerator = new TorqueFieldGenerator(true);
buffer = new StringBuffer();
descriptors = new FieldDescriptor[2];
descriptors[0] = new FieldDescriptor(null,1);
descriptors[0].setColumnName("JUnit column 1");
descriptors[0].setColumnType("VARCHAR");
descriptors[1] = new FieldDescriptor(null, 2);
descriptors[1].setColumnName("JUnit column 2");
descriptors[1].setColumnType("DOUBLE");
descriptors[1].setRequired(true);
descriptors[1].setAutoIncrement(true);
descriptors[1].setPrimaryKey(true);
fieldGenerator.generateMappingFieldDescriptors(descriptors, buffer);
assertEquals("The fields were all hosed to pieces", EXPECTED_MAPPING_FIELDS_NO_AUTO, buffer.toString());
}