mil.dod.th.ose.logging/test/mil/dod/th/ose/logging/TestJavaLoggerBridge.java
@Test
    public void testActivateDisabledFrameworkProp()
    {
        m_Logger.info("test disabled");
        assertThat(new String(m_OutputStream.toByteArray()), containsString("test disabled"));
        
        //activate with framework property disabled.
        when(m_Context.getProperty(ENABLED_PROP)).thenReturn("false");
        
        m_SUT.activate(m_Context);
        
        verify(m_LoggingService, never()).log(LogService.LOG_INFO, "test disabled");
        
        m_Logger.info("disabled message");
        assertThat(new String(m_OutputStream.toByteArray()), containsString("disabled message"));
        verify(m_LoggingService, never()).log(LogService.LOG_INFO, "disabled message");
    }
/**
     * Test that JUL to OSGi logging is disabled when enabled property is set to false. 
     * (i.e. "disabled message" does not appear in the OSGi log service)
     */
Test that JUL to OSGi logging is disabled when enabled property is set to false.
Test that JUL to OSGi logging is disabled when enabled property is set to false .
@Test
    public void testActivateDisabledFrameworkProp()
    {
        m_Logger.info("test disabled");
        assertThat(new String(m_OutputStream.toByteArray()), containsString("test disabled"));
        when(m_Context.getProperty(ENABLED_PROP)).thenReturn("false");
        m_SUT.activate(m_Context);
        verify(m_LoggingService, never()).log(LogService.LOG_INFO, "test disabled");
        m_Logger.info("disabled message");
        assertThat(new String(m_OutputStream.toByteArray()), containsString("disabled message"));
        verify(m_LoggingService, never()).log(LogService.LOG_INFO, "disabled message");
    }
@ Test public void testActivateDisabledFrameworkProp ( ) { m_Logger . info ( "test disabled" ) ; assertThat ( new String ( m_OutputStream . toByteArray ( ) ) , containsString ( "test disabled" ) ) ; when ( m_Context . getProperty ( ENABLED_PROP ) ) . thenReturn ( "false" ) ; m_SUT . activate ( m_Context ) ; verify ( m_LoggingService , never ( ) ) . log ( LogService . LOG_INFO , "test disabled" ) ; m_Logger . info ( "disabled message" ) ; assertThat ( new String ( m_OutputStream . toByteArray ( ) ) , containsString ( "disabled message" ) ) ; verify ( m_LoggingService , never ( ) ) . log ( LogService . LOG_INFO , "disabled message" ) ; }
Test that JUL to OSGi logging is disabled when enabled property is set to false.
Test that JUL to OSGi logging is disabled when enabled property is set to false .
//activate with framework property disabled.