use of org.pentaho.di.engine.api.events.MetricsEvent in project pentaho-kettle by pentaho.
the class MessageEncoderDecoderTest method testOperationRemoteSource.
@Test
public void testOperationRemoteSource() throws Exception {
RemoteSource step = new RemoteSource(ModelType.OPERATION, "step");
Metrics metrics = new Metrics(1, 2, 3, 4);
Message metricEvent = new MetricsEvent<>(step, metrics);
String sMessage = encoder.encode(metricEvent);
Message decodeMessage = decoder.decode(sMessage);
assertTrue(((RemoteSource) step).getModelType() == ((RemoteSource) ((MetricsEvent) decodeMessage).getSource()).getModelType());
assertTrue(((RemoteSource) step).getId().equals(((RemoteSource) ((MetricsEvent) decodeMessage).getSource()).getId()));
}
use of org.pentaho.di.engine.api.events.MetricsEvent in project pentaho-kettle by pentaho.
the class MessageEncoderDecoderTest method metricsEvent.
private MetricsEvent metricsEvent() {
Operation step1 = new TestOperation("step2");
Operation step2 = new TestOperation("step2");
Operation step3 = new TestOperation("step2");
step1.getTo().add(step2);
step2.getFrom().add(step1);
step2.getTo().add(step3);
step3.getFrom().add(step2);
Metrics metrics = new Metrics(1, 2, 3, 4);
return new MetricsEvent<>(step2, metrics);
}
Aggregations