Search in sources :

Example 1 with LogEvent

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

the class MessageEventServiceTest method testOperationFireEventThrowException.

@Test(expected = MessageEventFireEventException.class)
public void testOperationFireEventThrowException() throws KettleException {
    addHandlers(operationMessageEvent, messageEventHandler, messageEventHandler2);
    doThrow(new RuntimeException("Test")).when(messageEventHandler).execute(any(Message.class));
    LogEvent logEvent = new LogEvent<>(new RemoteSource(ModelType.OPERATION, "Operation_ID"), logEntry);
    messageEventService.fireEvent(logEvent);
    verify(messageEventHandler, never()).execute(logEvent);
    verify(messageEventHandler2).execute(logEvent);
}
Also used : StopMessage(org.pentaho.di.engine.api.remote.StopMessage) Message(org.pentaho.di.engine.api.remote.Message) RemoteSource(org.pentaho.di.engine.api.remote.RemoteSource) LogEvent(org.pentaho.di.engine.api.events.LogEvent) Test(org.junit.Test)

Example 2 with LogEvent

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

the class MessageEventServiceTest method testTransformationFireEvent.

@Test
public void testTransformationFireEvent() throws Exception {
    addHandlers(transformationMessageEvent, messageEventHandler, messageEventHandler2);
    LogEvent logEvent = new LogEvent<>(new RemoteSource(ModelType.TRANSFORMATION, "Operation_ID"), logEntry);
    messageEventService.fireEvent(logEvent);
    verify(messageEventHandler).execute(logEvent);
    verify(messageEventHandler2).execute(logEvent);
}
Also used : RemoteSource(org.pentaho.di.engine.api.remote.RemoteSource) LogEvent(org.pentaho.di.engine.api.events.LogEvent) Test(org.junit.Test)

Example 3 with LogEvent

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

the class MessageEventServiceTest method testOperationFireEvent.

@Test
public void testOperationFireEvent() throws KettleException {
    addHandlers(operationMessageEvent, messageEventHandler, messageEventHandler2);
    LogEvent logEvent = new LogEvent<>(new RemoteSource(ModelType.OPERATION, "Operation_ID"), logEntry);
    messageEventService.fireEvent(logEvent);
    verify(messageEventHandler).execute(logEvent);
    verify(messageEventHandler2).execute(logEvent);
}
Also used : RemoteSource(org.pentaho.di.engine.api.remote.RemoteSource) LogEvent(org.pentaho.di.engine.api.events.LogEvent) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 LogEvent (org.pentaho.di.engine.api.events.LogEvent)3 RemoteSource (org.pentaho.di.engine.api.remote.RemoteSource)3 Message (org.pentaho.di.engine.api.remote.Message)1 StopMessage (org.pentaho.di.engine.api.remote.StopMessage)1