mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/util/TestMetatypeInformationListener.java
@Test
    public void testHandleMetaTypeProviderServiceRegistration()
    {
        //handle event
        m_Handler.handleEvent(metatypeProviderEvent());
        
        //verify event posted with expected data
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(captor.capture());
        @SuppressWarnings("unchecked")
        List<String> listPids = (List<String>)captor.getValue().getProperty(RemoteMetatypeConstants.EVENT_PROP_PIDS);
        assertThat(listPids, hasItem("pid"));
        assertThat((Long)captor.getValue().getProperty(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(1L));
    }
/**
     * Test service registered event when the service is a metatype provider.
     * Verify event is posted with the pid and bundle ID.
     */
Test service registered event when the service is a metatype provider.
Verify event is posted with the pid and bundle ID.
Test service registered event when the service is a metatype provider . Verify event is posted with the pid and bundle ID .
@Test
    public void testHandleMetaTypeProviderServiceRegistration()
    {
        m_Handler.handleEvent(metatypeProviderEvent());
        ArgumentCaptor<Event> captor = ArgumentCaptor.forClass(Event.class);
        verify(m_EventAdmin).postEvent(captor.capture());
        @SuppressWarnings("unchecked")
        List<String> listPids = (List<String>)captor.getValue().getProperty(RemoteMetatypeConstants.EVENT_PROP_PIDS);
        assertThat(listPids, hasItem("pid"));
        assertThat((Long)captor.getValue().getProperty(RemoteMetatypeConstants.EVENT_PROP_BUNDLE_ID), is(1L));
    }
@ Test public void testHandleMetaTypeProviderServiceRegistration ( ) { m_Handler . handleEvent ( metatypeProviderEvent ( ) ) ; ArgumentCaptor < Event > captor = ArgumentCaptor . forClass ( Event . class ) ; verify ( m_EventAdmin ) . postEvent ( captor . capture ( ) ) ; @ SuppressWarnings ( "unchecked" ) List < String > listPids = ( List < String > ) captor . getValue ( ) . getProperty ( RemoteMetatypeConstants . EVENT_PROP_PIDS ) ; assertThat ( listPids , hasItem ( "pid" ) ) ; assertThat ( ( Long ) captor . getValue ( ) . getProperty ( RemoteMetatypeConstants . EVENT_PROP_BUNDLE_ID ) , is ( 1L ) ) ; }
Test service registered event when the service is a metatype provider.
Test service registered event when the service is a metatype provider .
//handle event //verify event posted with expected data