use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestSQLConversionVisitor method helpTest.
private void helpTest(String sql, String expected) throws TranslatorException {
Command command = translationUtility.parseCommand(sql);
PhoenixExecutionFactory ef = new PhoenixExecutionFactory();
ef.start();
SQLConversionVisitor vistor = ef.getSQLConversionVisitor();
vistor.append(command);
assertEquals(expected, vistor.toString());
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestSQLConversionVisitor method helpTest.
private void helpTest(String sql, String expected) throws TranslatorException {
Command command = translationUtility.parseCommand(sql);
SQLConversionVisitor vistor = TRANSLATOR.getSQLConversionVisitor();
vistor.append(command);
// System.out.println(vistor.toString());
assertEquals(expected, vistor.toString());
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestSQLConversionVisitor method helpTestMod.
private void helpTestMod(Literal c, String format, String expectedStr) throws Exception {
Function func = LANG_FACTORY.createFunction(format, Arrays.asList(c), String.class);
PrestoDBExecutionFactory ef = new PrestoDBExecutionFactory();
ef.start();
SQLConversionVisitor sqlVisitor = ef.getSQLConversionVisitor();
sqlVisitor.append(func);
assertEquals(expectedStr, sqlVisitor.toString());
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestLeftOrRightFunctionModifier method helpTestMod.
public void helpTestMod(Literal c, Literal d, String target, String expectedStr) throws Exception {
Function func = LANG_FACTORY.createFunction(target, Arrays.asList(c, d), String.class);
OracleExecutionFactory trans = new OracleExecutionFactory();
trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
assertEquals(expectedStr, sqlVisitor.toString());
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestMonthOrDayNameFunctionModifier method helpTestMod.
public void helpTestMod(Literal c, String format, String expectedStr) throws Exception {
Function func = // "monthname" //$NON-NLS-1$
LANG_FACTORY.createFunction(// "monthname" //$NON-NLS-1$
format.toLowerCase() + "name", Arrays.asList(c), String.class);
OracleExecutionFactory trans = new OracleExecutionFactory();
trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
assertEquals(expectedStr, sqlVisitor.toString());
}
Aggregations