Search in sources :

Example 6 with TranslatedCommand

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());
}
Also used : TranslatedCommand(org.teiid.translator.jdbc.TranslatedCommand)

Example 7 with TranslatedCommand

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());
}
Also used : ExecutionContext(org.teiid.translator.ExecutionContext) Command(org.teiid.language.Command) TranslatedCommand(org.teiid.translator.jdbc.TranslatedCommand) TranslatedCommand(org.teiid.translator.jdbc.TranslatedCommand)

Aggregations

TranslatedCommand (org.teiid.translator.jdbc.TranslatedCommand)7 Command (org.teiid.language.Command)6 ExecutionContext (org.teiid.translator.ExecutionContext)6 TranslatorException (org.teiid.translator.TranslatorException)2 CommandBuilder (org.teiid.cdk.CommandBuilder)1