mil.dod.th.core/test/mil/dod/th/core/log/TestStaticLogging.java
@Test
    public final void testLogIntThrowableStringObjectArray()
    {
        // replay, make sure the log service isn't set
        m_SUT.setLogService(null);
        
        // mock
        Exception e = new Exception();
        
        // replay
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "hello"), is(false));
        
        // mock
        LogService logService = mock(LogService.class);
        m_SUT.setLogService(logService);
        
        // replay
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "hello"), is(true));
        
        // verify
        verify(logService).log(LogService.LOG_DEBUG, "!hello", e);
        
        // replay
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "some %s %d u", "message", 4), is(true));
        
        // verify
        verify(logService).log(LogService.LOG_DEBUG, "!some message 4 u", e);
        
        m_SUT.unsetLogService(logService);
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "hello"), is(false));
    }
/**
     * Verify that the logging service can log permutations of exception messages.
     * Verify that if the LogService is not set that messages cannot be logged.
     */
Verify that the logging service can log permutations of exception messages.
Verify that if the LogService is not set that messages cannot be logged.
Verify that the logging service can log permutations of exception messages . Verify that if the LogService is not set that messages cannot be logged .
@Test
    public final void testLogIntThrowableStringObjectArray()
    {
        m_SUT.setLogService(null);
        Exception e = new Exception();
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "hello"), is(false));
        LogService logService = mock(LogService.class);
        m_SUT.setLogService(logService);
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "hello"), is(true));
        verify(logService).log(LogService.LOG_DEBUG, "!hello", e);
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "some %s %d u", "message", 4), is(true));
        verify(logService).log(LogService.LOG_DEBUG, "!some message 4 u", e);
        m_SUT.unsetLogService(logService);
        assertThat(Logging.log(LogService.LOG_DEBUG, e, "hello"), is(false));
    }
@ Test public final void testLogIntThrowableStringObjectArray ( ) { m_SUT . setLogService ( null ) ; Exception e = new Exception ( ) ; assertThat ( Logging . log ( LogService . LOG_DEBUG , e , "hello" ) , is ( false ) ) ; LogService logService = mock ( LogService . class ) ; m_SUT . setLogService ( logService ) ; assertThat ( Logging . log ( LogService . LOG_DEBUG , e , "hello" ) , is ( true ) ) ; verify ( logService ) . log ( LogService . LOG_DEBUG , "!hello" , e ) ; assertThat ( Logging . log ( LogService . LOG_DEBUG , e , "some %s %d u" , "message" , 4 ) , is ( true ) ) ; verify ( logService ) . log ( LogService . LOG_DEBUG , "!some message 4 u" , e ) ; m_SUT . unsetLogService ( logService ) ; assertThat ( Logging . log ( LogService . LOG_DEBUG , e , "hello" ) , is ( false ) ) ; }
Verify that the logging service can log permutations of exception messages.
Verify that the logging service can log permutations of exception messages .
// replay, make sure the log service isn't set // mock // replay // mock // replay // verify // replay // verify