mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/data/TestBaseFactoryObjectDataManager.java
@Test
    public void testSetNameParseException()
    {
        //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.setName(uuid, "cantSetMe");
            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 set name if there is an error parsing the data for the given UUID.
     * - A FactoryObjectInformationException should be thrown
     */
Verify the behavior of set name if there is an error parsing the data for the given UUID.
- A FactoryObjectInformationException should be thrown
Verify the behavior of set name if there is an error parsing the data for the given UUID . - A FactoryObjectInformationException should be thrown
@Test
    public void testSetNameParseException()
    {
        UUID uuid = UUID.randomUUID();
        createPersistentData(uuid, new byte[]{1,2,3,4,5,6});
        try
        {
            m_SUT.setName(uuid, "cantSetMe");
            fail("FactoryObjectInformationExceptionExpected");
        }
        catch (final FactoryObjectInformationException ex)
        {
            assertThat(ex.getCause().getClass().getName(), is(InvalidProtocolBufferException.class.getName()));
        }
    }
@ Test public void testSetNameParseException ( ) { UUID uuid = UUID . randomUUID ( ) ; createPersistentData ( uuid , new byte [ ] { 1 , 2 , 3 , 4 , 5 , 6 } ) ; try { m_SUT . setName ( uuid , "cantSetMe" ) ; fail ( "FactoryObjectInformationExceptionExpected" ) ; } catch ( final FactoryObjectInformationException ex ) { assertThat ( ex . getCause ( ) . getClass ( ) . getName ( ) , is ( InvalidProtocolBufferException . class . getName ( ) ) ) ; } }
Verify the behavior of set name if there is an error parsing the data for the given UUID.
Verify the behavior of set name if there is an error parsing the data 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