Search in sources :

Example 81 with RuntimeInfo

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

the class SimpleFileIODatastoreRuntimeTest method testRuntimeInfo.

/**
 * Checks the {@link RuntimeInfo} of the definition.
 */
@Test
@Ignore("This can't work unless the runtime jar is already installed in maven!")
public void testRuntimeInfo() throws MalformedURLException {
    RuntimeInfo runtimeInfo = def.getRuntimeInfo(null);
    // We test the maven dependencies in this runtime class, where they are available.
    List<URL> dependencies = runtimeInfo.getMavenUrlDependencies();
    assertThat(dependencies, notNullValue());
    assertThat(dependencies, hasItem(new URL("mvn:org.apache.commons/commons-csv/1.4/jar")));
    assertThat(dependencies, hasSize(greaterThan(100)));
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) URL(java.net.URL) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 82 with RuntimeInfo

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

the class SimpleFileIODatastoreDefinitionTest 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.SimpleFileIODatastoreRuntime"));
// 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 83 with RuntimeInfo

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

the class S3InputDefinitionTest method testRuntimeInfo.

/**
 * Checks the {@link RuntimeInfo} of the definition.
 */
@Test
public void testRuntimeInfo() {
    RuntimeInfo runtimeInfo = def.getRuntimeInfo(ExecutionEngine.BEAM, null, ConnectorTopology.OUTGOING);
    assertThat(runtimeInfo.getRuntimeClassName(), is("org.talend.components.simplefileio.runtime.s3.S3InputRuntime"));
// 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 84 with RuntimeInfo

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

the class JDBCDatasetProperties method updateSchema.

public void updateSchema() {
    JDBCDatasetDefinition definition = new JDBCDatasetDefinition();
    RuntimeInfo runtimeInfo = definition.getRuntimeInfo(this);
    try (SandboxedInstance sandboxedInstance = RuntimeUtil.createRuntimeClass(runtimeInfo, getClass().getClassLoader())) {
        DatasetRuntime<JDBCDatasetProperties> runtime = (DatasetRuntime) sandboxedInstance.getInstance();
        runtime.initialize(null, this);
        Schema schema = runtime.getSchema();
        main.schema.setValue(schema);
    }
}
Also used : SandboxedInstance(org.talend.daikon.sandbox.SandboxedInstance) RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) DatasetRuntime(org.talend.components.common.dataset.runtime.DatasetRuntime) Schema(org.apache.avro.Schema)

Example 85 with RuntimeInfo

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

the class HadoopClusterConfigurationInputDefinitionTest method testRuntimeInfo.

@Test
@Ignore("This can't work unless the runtime jar is already installed in maven!")
public void testRuntimeInfo() {
    HadoopClusterConfigurationInputProperties properties = new HadoopClusterConfigurationInputProperties("properties");
    properties.init();
    RuntimeInfo runtimeInfo = inputDefinition.getRuntimeInfo(ExecutionEngine.DI, properties, null);
    assertEquals("org.talend.components.hadoopcluster.runtime.configuration.input.ClouderaManagerConfigurationSource", runtimeInfo.getRuntimeClassName());
    properties.clusterManagerType.setValue(HadoopClusterConfigurationInputProperties.ClusterManagerType.AMBARI);
    runtimeInfo = inputDefinition.getRuntimeInfo(ExecutionEngine.DI, properties, null);
    assertEquals("org.talend.components.hadoopcluster.runtime.configuration.input.AmbariConfigurationSource", runtimeInfo.getRuntimeClassName());
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) Ignore(org.junit.Ignore) 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