mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestAbstractFactoryObject.java
@Test
    public void testSetProperties_FailCreateFactoryConfig() throws IllegalArgumentException, 
        IllegalStateException, FactoryException, FactoryObjectInformationException, ClassNotFoundException
    {
        m_SUT.initialize(m_Registry, m_FactoryProxy, factoryInternal, m_ConfigAdmin, 
                m_EventAdmin, m_PowerInternal, OBJ_UUID, OBJ_NAME, null, OBJ_BASETYPE);
        when(m_Registry.createConfiguration(eq(OBJ_UUID), Mockito.anyString(), 
                Mockito.any(AbstractFactoryObject.class))).thenThrow(new FactoryObjectInformationException("Failed"));
        
        Map<String, Object> props = new HashMap<>();
        props.put("test-prop", "test-value");
        try
        {
            m_SUT.setProperties(props);
            fail("expecting exception");
        }
        catch (FactoryException e)
        {
            //expecting exception
        }
    }
/**
     * Verify that exception occurs if configuration object cannot be created.
     */
Verify that exception occurs if configuration object cannot be created.
Verify that exception occurs if configuration object cannot be created .
@Test
    public void testSetProperties_FailCreateFactoryConfig() throws IllegalArgumentException, 
        IllegalStateException, FactoryException, FactoryObjectInformationException, ClassNotFoundException
    {
        m_SUT.initialize(m_Registry, m_FactoryProxy, factoryInternal, m_ConfigAdmin, 
                m_EventAdmin, m_PowerInternal, OBJ_UUID, OBJ_NAME, null, OBJ_BASETYPE);
        when(m_Registry.createConfiguration(eq(OBJ_UUID), Mockito.anyString(), 
                Mockito.any(AbstractFactoryObject.class))).thenThrow(new FactoryObjectInformationException("Failed"));
        Map<String, Object> props = new HashMap<>();
        props.put("test-prop", "test-value");
        try
        {
            m_SUT.setProperties(props);
            fail("expecting exception");
        }
        catch (FactoryException e)
        {
        }
    }
@ Test public void testSetProperties_FailCreateFactoryConfig ( ) throws IllegalArgumentException , IllegalStateException , FactoryException , FactoryObjectInformationException , ClassNotFoundException { m_SUT . initialize ( m_Registry , m_FactoryProxy , factoryInternal , m_ConfigAdmin , m_EventAdmin , m_PowerInternal , OBJ_UUID , OBJ_NAME , null , OBJ_BASETYPE ) ; when ( m_Registry . createConfiguration ( eq ( OBJ_UUID ) , Mockito . anyString ( ) , Mockito . any ( AbstractFactoryObject . class ) ) ) . thenThrow ( new FactoryObjectInformationException ( "Failed" ) ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( "test-prop" , "test-value" ) ; try { m_SUT . setProperties ( props ) ; fail ( "expecting exception" ) ; } catch ( FactoryException e ) { } }
Verify that exception occurs if configuration object cannot be created.
Verify that exception occurs if configuration object cannot be created .
//expecting exception