Java Code Examples for org.pentaho.di.trans.step.StepInterface#getStepname()

The following examples show how to use org.pentaho.di.trans.step.StepInterface#getStepname() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransWebSocketEngineAdapterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void testLoggingOnStep() throws KettleException {
  TransMeta transMeta = new TransMeta( getClass().getResource( "grid-to-subtrans.ktr" ).getPath() );
  TransWebSocketEngineAdapter adapter =
    new TransWebSocketEngineAdapter( transMeta, "", 0, false );
  adapter.setLog( logChannel );
  adapter.prepareExecution( new String[]{} );
  StepInterface stepInterface = adapter.getStepInterface( "Data Grid", 0 );
  LogEntry errorLog = LogEntry.LogEntryBuilder.aLogEntry().withLogLevel( LogLevel.BASIC ).build();
  Message errorMessage = new LogEvent( new RemoteSource( ModelType.OPERATION, stepInterface.getStepname() ) , errorLog );
  adapter.messageEventService.fireEvent( errorMessage );

  assertEquals( 0, stepInterface.getErrors() );
  assertFalse( stepInterface.isStopped() );
}
 
Example 2
Source File: TransWebSocketEngineAdapterTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void testErrorLoggingOnStep() throws KettleException {
  TransMeta transMeta = new TransMeta( getClass().getResource( "grid-to-subtrans.ktr" ).getPath() );
  TransWebSocketEngineAdapter adapter =
    new TransWebSocketEngineAdapter( transMeta, "", 0, false );
  adapter.setLog( logChannel );
  adapter.prepareExecution( new String[]{} );
  StepInterface stepInterface = adapter.getStepInterface( "Data Grid", 0 );
  LogEntry errorLog = LogEntry.LogEntryBuilder.aLogEntry().withLogLevel( LogLevel.ERROR ).build();
  Message errorMessage = new LogEvent( new RemoteSource( ModelType.OPERATION, stepInterface.getStepname() ) , errorLog );
  adapter.messageEventService.fireEvent( errorMessage );

  assertEquals( 1, stepInterface.getErrors() );
  assertTrue( stepInterface.isStopped() );
}