mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/data/TestBaseFactoryObjectDataManager.java
@Test
    public void testGetNameParseException()
    {
        //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.getName(uuid);
            fail("FactoryObjectInformationExceptionExpected");
        }
        catch (final FactoryObjectInformationException ex)
        {
            //exception expected, caused by bad parse - InvalidProtocolBuffer
            assertThat(ex.getCause().getClass().getName(), is(InvalidProtocolBufferException.class.getName()));
        }
    }
/**
     * Verify the behavior of get name if there is an error parsing the factory object data.
     * - Method is expected to throw a FactoryInformationException
     */
Verify the behavior of get name if there is an error parsing the factory object data.
- Method is expected to throw a FactoryInformationException
Verify the behavior of get name if there is an error parsing the factory object data . - Method is expected to throw a FactoryInformationException
@Test
    public void testGetNameParseException()
    {
        UUID uuid = UUID.randomUUID();
        createPersistentData(uuid, new byte[]{1,2,3,4,5,6});
        try
        {
            m_SUT.getName(uuid);
            fail("FactoryObjectInformationExceptionExpected");
        }
        catch (final FactoryObjectInformationException ex)
        {
            assertThat(ex.getCause().getClass().getName(), is(InvalidProtocolBufferException.class.getName()));
        }
    }
@ Test public void testGetNameParseException ( ) { UUID uuid = UUID . randomUUID ( ) ; createPersistentData ( uuid , new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 } ) ; try { m_SUT . getName ( uuid ) ; fail ( "FactoryObjectInformationExceptionExpected" ) ; } catch ( final FactoryObjectInformationException ex ) { assertThat ( ex . getCause ( ) . getClass ( ) . getName ( ) , is ( InvalidProtocolBufferException . class . getName ( ) ) ) ; } }
Verify the behavior of get name if there is an error parsing the factory object data.
Verify the behavior of get name if there is an error parsing the factory object data .
//mock factory object persistent data entry with invalid data //run the method, expecting exception //exception expected, caused by bad parse - InvalidProtocolBuffer