Search in sources :

Example 56 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class S3DatasetDefinitionTest method testRuntimeInfo.

/**
 * Checks the {@link RuntimeInfo} of the definition.
 */
@Test
public void testRuntimeInfo() {
    RuntimeInfo runtimeInfo = def.getRuntimeInfo(null);
    assertThat(runtimeInfo.getRuntimeClassName(), is("org.talend.components.simplefileio.runtime.s3.S3DatasetRuntime"));
// The integration module tests things that aren't available in the RuntimeInfo module until after it is
// installed in the local maven repository.
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Example 57 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class S3DatastoreDefinitionTest method testRuntimeInfo.

/**
 * Checks the {@link RuntimeInfo} of the definition.
 */
@Test
public void testRuntimeInfo() {
    RuntimeInfo runtimeInfo = def.getRuntimeInfo(null);
    assertThat(runtimeInfo.getRuntimeClassName(), is("org.talend.components.simplefileio.runtime.s3.S3DatastoreRuntime"));
// The integration module tests things that aren't available in the RuntimeInfo module until after it is
// installed in the local maven repository.
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Example 58 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class S3OutputDefinitionTest method testRuntimeInfo.

/**
 * Checks the {@link RuntimeInfo} of the definition.
 */
@Test
public void testRuntimeInfo() {
    RuntimeInfo runtimeInfo = def.getRuntimeInfo(ExecutionEngine.BEAM, null, ConnectorTopology.INCOMING);
    assertThat(runtimeInfo.getRuntimeClassName(), is("org.talend.components.simplefileio.runtime.s3.S3OutputRuntime"));
// The integration module tests things that aren't available in the RuntimeInfo module until after it is
// installed in the local maven repository.
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Test(org.junit.Test)

Example 59 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class SandboxedFixedFlowInputRuntimeTest method testBasic.

@Test
public void testBasic() throws Exception {
    // The two records to use as values.
    GenericRecord r1 = new GenericData.Record(SampleSchemas.recordSimple());
    r1.put("id", 1);
    r1.put("name", "one");
    GenericRecord r2 = new GenericData.Record(SampleSchemas.recordSimple());
    r2.put("id", 2);
    r2.put("name", "two");
    final FixedFlowInputProperties props = createComponentProperties();
    props.schemaFlow.schema.setValue(SampleSchemas.recordSimple());
    props.values.setValue(r1.toString());
    props.nbRows.setValue(2);
    RuntimeInfo ri = def.getRuntimeInfo(ExecutionEngine.BEAM, props, ConnectorTopology.OUTGOING);
    try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(ri, getClass().getClassLoader())) {
        RuntimableRuntime<FixedFlowInputProperties> runtime = (RuntimableRuntime<FixedFlowInputProperties>) si.getInstance();
        runtime.initialize(null, props);
    // The functionality of the runtime is tested in its own module.
    }
}
Also used : SandboxedInstance(org.talend.daikon.sandbox.SandboxedInstance) RuntimableRuntime(org.talend.components.api.component.runtime.RuntimableRuntime) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) FixedFlowInputProperties(org.talend.components.localio.fixedflowinput.FixedFlowInputProperties) GenericRecord(org.apache.avro.generic.GenericRecord) IndexedRecord(org.apache.avro.generic.IndexedRecord) GenericRecord(org.apache.avro.generic.GenericRecord) Test(org.junit.Test)

Example 60 with RuntimeInfo

use of org.talend.daikon.runtime.RuntimeInfo in project components by Talend.

the class SandboxedRowGeneratorRuntimeTest method testBasic.

@Test
public void testBasic() throws Exception {
    final RowGeneratorProperties props = createComponentProperties();
    props.schemaFlow.schema.setValue(SampleSchemas.recordSimple());
    props.nbRows.setValue(95L);
    props.nbPartitions.setValue(10);
    RuntimeInfo ri = def.getRuntimeInfo(ExecutionEngine.BEAM, props, ConnectorTopology.OUTGOING);
    try (SandboxedInstance si = RuntimeUtil.createRuntimeClass(ri, getClass().getClassLoader())) {
        RuntimableRuntime<RowGeneratorProperties> runtime = (RuntimableRuntime<RowGeneratorProperties>) si.getInstance();
        runtime.initialize(null, props);
    }
}
Also used : SandboxedInstance(org.talend.daikon.sandbox.SandboxedInstance) RuntimableRuntime(org.talend.components.api.component.runtime.RuntimableRuntime) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) RowGeneratorProperties(org.talend.components.localio.rowgenerator.RowGeneratorProperties) Test(org.junit.Test)

Aggregations

RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)131 Test (org.junit.Test)120 SandboxedInstance (org.talend.daikon.sandbox.SandboxedInstance)27 Ignore (org.junit.Ignore)21 JarRuntimeInfo (org.talend.components.api.component.runtime.JarRuntimeInfo)17 ArrayList (java.util.ArrayList)13 AllSetting (org.talend.components.jdbc.runtime.setting.AllSetting)11 IndexedRecord (org.apache.avro.generic.IndexedRecord)8 ExecutionEngine (org.talend.components.api.component.runtime.ExecutionEngine)8 DatasetRuntime (org.talend.components.common.dataset.runtime.DatasetRuntime)7 URL (java.net.URL)6 Schema (org.apache.avro.Schema)6 ComponentException (org.talend.components.api.exception.ComponentException)5 ValidationResult (org.talend.daikon.properties.ValidationResult)5 File (java.io.File)3 NamedThing (org.talend.daikon.NamedThing)3 SimpleNamedThing (org.talend.daikon.SimpleNamedThing)3 TalendRuntimeException (org.talend.daikon.exception.TalendRuntimeException)3 FileWriter (java.io.FileWriter)2 GenericRecord (org.apache.avro.generic.GenericRecord)2