mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/data/TestBaseFactoryObjectDataManager.java
@Test
    public void testGetPidDataParseException() throws IllegalArgumentException, FactoryObjectInformationException
    {
        //mock factory object information - use a bad entity
        UUID uuid = UUID.randomUUID();
        createPersistentData(uuid, new byte[]{1,2,3,4,5,6});
    
        //retrieve the PID
        //run the method, expecting exception
        try
        {
            m_SUT.getPid(uuid);
            fail("FactoryObjectInformationException Expected");
        }
        catch (final FactoryObjectInformationException ex)
        {
            //exception expected, caused by bad parse - InvalidProtocolBuffer
            assertThat(ex.getCause().getClass().getName(), is(InvalidProtocolBufferException.class.getName()));
        }
    }
/**
     * Verify behavior if there is an error parsing the data.
     * - a FactoryObjectInformationException should be thrown with an appropriate cause
     */
Verify behavior if there is an error parsing the data.
- a FactoryObjectInformationException should be thrown with an appropriate cause
Verify behavior if there is an error parsing the data . - a FactoryObjectInformationException should be thrown with an appropriate cause
@Test
    public void testGetPidDataParseException() throws IllegalArgumentException, FactoryObjectInformationException
    {
        UUID uuid = UUID.randomUUID();
        createPersistentData(uuid, new byte[]{1,2,3,4,5,6});
        try
        {
            m_SUT.getPid(uuid);
            fail("FactoryObjectInformationException Expected");
        }
        catch (final FactoryObjectInformationException ex)
        {
            assertThat(ex.getCause().getClass().getName(), is(InvalidProtocolBufferException.class.getName()));
        }
    }
@ Test public void testGetPidDataParseException ( ) throws IllegalArgumentException , FactoryObjectInformationException { UUID uuid = UUID . randomUUID ( ) ; createPersistentData ( uuid , new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 } ) ; try { m_SUT . getPid ( uuid ) ; fail ( "FactoryObjectInformationException Expected" ) ; } catch ( final FactoryObjectInformationException ex ) { assertThat ( ex . getCause ( ) . getClass ( ) . getName ( ) , is ( InvalidProtocolBufferException . class . getName ( ) ) ) ; } }
Verify behavior if there is an error parsing the data.
Verify behavior if there is an error parsing the data .
//mock factory object information - use a bad entity //retrieve the PID //run the method, expecting exception //exception expected, caused by bad parse - InvalidProtocolBuffer