mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/data/TestBaseFactoryObjectDataManager.java
@Test
    public void testClearPidDataParseException() throws FactoryObjectInformationException, IllegalArgumentException,
        PersistenceFailedException
    {
        //mock factory object persistent data entry with invalid data
        UUID uuid = UUID.randomUUID();
        createPersistentData(uuid, new byte[]{1,2,3,4,5,6});
    
        //run the method, expecting exception
        try
        {
            m_SUT.clearPid(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 that an exception is thrown if there is a problem parsing the factory object information for the
     * given UUID.
     * - FactoryObjectInformationException should be thrown, no updates should be made.
     */
Verify that an exception is thrown if there is a problem parsing the factory object information for the
given UUID.
- FactoryObjectInformationException should be thrown, no updates should be made.
Verify that an exception is thrown if there is a problem parsing the factory object information for the given UUID . - FactoryObjectInformationException should be thrown no updates should be made .
@Test
    public void testClearPidDataParseException() throws FactoryObjectInformationException, IllegalArgumentException,
        PersistenceFailedException
    {
        UUID uuid = UUID.randomUUID();
        createPersistentData(uuid, new byte[]{1,2,3,4,5,6});
        try
        {
            m_SUT.clearPid(uuid);
            fail("FactoryObjectInformationException Expected");
        }
        catch (final FactoryObjectInformationException ex)
        {
            assertThat(ex.getCause().getClass().getName(), is(InvalidProtocolBufferException.class.getName()));
        }
    }
@ Test public void testClearPidDataParseException ( ) throws FactoryObjectInformationException , IllegalArgumentException , PersistenceFailedException { UUID uuid = UUID . randomUUID ( ) ; createPersistentData ( uuid , new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 } ) ; try { m_SUT . clearPid ( uuid ) ; fail ( "FactoryObjectInformationException Expected" ) ; } catch ( final FactoryObjectInformationException ex ) { assertThat ( ex . getCause ( ) . getClass ( ) . getName ( ) , is ( InvalidProtocolBufferException . class . getName ( ) ) ) ; } }
Verify that an exception is thrown if there is a problem parsing the factory object information for the
 given UUID.
Verify that an exception is thrown if there is a problem parsing the factory object information for the given UUID .
//mock factory object persistent data entry with invalid data //run the method, expecting exception //exception expected, caused by bad parse - InvalidProtocolBuffer