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