mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/base/TestBaseMessageService.java
@Test
    public void testActivateDeactivate()
    {
        // mock context and activate
        BundleContext context = mock(BundleContext.class);
        Bundle systemBundle = mock(Bundle.class);
        when(context.getBundle(0)).thenReturn(systemBundle); // system bundle is always id 0
        
        m_SUT.activate(context);
        
        // verify service is bound
        verify(m_MessageRouter).bindMessageService(m_SUT);
        
        m_SUT.deactivate();
        
        // verify service is unbound
        verify(m_MessageRouter).unbindMessageService(m_SUT);
    }
/**
     * Verify message service is registered on activation and unregistered on deactivation.
     */
Verify message service is registered on activation and unregistered on deactivation.
Verify message service is registered on activation and unregistered on deactivation .
@Test
    public void testActivateDeactivate()
    {
        BundleContext context = mock(BundleContext.class);
        Bundle systemBundle = mock(Bundle.class);
        when(context.getBundle(0)).thenReturn(systemBundle); 
        m_SUT.activate(context);
        verify(m_MessageRouter).bindMessageService(m_SUT);
        m_SUT.deactivate();
        verify(m_MessageRouter).unbindMessageService(m_SUT);
    }
@ Test public void testActivateDeactivate ( ) { BundleContext context = mock ( BundleContext . class ) ; Bundle systemBundle = mock ( Bundle . class ) ; when ( context . getBundle ( 0 ) ) . thenReturn ( systemBundle ) ; m_SUT . activate ( context ) ; verify ( m_MessageRouter ) . bindMessageService ( m_SUT ) ; m_SUT . deactivate ( ) ; verify ( m_MessageRouter ) . unbindMessageService ( m_SUT ) ; }
Verify message service is registered on activation and unregistered on deactivation.
Verify message service is registered on activation and unregistered on deactivation .
// mock context and activate // system bundle is always id 0 // verify service is bound // verify service is unbound