Search in sources :

Example 1 with StatusEvent

use of org.pentaho.di.engine.api.events.StatusEvent in project pentaho-kettle by pentaho.

the class MessageEncoderDecoderTest method testTransformationRemoteSource.

@Test
public void testTransformationRemoteSource() throws Exception {
    RemoteSource step = new RemoteSource(ModelType.TRANSFORMATION);
    Metrics metrics = new Metrics(1, 2, 3, 4);
    Message statusEvent = new StatusEvent<>(step, Status.FAILED);
    String sMessage = encoder.encode(statusEvent);
    Message decodeMessage = decoder.decode(sMessage);
    assertTrue(((RemoteSource) step).getModelType() == ((RemoteSource) ((StatusEvent) decodeMessage).getSource()).getModelType());
    assertNull(((RemoteSource) ((StatusEvent) decodeMessage).getSource()).getId());
}
Also used : Metrics(org.pentaho.di.engine.api.reporting.Metrics) StatusEvent(org.pentaho.di.engine.api.events.StatusEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StatusEvent (org.pentaho.di.engine.api.events.StatusEvent)1 Metrics (org.pentaho.di.engine.api.reporting.Metrics)1