Search in sources :

Example 21 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class NetSuiteInputDefinitionTest method testRuntimeInfo.

@Test
public void testRuntimeInfo() {
    NetSuiteInputProperties properties = new NetSuiteInputProperties("test");
    properties.initForRuntime();
    RuntimeInfo runtimeInfo = definition.getRuntimeInfo(ExecutionEngine.DI, properties, ConnectorTopology.OUTGOING);
    assertNotNull(runtimeInfo);
    assertThat(runtimeInfo, instanceOf(JarRuntimeInfo.class));
    JarRuntimeInfo jarRuntimeInfo = (JarRuntimeInfo) runtimeInfo;
    assertThat(jarRuntimeInfo.getRuntimeClassName(), endsWith(".NetSuiteSourceImpl"));
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) Test(org.junit.Test)

Example 22 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class NetSuiteRuntimeInfoTest method testRuntimeVersion.

public void testRuntimeVersion(String apiVersion) throws Exception {
    NetSuiteConnectionProperties connProps = new NetSuiteConnectionProperties("test");
    connProps.setupProperties();
    connProps.endpoint.setValue("https://webservices.netsuite.com/services/NetSuitePort_" + apiVersion);
    connProps.apiVersion.setValue(NetSuiteVersion.detectVersion(connProps.endpoint.getStringValue()).getMajorAsString("."));
    RuntimeInfo runtimeInfo = NetSuiteComponentDefinition.getRuntimeInfo(connProps, NetSuiteComponentDefinition.RUNTIME_CLASS);
    assertNotNull(runtimeInfo);
    assertThat(runtimeInfo, instanceOf(JarRuntimeInfo.class));
    JarRuntimeInfo jarRuntimeInfo = (JarRuntimeInfo) runtimeInfo;
    assertNotNull(jarRuntimeInfo.getJarUrl());
    assertNotNull(jarRuntimeInfo.getDepTxtPath());
    assertEquals(jarRuntimeInfo.getRuntimeClassName(), "org.talend.components.netsuite.v" + apiVersion + ".NetSuiteRuntimeImpl");
}
Also used : RuntimeInfo(org.talend.daikon.runtime.RuntimeInfo) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) NetSuiteConnectionProperties(org.talend.components.netsuite.connection.NetSuiteConnectionProperties) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo)

Example 23 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class BigQueryOutputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        return new JarRuntimeInfo(new URL("mvn:org.talend.components/bigquery-runtime"), DependenciesReader.computeDependenciesFilePath("org.talend.components", "bigquery-runtime"), RUNTIME);
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Example 24 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class BigQueryInputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        return new JarRuntimeInfo(new URL("mvn:org.talend.components/bigquery-runtime"), DependenciesReader.computeDependenciesFilePath("org.talend.components", "bigquery-runtime"), RUNTIME);
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Example 25 with JarRuntimeInfo

use of org.talend.components.api.component.runtime.JarRuntimeInfo in project components by Talend.

the class S3InputDefinition method getRuntimeInfo.

@Override
public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
    assertEngineCompatibility(engine);
    assertConnectorTopologyCompatibility(connectorTopology);
    try {
        return new JarRuntimeInfo(new URL(SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_URI), DependenciesReader.computeDependenciesFilePath(SimpleFileIOComponentFamilyDefinition.MAVEN_GROUP_ID, SimpleFileIOComponentFamilyDefinition.MAVEN_DEFAULT_RUNTIME_ARTIFACT_ID), RUNTIME);
    } catch (MalformedURLException e) {
        throw new ComponentException(e);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) ComponentException(org.talend.components.api.exception.ComponentException) JarRuntimeInfo(org.talend.components.api.component.runtime.JarRuntimeInfo) URL(java.net.URL)

Aggregations

JarRuntimeInfo (org.talend.components.api.component.runtime.JarRuntimeInfo)44 URL (java.net.URL)28 MalformedURLException (java.net.MalformedURLException)27 ComponentException (org.talend.components.api.exception.ComponentException)27 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)7 Test (org.junit.Test)5 File (java.io.File)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Bundle (org.osgi.framework.Bundle)1 BusinessException (org.talend.commons.exception.BusinessException)1 ConnectorTopology (org.talend.components.api.component.ConnectorTopology)1 NetSuiteConnectionProperties (org.talend.components.netsuite.connection.NetSuiteConnectionProperties)1 ModuleNeeded (org.talend.core.model.general.ModuleNeeded)1 MavenArtifact (org.talend.core.runtime.maven.MavenArtifact)1