mil.dod.th.ose.core/test/mil/dod/th/ose/core/factory/impl/TestFactoryConfigurationService.java
@Test
    public void testGetOCDOptional()
    {
        MetaTypeMocker.registerMetaTypeAttributes(m_ApiBundle, 
                FactoryObject.class.getName() + FactoryObjectInternal.ATTRIBUTES_CLASS_SUFFIX, // service PID 
                m_ServiceAttrsReq, m_ServiceAttrsOpt, null);

        ObjectClassDefinition ocd = m_SUT.getObjectClassDefinition(PRODUCT_TYPE + FactoryDescriptor.PID_SUFFIX, null);
        
        assertThat(ocd, is(notNullValue()));
        assertThat(ocd.getDescription(), is(m_Factory.getProductDescription()));
        assertThat(ocd.getName(), is(m_Factory.getProductType()));
        assertThat(ocd.getID(), is(PRODUCT_TYPE + FactoryDescriptor.PID_SUFFIX));
        
        //inspect optional attrs
        List<AttributeDefinition> optAttrs = Arrays.asList(
                ocd.getAttributeDefinitions(ObjectClassDefinition.OPTIONAL));
        assertThat(optAttrs.size(), is(m_ServiceAttrsOpt.length + m_ExtendedAttrsOpt.length));
        assertThat(optAttrs, hasItems(m_ServiceAttrsOpt)); 
        assertThat(optAttrs, hasItems(m_ExtendedAttrsOpt));
        
        //inspect required attrs
        List<AttributeDefinition> reqAttrs = Arrays.asList(
                ocd.getAttributeDefinitions(ObjectClassDefinition.REQUIRED));
        assertThat(reqAttrs.size(), is(m_ServiceAttrsReq.length + m_ExtendedAttrsReq.length));
        assertThat(reqAttrs, hasItems(m_ServiceAttrsReq)); 
        assertThat(reqAttrs, hasItems(m_ExtendedAttrsReq));
    }
/**
     * Verify get an objects class definition, optional attributes.
     */
Verify get an objects class definition, optional attributes.
Verify get an objects class definition optional attributes .
@Test
    public void testGetOCDOptional()
    {
        MetaTypeMocker.registerMetaTypeAttributes(m_ApiBundle, 
                FactoryObject.class.getName() + FactoryObjectInternal.ATTRIBUTES_CLASS_SUFFIX, 
                m_ServiceAttrsReq, m_ServiceAttrsOpt, null);
        ObjectClassDefinition ocd = m_SUT.getObjectClassDefinition(PRODUCT_TYPE + FactoryDescriptor.PID_SUFFIX, null);
        assertThat(ocd, is(notNullValue()));
        assertThat(ocd.getDescription(), is(m_Factory.getProductDescription()));
        assertThat(ocd.getName(), is(m_Factory.getProductType()));
        assertThat(ocd.getID(), is(PRODUCT_TYPE + FactoryDescriptor.PID_SUFFIX));
        List<AttributeDefinition> optAttrs = Arrays.asList(
                ocd.getAttributeDefinitions(ObjectClassDefinition.OPTIONAL));
        assertThat(optAttrs.size(), is(m_ServiceAttrsOpt.length + m_ExtendedAttrsOpt.length));
        assertThat(optAttrs, hasItems(m_ServiceAttrsOpt)); 
        assertThat(optAttrs, hasItems(m_ExtendedAttrsOpt));
        List<AttributeDefinition> reqAttrs = Arrays.asList(
                ocd.getAttributeDefinitions(ObjectClassDefinition.REQUIRED));
        assertThat(reqAttrs.size(), is(m_ServiceAttrsReq.length + m_ExtendedAttrsReq.length));
        assertThat(reqAttrs, hasItems(m_ServiceAttrsReq)); 
        assertThat(reqAttrs, hasItems(m_ExtendedAttrsReq));
    }
@ Test public void testGetOCDOptional ( ) { MetaTypeMocker . registerMetaTypeAttributes ( m_ApiBundle , FactoryObject . class . getName ( ) + FactoryObjectInternal . ATTRIBUTES_CLASS_SUFFIX , m_ServiceAttrsReq , m_ServiceAttrsOpt , null ) ; ObjectClassDefinition ocd = m_SUT . getObjectClassDefinition ( PRODUCT_TYPE + FactoryDescriptor . PID_SUFFIX , null ) ; assertThat ( ocd , is ( notNullValue ( ) ) ) ; assertThat ( ocd . getDescription ( ) , is ( m_Factory . getProductDescription ( ) ) ) ; assertThat ( ocd . getName ( ) , is ( m_Factory . getProductType ( ) ) ) ; assertThat ( ocd . getID ( ) , is ( PRODUCT_TYPE + FactoryDescriptor . PID_SUFFIX ) ) ; List < AttributeDefinition > optAttrs = Arrays . asList ( ocd . getAttributeDefinitions ( ObjectClassDefinition . OPTIONAL ) ) ; assertThat ( optAttrs . size ( ) , is ( m_ServiceAttrsOpt . length + m_ExtendedAttrsOpt . length ) ) ; assertThat ( optAttrs , hasItems ( m_ServiceAttrsOpt ) ) ; assertThat ( optAttrs , hasItems ( m_ExtendedAttrsOpt ) ) ; List < AttributeDefinition > reqAttrs = Arrays . asList ( ocd . getAttributeDefinitions ( ObjectClassDefinition . REQUIRED ) ) ; assertThat ( reqAttrs . size ( ) , is ( m_ServiceAttrsReq . length + m_ExtendedAttrsReq . length ) ) ; assertThat ( reqAttrs , hasItems ( m_ServiceAttrsReq ) ) ; assertThat ( reqAttrs , hasItems ( m_ExtendedAttrsReq ) ) ; }
Verify get an objects class definition, optional attributes.
Verify get an objects class definition optional attributes .
// service PID  //inspect optional attrs //inspect required attrs