use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder.Text in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testAppendWith.
@Test
public void testAppendWith() {
AbstractFreeSqlBuilder test = create();
test.appendWith(COMMA, new Text(template), new Text(elseTemplate));
assertEquals("template, elseTemplate", test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder.Text in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testAppendClauseConditionWithElse.
@Test
public void testAppendClauseConditionWithElse() {
AbstractFreeSqlBuilder test = create();
test.appendWhen(true, new Text(template), new Text(elseTemplate));
assertEquals(template, test.build());
test = create();
test.appendWhen(false, new Text(template), new Text(elseTemplate));
assertEquals(elseTemplate, test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder.Text in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testAppendClauseCondition.
@Test
public void testAppendClauseCondition() {
AbstractFreeSqlBuilder test = create();
test.appendWhen(true, new Text(template));
assertEquals(template, test.build());
test = create();
test.appendWhen(false, new Text(template));
assertEquals(EMPTY, test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder.Text in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testAppendClause.
@Test
public void testAppendClause() {
AbstractFreeSqlBuilder test = create();
test.append(new Text(template));
assertEquals(template, test.build());
}
Aggregations