Search in sources :

Example 21 with Operation

use of org.pentaho.metaverse.api.model.Operation in project pentaho-metaverse by pentaho.

the class ComponentDerivationRecordTest method testHasDelta.

@Test
public void testHasDelta() throws Exception {
    Operations operations = record.getOperations();
    assertNotNull(operations);
    assertTrue(operations.isEmpty());
    assertFalse("This record should not say it has been changed!", record.hasDelta());
    record.addOperation(new Operation("testOperation", "testOperand"));
    assertTrue("This record should say it has been changed!", record.hasDelta());
}
Also used : IOperation(org.pentaho.metaverse.api.model.IOperation) Operation(org.pentaho.metaverse.api.model.Operation) Operations(org.pentaho.metaverse.api.model.Operations) Test(org.junit.Test)

Example 22 with Operation

use of org.pentaho.metaverse.api.model.Operation in project pentaho-metaverse by pentaho.

the class ComponentDerivationRecordTest method testPutOperationNullOperands.

@Test
public void testPutOperationNullOperands() throws Exception {
    Operations operations = record.getOperations();
    assertNotNull(operations);
    assertTrue(operations.isEmpty());
    record.addOperation(new Operation("testOperation", null));
    operations = record.getOperations();
    assertNotNull(operations);
    List<IOperation> checkOperands = operations.get("testOperation");
    assertNull(checkOperands);
}
Also used : IOperation(org.pentaho.metaverse.api.model.IOperation) IOperation(org.pentaho.metaverse.api.model.IOperation) Operation(org.pentaho.metaverse.api.model.Operation) Operations(org.pentaho.metaverse.api.model.Operations) Test(org.junit.Test)

Aggregations

Operation (org.pentaho.metaverse.api.model.Operation)22 Test (org.junit.Test)12 ComponentDerivationRecord (org.pentaho.metaverse.api.analyzer.kettle.ComponentDerivationRecord)11 IOperation (org.pentaho.metaverse.api.model.IOperation)10 Operations (org.pentaho.metaverse.api.model.Operations)10 HashSet (java.util.HashSet)7 ArrayList (java.util.ArrayList)1 Condition (org.pentaho.di.core.Condition)1 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)1 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)1 NumberRangeRule (org.pentaho.di.trans.steps.numberrange.NumberRangeRule)1 SelectMetadataChange (org.pentaho.di.trans.steps.selectvalues.SelectMetadataChange)1 IMetaverseNode (org.pentaho.metaverse.api.IMetaverseNode)1 StepField (org.pentaho.metaverse.api.StepField)1