mil.dod.th.ose.core.integration/src/mil/dod/th/ose/core/integration/TestAddressedCommandResponse.java
public void testAddressedResponse() throws JAXBException, ValidationFailedException
    {
        UUID uuid = UUID.randomUUID();
        int sourceId = 1;
        int destId = 2;
        UUID assetUuid = UUID.randomUUID();
        MapEntry entry = new MapEntry("key", 2);
        SetPanTiltResponse response = new SetPanTiltResponse();
        response.withReserved(entry);
        AddressedResponse addrResponse = new AddressedResponse(sourceId, destId, assetUuid, response, uuid);
        XmlMarshalService marshalService = ServiceUtils.getService(m_Context, XmlMarshalService.class);
        byte[] data = marshalService.createXmlByteArray(addrResponse, false);

        XmlUnmarshalService unmarshalService = ServiceUtils.getService(m_Context, XmlUnmarshalService.class);
        AddressedResponse unmarshalledAddrResponse = unmarshalService.getXmlObject(AddressedResponse.class, data);
        assertThat(unmarshalledAddrResponse.getAssetUuid(), is(assetUuid));
        assertThat(unmarshalledAddrResponse.getCommandUuid(), is(uuid));
        assertThat(unmarshalledAddrResponse.getSourceId(), is(sourceId));
        assertThat(unmarshalledAddrResponse.getDestId(), is(destId));
        SetPanTiltResponse unMarshResponse = (SetPanTiltResponse)unmarshalledAddrResponse.getResponse();
        assertThat(unMarshResponse, is(response));
        assertThat(unMarshResponse.getReserved(), hasItem(entry));

        //try validating
        Validator validator = ServiceUtils.getService(m_Context, Validator.class);
        validator.validate(addrResponse);
    }
/**
     * Test the creation of an {@link AddressedResponse} with a specific type of response.
     * Verify the created object can be marshalled, unmarshalled, and validated.
     */
Test the creation of an  AddressedResponse with a specific type of response.
Verify the created object can be marshalled, unmarshalled, and validated.
Test the creation of an AddressedResponse with a specific type of response . Verify the created object can be marshalled unmarshalled and validated .
public void testAddressedResponse() throws JAXBException, ValidationFailedException
    {
        UUID uuid = UUID.randomUUID();
        int sourceId = 1;
        int destId = 2;
        UUID assetUuid = UUID.randomUUID();
        MapEntry entry = new MapEntry("key", 2);
        SetPanTiltResponse response = new SetPanTiltResponse();
        response.withReserved(entry);
        AddressedResponse addrResponse = new AddressedResponse(sourceId, destId, assetUuid, response, uuid);
        XmlMarshalService marshalService = ServiceUtils.getService(m_Context, XmlMarshalService.class);
        byte[] data = marshalService.createXmlByteArray(addrResponse, false);
        XmlUnmarshalService unmarshalService = ServiceUtils.getService(m_Context, XmlUnmarshalService.class);
        AddressedResponse unmarshalledAddrResponse = unmarshalService.getXmlObject(AddressedResponse.class, data);
        assertThat(unmarshalledAddrResponse.getAssetUuid(), is(assetUuid));
        assertThat(unmarshalledAddrResponse.getCommandUuid(), is(uuid));
        assertThat(unmarshalledAddrResponse.getSourceId(), is(sourceId));
        assertThat(unmarshalledAddrResponse.getDestId(), is(destId));
        SetPanTiltResponse unMarshResponse = (SetPanTiltResponse)unmarshalledAddrResponse.getResponse();
        assertThat(unMarshResponse, is(response));
        assertThat(unMarshResponse.getReserved(), hasItem(entry));
        Validator validator = ServiceUtils.getService(m_Context, Validator.class);
        validator.validate(addrResponse);
    }
public void testAddressedResponse ( ) throws JAXBException , ValidationFailedException { UUID uuid = UUID . randomUUID ( ) ; int sourceId = 1 ; int destId = 2 ; UUID assetUuid = UUID . randomUUID ( ) ; MapEntry entry = new MapEntry ( "key" , 2 ) ; SetPanTiltResponse response = new SetPanTiltResponse ( ) ; response . withReserved ( entry ) ; AddressedResponse addrResponse = new AddressedResponse ( sourceId , destId , assetUuid , response , uuid ) ; XmlMarshalService marshalService = ServiceUtils . getService ( m_Context , XmlMarshalService . class ) ; byte [ ] data = marshalService . createXmlByteArray ( addrResponse , false ) ; XmlUnmarshalService unmarshalService = ServiceUtils . getService ( m_Context , XmlUnmarshalService . class ) ; AddressedResponse unmarshalledAddrResponse = unmarshalService . getXmlObject ( AddressedResponse . class , data ) ; assertThat ( unmarshalledAddrResponse . getAssetUuid ( ) , is ( assetUuid ) ) ; assertThat ( unmarshalledAddrResponse . getCommandUuid ( ) , is ( uuid ) ) ; assertThat ( unmarshalledAddrResponse . getSourceId ( ) , is ( sourceId ) ) ; assertThat ( unmarshalledAddrResponse . getDestId ( ) , is ( destId ) ) ; SetPanTiltResponse unMarshResponse = ( SetPanTiltResponse ) unmarshalledAddrResponse . getResponse ( ) ; assertThat ( unMarshResponse , is ( response ) ) ; assertThat ( unMarshResponse . getReserved ( ) , hasItem ( entry ) ) ; Validator validator = ServiceUtils . getService ( m_Context , Validator . class ) ; validator . validate ( addrResponse ) ; }
Test the creation of an {@link AddressedResponse} with a specific type of response.
Test the creation of an { @link AddressedResponse } with a specific type of response .
//try validating