mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryRegistry.java
@Test
    public void testGetUuids() throws IllegalArgumentException, FactoryException, FactoryObjectInformationException
    {
        UUID testUuid = UUID.randomUUID();
        UUID testUuid2 = UUID.randomUUID();

        // mock an object
        ComponentInstance instance1 = mockComponentInstance(testUuid, "obj1", "pid1");
        ComponentInstance instance2 = mockComponentInstance(testUuid2, "obj2", "pid2");
        when(m_ServiceProxy.createFactoryObjectInternal(m_FactoryDescriptor)).thenReturn(
                instance1, instance2);
        FactoryObjectProxy testObjProxy = mock(FactoryObjectProxy.class);

        FactoryObjectProxy testObjProxy2 = mock(FactoryObjectProxy.class);

        when(m_FactoryDescriptor.create()).thenReturn(testObjProxy, testObjProxy2);

        // replay
        m_SUT.createOrRestoreObject(m_FactoryDescriptor, testUuid);
        m_SUT.createOrRestoreObject(m_FactoryDescriptor, testUuid2);

        List<UUID> uuidList = m_SUT.getUuids();

        assertThat(uuidList.size(), is(2));
        assertThat(uuidList, hasItems(testUuid, testUuid2));
    }
/**
     * Verify that we can get a list of uuids from the objects in the registry
     */
Verify that we can get a list of uuids from the objects in the registry
Verify that we can get a list of uuids from the objects in the registry
@Test
    public void testGetUuids() throws IllegalArgumentException, FactoryException, FactoryObjectInformationException
    {
        UUID testUuid = UUID.randomUUID();
        UUID testUuid2 = UUID.randomUUID();
        ComponentInstance instance1 = mockComponentInstance(testUuid, "obj1", "pid1");
        ComponentInstance instance2 = mockComponentInstance(testUuid2, "obj2", "pid2");
        when(m_ServiceProxy.createFactoryObjectInternal(m_FactoryDescriptor)).thenReturn(
                instance1, instance2);
        FactoryObjectProxy testObjProxy = mock(FactoryObjectProxy.class);
        FactoryObjectProxy testObjProxy2 = mock(FactoryObjectProxy.class);
        when(m_FactoryDescriptor.create()).thenReturn(testObjProxy, testObjProxy2);
        m_SUT.createOrRestoreObject(m_FactoryDescriptor, testUuid);
        m_SUT.createOrRestoreObject(m_FactoryDescriptor, testUuid2);
        List<UUID> uuidList = m_SUT.getUuids();
        assertThat(uuidList.size(), is(2));
        assertThat(uuidList, hasItems(testUuid, testUuid2));
    }
@ Test public void testGetUuids ( ) throws IllegalArgumentException , FactoryException , FactoryObjectInformationException { UUID testUuid = UUID . randomUUID ( ) ; UUID testUuid2 = UUID . randomUUID ( ) ; ComponentInstance instance1 = mockComponentInstance ( testUuid , "obj1" , "pid1" ) ; ComponentInstance instance2 = mockComponentInstance ( testUuid2 , "obj2" , "pid2" ) ; when ( m_ServiceProxy . createFactoryObjectInternal ( m_FactoryDescriptor ) ) . thenReturn ( instance1 , instance2 ) ; FactoryObjectProxy testObjProxy = mock ( FactoryObjectProxy . class ) ; FactoryObjectProxy testObjProxy2 = mock ( FactoryObjectProxy . class ) ; when ( m_FactoryDescriptor . create ( ) ) . thenReturn ( testObjProxy , testObjProxy2 ) ; m_SUT . createOrRestoreObject ( m_FactoryDescriptor , testUuid ) ; m_SUT . createOrRestoreObject ( m_FactoryDescriptor , testUuid2 ) ; List < UUID > uuidList = m_SUT . getUuids ( ) ; assertThat ( uuidList . size ( ) , is ( 2 ) ) ; assertThat ( uuidList , hasItems ( testUuid , testUuid2 ) ) ; }
Verify that we can get a list of uuids from the objects in the registry
Verify that we can get a list of uuids from the objects in the registry
// mock an object // replay