mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/api/TestFactoryRegistry.java
@Test
    public void testGetObjectByProductType() throws Exception
    {
        FactoryInternal factory1 = mock(FactoryInternal.class);
        FactoryInternal factory2 = mock(FactoryInternal.class);
        List<FactoryObjectInternal> factory1objects = stubFactoryObject(factory1, "factory-1-type", 2);
        stubFactoryObject(factory2, "factory-2-type", 2);

        // UUIDs passed here don't actually matter, UUID stubbed out already
        m_SUT.createOrRestoreObject(factory1, null);
        m_SUT.createOrRestoreObject(factory2, null);
        m_SUT.createOrRestoreObject(factory1, null);
        m_SUT.createOrRestoreObject(factory2, null);

        Set<FactoryObjectInternal> objects = m_SUT.getObjectsByProductType("factory-1-type");

        assertThat(objects, hasItems(factory1objects.get(0), factory1objects.get(1)));
    }
/**
     * Test that attempting get an object by UUID when the UUID is not associated with an object known to the factory
     * registry.
     */
Test that attempting get an object by UUID when the UUID is not associated with an object known to the factory
registry.
Test that attempting get an object by UUID when the UUID is not associated with an object known to the factory registry .
@Test
    public void testGetObjectByProductType() throws Exception
    {
        FactoryInternal factory1 = mock(FactoryInternal.class);
        FactoryInternal factory2 = mock(FactoryInternal.class);
        List<FactoryObjectInternal> factory1objects = stubFactoryObject(factory1, "factory-1-type", 2);
        stubFactoryObject(factory2, "factory-2-type", 2);
        m_SUT.createOrRestoreObject(factory1, null);
        m_SUT.createOrRestoreObject(factory2, null);
        m_SUT.createOrRestoreObject(factory1, null);
        m_SUT.createOrRestoreObject(factory2, null);
        Set<FactoryObjectInternal> objects = m_SUT.getObjectsByProductType("factory-1-type");
        assertThat(objects, hasItems(factory1objects.get(0), factory1objects.get(1)));
    }
@ Test public void testGetObjectByProductType ( ) throws Exception { FactoryInternal factory1 = mock ( FactoryInternal . class ) ; FactoryInternal factory2 = mock ( FactoryInternal . class ) ; List < FactoryObjectInternal > factory1objects = stubFactoryObject ( factory1 , "factory-1-type" , 2 ) ; stubFactoryObject ( factory2 , "factory-2-type" , 2 ) ; m_SUT . createOrRestoreObject ( factory1 , null ) ; m_SUT . createOrRestoreObject ( factory2 , null ) ; m_SUT . createOrRestoreObject ( factory1 , null ) ; m_SUT . createOrRestoreObject ( factory2 , null ) ; Set < FactoryObjectInternal > objects = m_SUT . getObjectsByProductType ( "factory-1-type" ) ; assertThat ( objects , hasItems ( factory1objects . get ( 0 ) , factory1objects . get ( 1 ) ) ) ; }
Test that attempting get an object by UUID when the UUID is not associated with an object known to the factory
 registry.
Test that attempting get an object by UUID when the UUID is not associated with an object known to the factory registry .
// UUIDs passed here don't actually matter, UUID stubbed out already