use of org.talend.components.api.component.ComponentDefinition in project components by Talend.
the class SnowflakeWritersTestIT method testSchemaSerialized2.
@Test
public void testSchemaSerialized2() throws Throwable {
ComponentDefinition definition = getComponentService().getComponentDefinition(TSnowflakeOutputDefinition.COMPONENT_NAME);
TSnowflakeOutputProperties outputProps = (TSnowflakeOutputProperties) getComponentService().getComponentProperties(TSnowflakeOutputDefinition.COMPONENT_NAME);
Schema reject = SchemaBuilder.record("Reject").fields().name("A").type().stringType().noDefault().name("B").type().stringType().noDefault().endRecord();
Schema main = SchemaBuilder.record("Main").fields().name("C").type().stringType().noDefault().name("D").type().stringType().noDefault().endRecord();
outputProps.setValue("table.main.schema", main);
outputProps.setValue("schemaReject.schema", reject);
Schema main2 = (Schema) outputProps.getValuedProperty("table.main.schema").getValue();
Schema reject2 = (Schema) outputProps.getValuedProperty("schemaReject.schema").getValue();
assertEquals(main.toString(), main2.toString());
assertEquals(reject.toString(), reject2.toString());
String serialized = outputProps.toSerialized();
TSnowflakeOutputProperties afterSerialized = org.talend.daikon.properties.Properties.Helper.fromSerializedPersistent(serialized, TSnowflakeOutputProperties.class).object;
main2 = (Schema) afterSerialized.getValuedProperty("table.main.schema").getValue();
reject2 = (Schema) afterSerialized.getValuedProperty("schemaReject.schema").getValue();
assertEquals(main.toString(), main2.toString());
assertEquals(reject.toString(), reject2.toString());
}
use of org.talend.components.api.component.ComponentDefinition in project components by Talend.
the class SpringSnowflakeTestIT method testFamily.
@Test
public void testFamily() {
ComponentDefinition cd = getComponentService().getComponentDefinition("tSnowflakeConnection");
assertEquals(1, cd.getFamilies().length);
assertEquals("Cloud/Snowflake", cd.getFamilies()[0]);
}
Aggregations