use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class QueryGeneratorTest method testSQLServer.
@Test
public void testSQLServer() {
AllSetting setting = new AllSetting();
setting.setSchema(createTestSchema());
String result = QueryUtils.generateNewQuery("Microsoft SQL Server", "\"mydatabase\"", "\"myschema\"", "\"mytable\"", setting);
Assert.assertEquals("\"SELECT \n [mydatabase].[myschema].[mytable].[ID1], \n [mydatabase].[myschema].[mytable].[NAME1]\nFROM [mydatabase].[myschema].[mytable]\"", result);
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class QueryGeneratorTest method testMySQL.
@Test
public void testMySQL() {
AllSetting setting = new AllSetting();
setting.setSchema(createTestSchema());
String result = QueryUtils.generateNewQuery("MySQL", "\"mydatabase\"", null, "\"mytable\"", setting);
Assert.assertEquals("\"SELECT \n `mydatabase`.`mytable`.`ID1`, \n `mydatabase`.`mytable`.`NAME1`\nFROM `mydatabase`.`mytable`\"", result);
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class QueryGeneratorTest method testAS400.
@Test
public void testAS400() {
AllSetting setting = new AllSetting();
setting.setSchema(createTestSchema());
String result = QueryUtils.generateNewQuery("AS400", "\"mydatabase\"", "\"myschema\"", "\"mytable\"", setting);
Assert.assertEquals("\"SELECT \n \\\"mydatabase\\\"/\\\"myschema\\\"/\\\"mytable\\\"/\\\"ID1\\\", \n \\\"mydatabase\\\"/\\\"myschema\\\"/\\\"mytable\\\"/\\\"NAME1\\\"\nFROM \\\"mydatabase\\\"/\\\"myschema\\\"/\\\"mytable\\\"\"", result);
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class QueryGeneratorTest method testCommonQueryGeneratorWithContextAndDBCatalogAndDBSchema.
@Test
public void testCommonQueryGeneratorWithContextAndDBCatalogAndDBSchema() {
AllSetting setting = new AllSetting();
setting.setSchema(createTestSchema());
String result = QueryUtils.generateNewQuery("General JDBC", "context.mydatabase", "context.mydbschema", "context.mytable", setting);
Assert.assertEquals("\"SELECT \n \\\"\"+context.mydatabase+\"\\\".\\\"\"+context.mydbschema+\"\\\".\\\"\"+context.mytable+\"\\\".\\\"ID1\\\", \n \\\"\"+context.mydatabase+\"\\\".\\\"\"+context.mydbschema+\"\\\".\\\"\"+context.mytable+\"\\\".\\\"NAME1\\\"\nFROM \\\"\"+context.mydatabase+\"\\\".\\\"\"+context.mydbschema+\"\\\".\\\"\"+context.mytable+\"\\\"\"", result);
}
use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.
the class QueryGeneratorTest method testOracle.
@Test
public void testOracle() {
AllSetting setting = new AllSetting();
setting.setSchema(createTestSchema());
String result = QueryUtils.generateNewQuery("Oracle with SID", null, "\"myschema\"", "\"mytable\"", setting);
Assert.assertEquals("\"SELECT \n \\\"myschema\\\".\\\"mytable\\\".\\\"ID1\\\", \n \\\"myschema\\\".\\\"mytable\\\".\\\"NAME1\\\"\nFROM \\\"myschema\\\".\\\"mytable\\\"\"", result);
}
Aggregations