mil.dod.th.ose.remote/test/mil/dod/th/ose/remote/osgi/TestBundleManagementMessageService.java
@Test
    public void testGetBundleInfoBad() throws IOException, BundleException
    {
        //request
        GetBundleInfoRequestData request = GetBundleInfoRequestData.newBuilder().
            setBundleDescription(true).
            setBundleId(1L).
            setBundleLastModified(true).
            setBundleLocation(true).
            setBundleName(true).
            setBundleSymbolicName(true).
            setBundleState(true).
            setBundleVendor(true).
            setBundleVersion(true).
            setPackageExports(true).
            setPackageImports(true).build();
        TerraHarvestPayload payload = createPayload(request, BundleMessageType.GetBundleInfoRequest);
        TerraHarvestMessage message = createTerraHarvestMessage(request, BundleMessageType.GetBundleInfoRequest);

        //mock the channel the message came from
        RemoteChannel channel = mock(RemoteChannel.class);

        // handle the message
        m_SUT.handleMessage(message, payload, channel);
        
        //verify
        verify(m_MessageFactory).createBaseErrorMessage(eq(message), eq(ErrorCode.INVALID_VALUE), Mockito.anyString());
        verify(m_ResponseWrapper).queue(channel);
    }
/**
     * Test get bundle info for a bundle that does not exist and one that throws exception.
     * 
     * Verify error messages sent.
     */
Test get bundle info for a bundle that does not exist and one that throws exception.

Verify error messages sent.
Test get bundle info for a bundle that does not exist and one that throws exception . Verify error messages sent .
@Test
    public void testGetBundleInfoBad() throws IOException, BundleException
    {
        GetBundleInfoRequestData request = GetBundleInfoRequestData.newBuilder().
            setBundleDescription(true).
            setBundleId(1L).
            setBundleLastModified(true).
            setBundleLocation(true).
            setBundleName(true).
            setBundleSymbolicName(true).
            setBundleState(true).
            setBundleVendor(true).
            setBundleVersion(true).
            setPackageExports(true).
            setPackageImports(true).build();
        TerraHarvestPayload payload = createPayload(request, BundleMessageType.GetBundleInfoRequest);
        TerraHarvestMessage message = createTerraHarvestMessage(request, BundleMessageType.GetBundleInfoRequest);
        RemoteChannel channel = mock(RemoteChannel.class);
        m_SUT.handleMessage(message, payload, channel);
        verify(m_MessageFactory).createBaseErrorMessage(eq(message), eq(ErrorCode.INVALID_VALUE), Mockito.anyString());
        verify(m_ResponseWrapper).queue(channel);
    }
@ Test public void testGetBundleInfoBad ( ) throws IOException , BundleException { GetBundleInfoRequestData request = GetBundleInfoRequestData . newBuilder ( ) . setBundleDescription ( true ) . setBundleId ( 1L ) . setBundleLastModified ( true ) . setBundleLocation ( true ) . setBundleName ( true ) . setBundleSymbolicName ( true ) . setBundleState ( true ) . setBundleVendor ( true ) . setBundleVersion ( true ) . setPackageExports ( true ) . setPackageImports ( true ) . build ( ) ; TerraHarvestPayload payload = createPayload ( request , BundleMessageType . GetBundleInfoRequest ) ; TerraHarvestMessage message = createTerraHarvestMessage ( request , BundleMessageType . GetBundleInfoRequest ) ; RemoteChannel channel = mock ( RemoteChannel . class ) ; m_SUT . handleMessage ( message , payload , channel ) ; verify ( m_MessageFactory ) . createBaseErrorMessage ( eq ( message ) , eq ( ErrorCode . INVALID_VALUE ) , Mockito . anyString ( ) ) ; verify ( m_ResponseWrapper ) . queue ( channel ) ; }
Test get bundle info for a bundle that does not exist and one that throws exception.
Test get bundle info for a bundle that does not exist and one that throws exception .
//request //mock the channel the message came from // handle the message //verify