use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testSetLogicDbName.
@Test
public void testSetLogicDbName() {
AbstractFreeSqlBuilder test = create();
try {
test.setLogicDbName(null);
fail();
} catch (Exception e) {
}
try {
test.setLogicDbName("Not exist");
fail();
} catch (IllegalArgumentException e) {
} catch (Throwable ex) {
fail();
}
test.setLogicDbName(logicDbName);
}
use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder 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 in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testAppend.
@Test
public void testAppend() {
AbstractFreeSqlBuilder test = create();
test.append(template);
assertEquals(template, test.build());
test = create();
test.append(template, template, template);
assertEquals("template template template", test.build());
}
use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testSelectCount.
@Test
public void testSelectCount() throws SQLException {
AbstractFreeSqlBuilder test = new AbstractFreeSqlBuilder();
test.append("select count(*) AS abc");
String a = test.build();
}
use of com.ctrip.platform.dal.dao.sqlbuilder.AbstractFreeSqlBuilder in project dal by ctripcorp.
the class AbstractFreeSqlBuilderTest method testKeyword.
@Test
public void testKeyword() {
AbstractFreeSqlBuilder test = create();
test.append(keyword(template));
assertEquals(template, test.build());
}
Aggregations