Search in sources :

Example 6 with TransExecutionConfiguration

use of org.pentaho.di.trans.TransExecutionConfiguration in project pentaho-kettle by pentaho.

the class DefaultRunConfigurationExecutorTest method testExecuteClusteredTrans.

@Test
public void testExecuteClusteredTrans() throws Exception {
    DefaultRunConfiguration defaultRunConfiguration = new DefaultRunConfiguration();
    defaultRunConfiguration.setName("Default Configuration");
    defaultRunConfiguration.setLocal(false);
    defaultRunConfiguration.setRemote(false);
    defaultRunConfiguration.setClustered(true);
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    defaultRunConfigurationExecutor.execute(defaultRunConfiguration, transExecutionConfiguration, abstractMeta, variableSpace, null);
    assertTrue(transExecutionConfiguration.isExecutingClustered());
    assertFalse(transExecutionConfiguration.isExecutingRemotely());
    assertFalse(transExecutionConfiguration.isExecutingLocally());
}
Also used : TransExecutionConfiguration(org.pentaho.di.trans.TransExecutionConfiguration) Test(org.junit.Test)

Example 7 with TransExecutionConfiguration

use of org.pentaho.di.trans.TransExecutionConfiguration in project pentaho-kettle by pentaho.

the class DefaultRunConfigurationExecutorTest method testExecuteRemoteNotFoundTrans.

@Test
public void testExecuteRemoteNotFoundTrans() throws Exception {
    DefaultRunConfiguration defaultRunConfiguration = new DefaultRunConfiguration();
    defaultRunConfiguration.setName("Default Configuration");
    defaultRunConfiguration.setLocal(false);
    defaultRunConfiguration.setRemote(true);
    defaultRunConfiguration.setServer("Test Server");
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    doReturn(slaveServer).when(abstractMeta).findSlaveServer(null);
    try {
        defaultRunConfigurationExecutor.execute(defaultRunConfiguration, transExecutionConfiguration, abstractMeta, variableSpace, null);
        fail();
    } catch (KettleException e) {
    // expected
    }
}
Also used : TransExecutionConfiguration(org.pentaho.di.trans.TransExecutionConfiguration) KettleException(org.pentaho.di.core.exception.KettleException) Test(org.junit.Test)

Example 8 with TransExecutionConfiguration

use of org.pentaho.di.trans.TransExecutionConfiguration in project pentaho-kettle by pentaho.

the class SparkRunConfigurationExecutorTest method testWebSocketVersionExecute.

@Test
public void testWebSocketVersionExecute() {
    SparkRunConfiguration sparkRunConfiguration = new SparkRunConfiguration();
    sparkRunConfiguration.setName("Spark Configuration");
    sparkRunConfiguration.setSchema("http://");
    sparkRunConfiguration.setUrl("127.0.0.2:8121");
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    sparkRunConfigurationExecutor.execute(sparkRunConfiguration, transExecutionConfiguration, abstractMeta, variableSpace, null);
    verify(variableSpace).setVariable("engine", "remote");
    verify(variableSpace).setVariable("engine.remote", "spark");
    verify(variableSpace).setVariable("engine.host", "127.0.0.2");
    verify(variableSpace).setVariable("engine.port", "8121");
}
Also used : TransExecutionConfiguration(org.pentaho.di.trans.TransExecutionConfiguration) Test(org.junit.Test)

Example 9 with TransExecutionConfiguration

use of org.pentaho.di.trans.TransExecutionConfiguration in project pentaho-kettle by pentaho.

the class SparkRunConfigurationExecutorTest method testWebSocketVersionExecuteNoPort.

@Test
public void testWebSocketVersionExecuteNoPort() {
    SparkRunConfiguration sparkRunConfiguration = new SparkRunConfiguration();
    sparkRunConfiguration.setName("Spark Configuration");
    doReturn("2.0").when(variableSpace).getVariable("KETTLE_AEL_PDI_DAEMON_VERSION", "2.0");
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    sparkRunConfigurationExecutor.execute(sparkRunConfiguration, transExecutionConfiguration, abstractMeta, variableSpace, null);
    verify(variableSpace).setVariable("engine", "remote");
    verify(variableSpace).setVariable("engine.remote", "spark");
    verify(variableSpace).setVariable("engine.protocol", SparkRunConfigurationExecutor.DEFAULT_PROTOCOL);
    verify(variableSpace).setVariable("engine.host", SparkRunConfigurationExecutor.DEFAULT_HOST);
    verify(variableSpace).setVariable("engine.port", SparkRunConfigurationExecutor.DEFAULT_WEBSOCKET_PORT);
}
Also used : TransExecutionConfiguration(org.pentaho.di.trans.TransExecutionConfiguration) Test(org.junit.Test)

Example 10 with TransExecutionConfiguration

use of org.pentaho.di.trans.TransExecutionConfiguration in project pentaho-kettle by pentaho.

the class SparkRunConfigurationExecutorTest method testUrlWssWebSocketVersionExecute.

@Test
public void testUrlWssWebSocketVersionExecute() {
    SparkRunConfiguration sparkRunConfiguration = new SparkRunConfiguration();
    sparkRunConfiguration.setName("Spark Configuration");
    sparkRunConfiguration.setSchema("http://");
    sparkRunConfiguration.setUrl("  127.0.0.2:8121  ");
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    sparkRunConfigurationExecutor.execute(sparkRunConfiguration, transExecutionConfiguration, abstractMeta, variableSpace, null);
    verify(variableSpace).setVariable("engine.protocol", "http");
    verify(variableSpace).setVariable("engine.host", "127.0.0.2");
    verify(variableSpace).setVariable("engine.port", "8121");
}
Also used : TransExecutionConfiguration(org.pentaho.di.trans.TransExecutionConfiguration) Test(org.junit.Test)

Aggregations

TransExecutionConfiguration (org.pentaho.di.trans.TransExecutionConfiguration)47 TransMeta (org.pentaho.di.trans.TransMeta)24 Test (org.junit.Test)16 Trans (org.pentaho.di.trans.Trans)14 TransSplitter (org.pentaho.di.trans.cluster.TransSplitter)14 KettleException (org.pentaho.di.core.exception.KettleException)13 LogChannel (org.pentaho.di.core.logging.LogChannel)13 TransConfiguration (org.pentaho.di.trans.TransConfiguration)12 SimpleLoggingObject (org.pentaho.di.core.logging.SimpleLoggingObject)7 IOException (java.io.IOException)6 PrintWriter (java.io.PrintWriter)6 ServletException (javax.servlet.ServletException)5 FileObject (org.apache.commons.vfs2.FileObject)5 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)4 Repository (org.pentaho.di.repository.Repository)4 Result (org.pentaho.di.core.Result)3 LogChannelFileWriter (org.pentaho.di.core.logging.LogChannelFileWriter)3 Job (org.pentaho.di.job.Job)3 TransAdapter (org.pentaho.di.trans.TransAdapter)3 OutputStream (java.io.OutputStream)2