mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/advanced/configuration/TestSystemConfigurationImpl.java
@Test
    @SuppressWarnings("unchecked")
    public void testRegisterEventHandler() throws SecurityException, NoSuchFieldException, IllegalArgumentException, 
        IllegalAccessException, InvalidProtocolBufferException
    {
        EventRegistrationResponseData regResponse = EventRegistrationResponseData.newBuilder().setId(5).build();
        EventAdminNamespace namepsace = EventAdminNamespace.newBuilder().setData(regResponse.toByteString()).setType(
                EventAdminMessageType.EventRegistrationResponse).build();
        TerraHarvestMessage thMessage = TerraHarvestMessageHelper.createTerraHarvestMessage(25, 0, 
                Namespace.EventAdmin, 5000, namepsace);
        TerraHarvestPayload payload = TerraHarvestPayload.parseFrom(thMessage.getTerraHarvestPayload());
        
        RegisterEventsResponseHandler handler = m_SUT.new RegisterEventsResponseHandler();
        
        handler.handleResponse(thMessage, payload, null, regResponse);
        
        Field field = m_SUT.getClass().getDeclaredField("m_EventRegistraionIds");
        field.setAccessible(true);
        
        Map<Integer, Integer> regIdMap = (Map<Integer, Integer>)field.get(m_SUT);
        
        assertThat(regIdMap.containsKey(25), is(true));
        assertThat(regIdMap.get(25), is(5));
    }
/**
     * Test the register event handler.
     * Verify that the event registration ID is added to the list of registration event IDs.
     */
Test the register event handler.
Verify that the event registration ID is added to the list of registration event IDs.
Test the register event handler . Verify that the event registration ID is added to the list of registration event IDs .
@Test
    @SuppressWarnings("unchecked")
    public void testRegisterEventHandler() throws SecurityException, NoSuchFieldException, IllegalArgumentException, 
        IllegalAccessException, InvalidProtocolBufferException
    {
        EventRegistrationResponseData regResponse = EventRegistrationResponseData.newBuilder().setId(5).build();
        EventAdminNamespace namepsace = EventAdminNamespace.newBuilder().setData(regResponse.toByteString()).setType(
                EventAdminMessageType.EventRegistrationResponse).build();
        TerraHarvestMessage thMessage = TerraHarvestMessageHelper.createTerraHarvestMessage(25, 0, 
                Namespace.EventAdmin, 5000, namepsace);
        TerraHarvestPayload payload = TerraHarvestPayload.parseFrom(thMessage.getTerraHarvestPayload());
        RegisterEventsResponseHandler handler = m_SUT.new RegisterEventsResponseHandler();
        handler.handleResponse(thMessage, payload, null, regResponse);
        Field field = m_SUT.getClass().getDeclaredField("m_EventRegistraionIds");
        field.setAccessible(true);
        Map<Integer, Integer> regIdMap = (Map<Integer, Integer>)field.get(m_SUT);
        assertThat(regIdMap.containsKey(25), is(true));
        assertThat(regIdMap.get(25), is(5));
    }
@ Test @ SuppressWarnings ( "unchecked" ) public void testRegisterEventHandler ( ) throws SecurityException , NoSuchFieldException , IllegalArgumentException , IllegalAccessException , InvalidProtocolBufferException { EventRegistrationResponseData regResponse = EventRegistrationResponseData . newBuilder ( ) . setId ( 5 ) . build ( ) ; EventAdminNamespace namepsace = EventAdminNamespace . newBuilder ( ) . setData ( regResponse . toByteString ( ) ) . setType ( EventAdminMessageType . EventRegistrationResponse ) . build ( ) ; TerraHarvestMessage thMessage = TerraHarvestMessageHelper . createTerraHarvestMessage ( 25 , 0 , Namespace . EventAdmin , 5000 , namepsace ) ; TerraHarvestPayload payload = TerraHarvestPayload . parseFrom ( thMessage . getTerraHarvestPayload ( ) ) ; RegisterEventsResponseHandler handler = m_SUT . new RegisterEventsResponseHandler ( ) ; handler . handleResponse ( thMessage , payload , null , regResponse ) ; Field field = m_SUT . getClass ( ) . getDeclaredField ( "m_EventRegistraionIds" ) ; field . setAccessible ( true ) ; Map < Integer , Integer > regIdMap = ( Map < Integer , Integer > ) field . get ( m_SUT ) ; assertThat ( regIdMap . containsKey ( 25 ) , is ( true ) ) ; assertThat ( regIdMap . get ( 25 ) , is ( 5 ) ) ; }
Test the register event handler.
Test the register event handler .