@Test
public void testRenderNameStyle() {
Query q = create.select(val(1)).from(TABLE1).where(FIELD_ID1.equal(2));
RenderContext r_refI = r_refI();
RenderContext r_refP = r_refP();
RenderContext r_ref = r_ref();
r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.AS_IS);
r_refP.configuration().settings().setRenderNameStyle(RenderNameStyle.AS_IS);
r_ref.configuration().settings().setRenderNameStyle(RenderNameStyle.AS_IS);
assertEquals("select 1 from TABLE1 where TABLE1.ID1 = 2", r_refI.render(q));
assertEquals("select :1 from TABLE1 where TABLE1.ID1 = :2", r_refP.render(q));
assertEquals("select ? from TABLE1 where TABLE1.ID1 = ?", r_ref.render(q));
r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.LOWER);
r_refP.configuration().settings().setRenderNameStyle(RenderNameStyle.LOWER);
r_ref.configuration().settings().setRenderNameStyle(RenderNameStyle.LOWER);
assertEquals("select 1 from table1 where table1.id1 = 2", r_refI.render(q));
assertEquals("select :1 from table1 where table1.id1 = :2", r_refP.render(q));
assertEquals("select ? from table1 where table1.id1 = ?", r_ref.render(q));
r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.UPPER);
r_refP.configuration().settings().setRenderNameStyle(RenderNameStyle.UPPER);
r_ref.configuration().settings().setRenderNameStyle(RenderNameStyle.UPPER);
assertEquals("select 1 from TABLE1 where TABLE1.ID1 = 2", r_refI.render(q));
assertEquals("select :1 from TABLE1 where TABLE1.ID1 = :2", r_refP.render(q));
assertEquals("select ? from TABLE1 where TABLE1.ID1 = ?", r_ref.render(q));
r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.QUOTED);
r_refP.configuration().settings().setRenderNameStyle(RenderNameStyle.QUOTED);
r_ref.configuration().settings().setRenderNameStyle(RenderNameStyle.QUOTED);
assertEquals("select 1 from `TABLE1` where `TABLE1`.`ID1` = 2", r_refI.render(q));
assertEquals("select :1 from `TABLE1` where `TABLE1`.`ID1` = :2", r_refP.render(q));
assertEquals("select ? from `TABLE1` where `TABLE1`.`ID1` = ?", r_ref.render(q));
}