Search in sources :

Example 6 with LoggingObject

use of org.pentaho.di.core.logging.LoggingObject in project pentaho-kettle by pentaho.

the class SubtransExecutorTest method doesNotExecuteWhenStopped.

@Test
public void doesNotExecuteWhenStopped() throws KettleException {
    TransMeta parentMeta = new TransMeta(this.getClass().getResource("subtrans-executor-parent.ktr").getPath(), new Variables());
    TransMeta subMeta = new TransMeta(this.getClass().getResource("subtrans-executor-sub.ktr").getPath(), new Variables());
    LoggingObjectInterface loggingObject = new LoggingObject("anything");
    Trans parentTrans = new Trans(parentMeta, loggingObject);
    SubtransExecutor subtransExecutor = new SubtransExecutor("subtransname", parentTrans, subMeta, true, new TransExecutorParameters(), "");
    RowMetaInterface rowMeta = parentMeta.getStepFields("Data Grid");
    List<RowMetaAndData> rows = Arrays.asList(new RowMetaAndData(rowMeta, "Pentaho", 1L), new RowMetaAndData(rowMeta, "Pentaho", 2L), new RowMetaAndData(rowMeta, "Pentaho", 3L), new RowMetaAndData(rowMeta, "Pentaho", 4L));
    subtransExecutor.stop();
    subtransExecutor.execute(rows);
    verify(this.logChannel, never()).logBasic("\n" + "------------> Linenr 1------------------------------\n" + "name = Pentaho\n" + "sum = 10\n" + "\n" + "====================");
}
Also used : Variables(org.pentaho.di.core.variables.Variables) RowMetaAndData(org.pentaho.di.core.RowMetaAndData) LoggingObject(org.pentaho.di.core.logging.LoggingObject) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) LoggingObjectInterface(org.pentaho.di.core.logging.LoggingObjectInterface) TransExecutorParameters(org.pentaho.di.trans.steps.transexecutor.TransExecutorParameters) Test(org.junit.Test)

Aggregations

LoggingObject (org.pentaho.di.core.logging.LoggingObject)6 Test (org.junit.Test)4 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)3 LoggingObjectInterface (org.pentaho.di.core.logging.LoggingObjectInterface)3 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)3 Variables (org.pentaho.di.core.variables.Variables)3 TransExecutorParameters (org.pentaho.di.trans.steps.transexecutor.TransExecutorParameters)3 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 Shell (org.eclipse.swt.widgets.Shell)1 Result (org.pentaho.di.core.Result)1 Database (org.pentaho.di.core.database.Database)1 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)1 Trans (org.pentaho.di.trans.Trans)1 TransMeta (org.pentaho.di.trans.TransMeta)1 TransProfileFactory (org.pentaho.di.trans.TransProfileFactory)1 StepStatus (org.pentaho.di.trans.step.StepStatus)1 EnterTextDialog (org.pentaho.di.ui.core.dialog.EnterTextDialog)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1