mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/asset/data/TestAssetFactoryObjectDataManagerImpl.java
@Test
    public void testGetCoordinatesException() throws FactoryObjectInformationException, ObjectConverterException, 
        IllegalArgumentException, PersistenceFailedException, InvalidProtocolBufferException
    {
        //activate to create converters 
        m_SUT.activate();
        
        //persisted message
        m_FactData = FactoryObjectData.newBuilder().
                setName("original").
                setExtension(AssetObjectData.coordinates, m_ProtoCoorsList).build();
        when(m_PersistentData.getEntity()).thenReturn(m_FactData.toByteArray());
        when(m_PersistentData.getUUID()).thenReturn(m_UUID);
        
        when(m_PersistentDataStore.find(m_UUID)).thenReturn(m_PersistentData);

        when(m_JaxbConverter.convertToJaxb(m_ProtoCoors)).
            thenThrow(new ObjectConverterException("Converter fail"));
        
        try
        {
            m_SUT.getCoordinates(m_UUID);
            fail("Expected exception because the converter should have thrown an exception!");
        }
        catch (FactoryObjectInformationException e)
        {
            //expected exception
        }
    }
/**
     * Verify getting of coordinates for an asset.
     * Verify exception if coordinates cannot be converted.
     */
Verify getting of coordinates for an asset.
Verify exception if coordinates cannot be converted.
Verify getting of coordinates for an asset . Verify exception if coordinates cannot be converted .
@Test
    public void testGetCoordinatesException() throws FactoryObjectInformationException, ObjectConverterException, 
        IllegalArgumentException, PersistenceFailedException, InvalidProtocolBufferException
    {
        m_SUT.activate();
        m_FactData = FactoryObjectData.newBuilder().
                setName("original").
                setExtension(AssetObjectData.coordinates, m_ProtoCoorsList).build();
        when(m_PersistentData.getEntity()).thenReturn(m_FactData.toByteArray());
        when(m_PersistentData.getUUID()).thenReturn(m_UUID);
        when(m_PersistentDataStore.find(m_UUID)).thenReturn(m_PersistentData);
        when(m_JaxbConverter.convertToJaxb(m_ProtoCoors)).
            thenThrow(new ObjectConverterException("Converter fail"));
        try
        {
            m_SUT.getCoordinates(m_UUID);
            fail("Expected exception because the converter should have thrown an exception!");
        }
        catch (FactoryObjectInformationException e)
        {
        }
    }
@ Test public void testGetCoordinatesException ( ) throws FactoryObjectInformationException , ObjectConverterException , IllegalArgumentException , PersistenceFailedException , InvalidProtocolBufferException { m_SUT . activate ( ) ; m_FactData = FactoryObjectData . newBuilder ( ) . setName ( "original" ) . setExtension ( AssetObjectData . coordinates , m_ProtoCoorsList ) . build ( ) ; when ( m_PersistentData . getEntity ( ) ) . thenReturn ( m_FactData . toByteArray ( ) ) ; when ( m_PersistentData . getUUID ( ) ) . thenReturn ( m_UUID ) ; when ( m_PersistentDataStore . find ( m_UUID ) ) . thenReturn ( m_PersistentData ) ; when ( m_JaxbConverter . convertToJaxb ( m_ProtoCoors ) ) . thenThrow ( new ObjectConverterException ( "Converter fail" ) ) ; try { m_SUT . getCoordinates ( m_UUID ) ; fail ( "Expected exception because the converter should have thrown an exception!" ) ; } catch ( FactoryObjectInformationException e ) { } }
Verify getting of coordinates for an asset.
Verify getting of coordinates for an asset .
//activate to create converters  //persisted message //expected exception