use of org.teiid.translator.jdbc.TranslatedCommand in project teiid by teiid.
the class TestOracleTranslator method helpTestVisitor.
private void helpTestVisitor(Command obj, ExecutionContext context, String dbmsTimeZone, String expectedOutput) throws TranslatorException {
OracleExecutionFactory translator = new OracleExecutionFactory();
if (dbmsTimeZone != null) {
translator.setDatabaseTimeZone(dbmsTimeZone);
}
translator.setUseBindVariables(false);
translator.start();
// Convert back to SQL
TranslatedCommand tc = new TranslatedCommand(context, translator);
tc.translateCommand(obj);
// Check stuff
// $NON-NLS-1$
assertEquals("Did not get correct sql", expectedOutput, tc.getSql());
}
use of org.teiid.translator.jdbc.TranslatedCommand in project teiid by teiid.
the class TestNetezzaTranslatorCapabilities method helpTestVisitor.
public void helpTestVisitor(String input, String expectedOutput) throws TranslatorException {
// Convert from sql to objects
Command obj = FakeTranslationFactory.getInstance().getBQTTranslationUtility().parseCommand(input);
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), TRANSLATOR);
tc.translateCommand(obj);
// Check stuff
assertEquals("Did not get correct sql", expectedOutput, tc.getSql());
}
Aggregations