mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryRegistry.java
@Test
    public void testIsObjectCreatedTrue() throws IllegalArgumentException, FactoryObjectInformationException,
        FactoryException
    {
        // mock a factory object
        UUID testUuid = UUID.randomUUID();
        FactoryObjectProxy testObjProxy = mock(FactoryObjectProxy.class);

        // set up fake object factory
        FactoryInternal factory = mock(FactoryInternal.class);
        when(factory.create()).thenReturn(testObjProxy);

        ComponentInstance instance = mockComponentInstance(testUuid, "name", "pid");
        when(m_ServiceProxy.createFactoryObjectInternal(factory)).thenReturn(instance);

        when(m_Utils.getMetaTypeDefaults(factory)).thenReturn(new Hashtable<String, Object>());

        // replay
        m_SUT.createOrRestoreObject(factory, testUuid);

        assertThat(m_SUT.isObjectCreated("name"), is(true));
    }
/**
     * Verify true is returned if an object is known by the registry.
     */
Verify true is returned if an object is known by the registry.
Verify true is returned if an object is known by the registry .
@Test
    public void testIsObjectCreatedTrue() throws IllegalArgumentException, FactoryObjectInformationException,
        FactoryException
    {
        UUID testUuid = UUID.randomUUID();
        FactoryObjectProxy testObjProxy = mock(FactoryObjectProxy.class);
        FactoryInternal factory = mock(FactoryInternal.class);
        when(factory.create()).thenReturn(testObjProxy);
        ComponentInstance instance = mockComponentInstance(testUuid, "name", "pid");
        when(m_ServiceProxy.createFactoryObjectInternal(factory)).thenReturn(instance);
        when(m_Utils.getMetaTypeDefaults(factory)).thenReturn(new Hashtable<String, Object>());
        m_SUT.createOrRestoreObject(factory, testUuid);
        assertThat(m_SUT.isObjectCreated("name"), is(true));
    }
@ Test public void testIsObjectCreatedTrue ( ) throws IllegalArgumentException , FactoryObjectInformationException , FactoryException { UUID testUuid = UUID . randomUUID ( ) ; FactoryObjectProxy testObjProxy = mock ( FactoryObjectProxy . class ) ; FactoryInternal factory = mock ( FactoryInternal . class ) ; when ( factory . create ( ) ) . thenReturn ( testObjProxy ) ; ComponentInstance instance = mockComponentInstance ( testUuid , "name" , "pid" ) ; when ( m_ServiceProxy . createFactoryObjectInternal ( factory ) ) . thenReturn ( instance ) ; when ( m_Utils . getMetaTypeDefaults ( factory ) ) . thenReturn ( new Hashtable < String , Object > ( ) ) ; m_SUT . createOrRestoreObject ( factory , testUuid ) ; assertThat ( m_SUT . isObjectCreated ( "name" ) , is ( true ) ) ; }
Verify true is returned if an object is known by the registry.
Verify true is returned if an object is known by the registry .
// mock a factory object // set up fake object factory // replay