mil.dod.th.ose.test/src/mil/dod/th/ose/test/BundleContextMocker.java
@SuppressWarnings({"rawtypes", "unchecked"})
    public static EventHandler assertEventHandler(BundleContext context, String topic)
    {
        ArgumentCaptor<Dictionary> propsCap = ArgumentCaptor.forClass(Dictionary.class);
        ArgumentCaptor<EventHandler> handlerCap = ArgumentCaptor.forClass(EventHandler.class);
        verify(context).registerService(eq(EventHandler.class), handlerCap.capture(), propsCap.capture());
        
        EventHandler handler = handlerCap.getValue();
        assertThat("EventHandler exists", handler, is(notNullValue()));
        
        Dictionary props = propsCap.getValue();
        assertThat("Dictionary exists", props, is(notNullValue()));
        assertThat("Topic property", (String)props.get(EventConstants.EVENT_TOPIC), is(topic));
        
        return handler;
    }
/**
     * Asserts that the given context has an {@link EventHandler} register with the given topic.  Service that is 
     * registered is not checked.
     * 
     * Assume a single handler is registered.
     * 
     * @param context
     *      context to check with
     * @param topic
     *      topic that should be in the property map of the registration
     */
Asserts that the given context has an  EventHandler register with the given topic.  Service that is
registered is not checked.

Assume a single handler is registered.

@param context
context to check with
@param topic
topic that should be in the property map of the registration
Asserts that the given context has an EventHandler register with the given topic . Service that is registered is not checked . Assume a single handler is registered . @param context context to check with @param topic topic that should be in the property map of the registration
@SuppressWarnings({"rawtypes", "unchecked"})
    public static EventHandler assertEventHandler(BundleContext context, String topic)
    {
        ArgumentCaptor<Dictionary> propsCap = ArgumentCaptor.forClass(Dictionary.class);
        ArgumentCaptor<EventHandler> handlerCap = ArgumentCaptor.forClass(EventHandler.class);
        verify(context).registerService(eq(EventHandler.class), handlerCap.capture(), propsCap.capture());
        EventHandler handler = handlerCap.getValue();
        assertThat("EventHandler exists", handler, is(notNullValue()));
        Dictionary props = propsCap.getValue();
        assertThat("Dictionary exists", props, is(notNullValue()));
        assertThat("Topic property", (String)props.get(EventConstants.EVENT_TOPIC), is(topic));
        return handler;
    }
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public static EventHandler assertEventHandler ( BundleContext context , String topic ) { ArgumentCaptor < Dictionary > propsCap = ArgumentCaptor . forClass ( Dictionary . class ) ; ArgumentCaptor < EventHandler > handlerCap = ArgumentCaptor . forClass ( EventHandler . class ) ; verify ( context ) . registerService ( eq ( EventHandler . class ) , handlerCap . capture ( ) , propsCap . capture ( ) ) ; EventHandler handler = handlerCap . getValue ( ) ; assertThat ( "EventHandler exists" , handler , is ( notNullValue ( ) ) ) ; Dictionary props = propsCap . getValue ( ) ; assertThat ( "Dictionary exists" , props , is ( notNullValue ( ) ) ) ; assertThat ( "Topic property" , ( String ) props . get ( EventConstants . EVENT_TOPIC ) , is ( topic ) ) ; return handler ; }
Asserts that the given context has an {@link EventHandler} register with the given topic.
Asserts that the given context has an { @link EventHandler } register with the given topic .