use of org.teiid.translator.jdbc.TranslatedCommand in project teiid by teiid.
the class TestHiveExecutionFactory method helpTestVisitor.
private void helpTestVisitor(QueryMetadataInterface metadata, String input, String expectedOutput) throws TranslatorException {
// Convert from sql to objects
CommandBuilder commandBuilder = new CommandBuilder(metadata);
Command obj = commandBuilder.getCommand(input);
// Convert back to SQL
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), hiveTranslator);
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 TestSybaseIQTranslator method helpTestVisitor.
public void helpTestVisitor(String vdb, String input, String expectedOutput) {
// Convert from sql to objects
Command obj = TranslationHelper.helpTranslate(vdb, input);
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), trans);
try {
tc.translateCommand(obj);
} catch (TranslatorException e) {
throw new RuntimeException(e);
}
// $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 TestSybaseSQLConversionVisitor method helpTestVisitor.
public void helpTestVisitor(String vdb, String input, String expectedOutput) {
// Convert from sql to objects
Command obj = TranslationHelper.helpTranslate(vdb, input);
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), trans);
try {
tc.translateCommand(obj);
} catch (TranslatorException e) {
throw new RuntimeException(e);
}
// $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 TestAccessSQLTranslator 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
// $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 TestDB2SqlTranslator method helpTestVisitor.
public void helpTestVisitor(TranslationUtility util, String input, String expectedOutput) throws TranslatorException {
// Convert from sql to objects
Command obj = util.parseCommand(input);
TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), TRANSLATOR);
tc.translateCommand(obj);
// $NON-NLS-1$
assertEquals("Did not get correct sql", expectedOutput, tc.getSql());
}
Aggregations