createRecord("test", false, schema, Schema$), Schema$));
}
@Test
public void generateClearMethod() {
Field height = new Field("height", Schema.create(Type.INT), null, null);
Field Height = new Field("Height", Schema.create(Type.INT), null, null);
Field height_and_width =
new Field("height_and_width", Schema.create(Type.STRING), null, null);
Field message =
new Field("message", Schema.create(Type.STRING), null, null);
Field Message =
new Field("Message", Schema.create(Type.STRING), null, null);
Field cause =
new Field("cause", Schema.create(Type.STRING), null, null);
Field clasz =
new Field("class", Schema.create(Type.STRING), null, null);
Field schema =
new Field("schema", Schema.create(Type.STRING), null, null);
Field Schema$ =
new Field("Schema", Schema.create(Type.STRING), null, null);
assertEquals("clearHeight", SpecificCompiler.generateClearMethod(
createRecord("test", false, height), height));
assertEquals("clearHeightAndWidth", SpecificCompiler.generateClearMethod(
createRecord("test", false, height_and_width), height_and_width));
assertEquals("clearMessage", SpecificCompiler.generateClearMethod(
createRecord("test", false, message), message));
message = new Field("message", Schema.create(Type.STRING), null, null);
assertEquals("clearMessage$", SpecificCompiler.generateClearMethod(
createRecord("test", true, message), message));
assertEquals("clearCause", SpecificCompiler.generateClearMethod(
createRecord("test", false, cause), cause));
cause = new Field("cause", Schema.create(Type.STRING), null, null);
assertEquals("clearCause$", SpecificCompiler.generateClearMethod(
createRecord("test", true, cause), cause));
assertEquals("clearClass$", SpecificCompiler.generateClearMethod(
createRecord("test", false, clasz), clasz));
clasz = new Field("class", Schema.create(Type.STRING), null, null);
assertEquals("clearClass$", SpecificCompiler.generateClearMethod(
createRecord("test", true, clasz), clasz));
assertEquals("clearSchema$", SpecificCompiler.generateClearMethod(
createRecord("test", false, schema), schema));
schema = new Field("schema", Schema.create(Type.STRING), null, null);
assertEquals("clearSchema$", SpecificCompiler.generateClearMethod(
createRecord("test", true, schema), schema));
height = new Field("height", Schema.create(Type.INT), null, null);
Height = new Field("Height", Schema.create(Type.INT), null, null);
assertEquals("clearHeight", SpecificCompiler.generateClearMethod(
createRecord("test", false, Height), Height));
height = new Field("height", Schema.create(Type.INT), null, null);
Height = new Field("Height", Schema.create(Type.INT), null, null);
assertEquals("clearHeight$0", SpecificCompiler.generateClearMethod(
createRecord("test", false, height, Height), height));
height = new Field("height", Schema.create(Type.INT), null, null);
Height = new Field("Height", Schema.create(Type.INT), null, null);
assertEquals("clearHeight$1", SpecificCompiler.generateClearMethod(
createRecord("test", false, height, Height), Height));
message = new Field("message", Schema.create(Type.STRING), null, null);
Message = new Field("Message", Schema.create(Type.STRING), null, null);
assertEquals("clearMessage$", SpecificCompiler.generateClearMethod(
createRecord("test", true, Message), Message));
message = new Field("message", Schema.create(Type.STRING), null, null);
Message = new Field("Message", Schema.create(Type.STRING), null, null);
assertEquals("clearMessage$0", SpecificCompiler.generateClearMethod(
createRecord("test", true, message, Message), message));
message = new Field("message", Schema.create(Type.STRING), null, null);
Message = new Field("Message", Schema.create(Type.STRING), null, null);
assertEquals("clearMessage$1", SpecificCompiler.generateClearMethod(
createRecord("test", true, message, Message), Message));
schema = new Field("schema", Schema.create(Type.STRING), null, null);
Schema$ = new Field("Schema", Schema.create(Type.STRING), null, null);
assertEquals("clearSchema$", SpecificCompiler.generateClearMethod(
createRecord("test", false, Schema$), Schema$));
schema = new Field("schema", Schema.create(Type.STRING), null, null);
Schema$ = new Field("Schema", Schema.create(Type.STRING), null, null);
assertEquals("clearSchema$0", SpecificCompiler.generateClearMethod(
createRecord("test", false, schema, Schema$), schema));
schema = new Field("schema", Schema.create(Type.STRING), null, null);
Schema$ = new Field("Schema", Schema.create(Type.STRING), null, null);
assertEquals("clearSchema$1", SpecificCompiler.generateClearMethod(
createRecord("test", false, schema, Schema$), Schema$));
}