use of org.talend.components.snowflake.tsnowflakeinput.TSnowflakeInputDefinition in project components by Talend.
the class SnowflakeReadersTestIT method testInputManual.
@Test
public void testInputManual() throws Throwable {
TSnowflakeInputProperties props = (TSnowflakeInputProperties) new TSnowflakeInputDefinition().createProperties();
setupProps(props.getConnectionProperties());
Form f = props.getForm(MAIN);
props.manualQuery.setValue(true);
props = (TSnowflakeInputProperties) PropertiesTestUtils.checkAndAfter(getComponentService(), f, props.manualQuery.getName(), props);
props.query.setValue("select ID, C7 from " + testTable + " where ID > 80");
setupTableWithStaticValues(props);
List<IndexedRecord> rows = readRows(props);
assertEquals(19, rows.size());
Schema schema = rows.get(0).getSchema();
LOGGER.debug(schema.toString());
assertEquals(BigDecimal.valueOf(81), rows.get(0).get(0));
assertThat((String) rows.get(0).get(1), containsString("\"bar\": 81"));
}
use of org.talend.components.snowflake.tsnowflakeinput.TSnowflakeInputDefinition in project components by Talend.
the class SnowflakeReadersTestIT method testInputManualError.
@Test(expected = IOException.class)
public void testInputManualError() throws Throwable {
TSnowflakeInputProperties props = (TSnowflakeInputProperties) new TSnowflakeInputDefinition().createProperties();
setupProps(props.getConnectionProperties());
Form f = props.getForm(MAIN);
props.manualQuery.setValue(true);
props = (TSnowflakeInputProperties) PropertiesTestUtils.checkAndAfter(getComponentService(), f, props.manualQuery.getName(), props);
props.query.setValue("bad query");
readRows(props);
}
use of org.talend.components.snowflake.tsnowflakeinput.TSnowflakeInputDefinition in project components by Talend.
the class SnowflakeReadersTestIT method testInputCondition.
@Test
public void testInputCondition() throws Throwable {
TSnowflakeInputProperties props = (TSnowflakeInputProperties) new TSnowflakeInputDefinition().createProperties();
setupProps(props.getConnectionProperties());
Form f = props.getForm(MAIN);
props.manualQuery.setValue(false);
props = (TSnowflakeInputProperties) PropertiesTestUtils.checkAndAfter(getComponentService(), f, props.manualQuery.getName(), props);
props.condition.setValue("ID > 80");
setupTableWithStaticValues(props);
List<IndexedRecord> rows = readRows(props);
assertEquals(19, rows.size());
assertEquals(BigDecimal.valueOf(81), rows.get(0).get(0));
assertEquals("foo_81", rows.get(0).get(1));
}
Aggregations