### Question:
Log4jLogging implements LoggingPluginInterface { @Override public void eventAdded( KettleLoggingEvent event ) { switch ( event.getLevel() ) { case ERROR: pentahoLogger.log( Level.ERROR, event.getMessage() ); break; case DEBUG: case ROWLEVEL: pentahoLogger.log( Level.DEBUG, event.getMessage() ); break; default: pentahoLogger.log( Level.INFO, event.getMessage() ); break; } } Log4jLogging(); @Override void eventAdded( KettleLoggingEvent event ); @Override void init(); void dispose(); static final String PLUGIN_PROPERTIES_FILE; static final String STRING_PENTAHO_DI_LOGGER_NAME; static final String STRING_PENTAHO_DI_CONSOLE_APPENDER; }### Answer:
@Test public void eventAddedError() { log4jPlugin.eventAdded( new KettleLoggingEvent( "ERROR_TEST_MESSAGE", 0L, LogLevel.ERROR ) ); verify( logger ).log( Level.ERROR, "ERROR_TEST_MESSAGE" ); }
@Test public void eventAddedDebug() { log4jPlugin.eventAdded( new KettleLoggingEvent( "DEBUG_TEST_MESSAGE", 0L, LogLevel.DEBUG ) ); verify( logger ).log( Level.DEBUG, "DEBUG_TEST_MESSAGE" ); }
@Test public void eventAddedDetailed() { log4jPlugin.eventAdded( new KettleLoggingEvent( "DETAILED_TEST_MESSAGE", 0L, LogLevel.DETAILED ) ); verify( logger ).log( Level.INFO, "DETAILED_TEST_MESSAGE" ); }
@Test public void eventAddedRowLevel() { log4jPlugin.eventAdded( new KettleLoggingEvent( "ROWLEVEL_TEST_MESSAGE", 0L, LogLevel.ROWLEVEL ) ); verify( logger ).log( Level.DEBUG, "ROWLEVEL_TEST_MESSAGE" ); }
@Test public void eventAddedBasic() { log4jPlugin.eventAdded( new KettleLoggingEvent( "BASIC_TEST_MESSAGE", 0L, LogLevel.BASIC ) ); verify( logger ).log( Level.INFO, "BASIC_TEST_MESSAGE" ); }
@Test public void eventAddedMinimal() { log4jPlugin.eventAdded( new KettleLoggingEvent( "MINIMAL_TEST_MESSAGE", 0L, LogLevel.MINIMAL ) ); verify( logger ).log( Level.INFO, "MINIMAL_TEST_MESSAGE" ); }