mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/physical/TestPhysicalLinkServiceProxy.java
@Test
    public void testGetGpioServiceAttributeDefinitions()
    {
        FactoryInternal fact = mock(FactoryInternal.class);
        PhysicalLinkCapabilities physCaps = mock(PhysicalLinkCapabilities.class);
        
        when(fact.getCapabilities()).thenReturn(physCaps);
        when(physCaps.getLinkType()).thenReturn(PhysicalLinkTypeEnum.GPIO);
        
        String pid = Gpio.class.getName() + FactoryObjectInternal.ATTRIBUTES_CLASS_SUFFIX;
        
        AttributeDefinition[] expectedDefs = AttributeDefinitionMocker.mockArrayAll();
        MetaTypeMocker.registerMetaTypeAttributes(apiBundle, pid, null, null, expectedDefs);
        
        AttributeDefinition[] retrieved = m_SUT.getExtendedServiceAttributeDefinitions(factoryServiceContext, fact,
                ObjectClassDefinition.ALL);
        
        assertThat(retrieved, is(expectedDefs));
    }
/**
     * Verify custom attrs retrieved from metatype service based upon phys link type.
     */
Verify custom attrs retrieved from metatype service based upon phys link type.
Verify custom attrs retrieved from metatype service based upon phys link type .
@Test
    public void testGetGpioServiceAttributeDefinitions()
    {
        FactoryInternal fact = mock(FactoryInternal.class);
        PhysicalLinkCapabilities physCaps = mock(PhysicalLinkCapabilities.class);
        when(fact.getCapabilities()).thenReturn(physCaps);
        when(physCaps.getLinkType()).thenReturn(PhysicalLinkTypeEnum.GPIO);
        String pid = Gpio.class.getName() + FactoryObjectInternal.ATTRIBUTES_CLASS_SUFFIX;
        AttributeDefinition[] expectedDefs = AttributeDefinitionMocker.mockArrayAll();
        MetaTypeMocker.registerMetaTypeAttributes(apiBundle, pid, null, null, expectedDefs);
        AttributeDefinition[] retrieved = m_SUT.getExtendedServiceAttributeDefinitions(factoryServiceContext, fact,
                ObjectClassDefinition.ALL);
        assertThat(retrieved, is(expectedDefs));
    }
@ Test public void testGetGpioServiceAttributeDefinitions ( ) { FactoryInternal fact = mock ( FactoryInternal . class ) ; PhysicalLinkCapabilities physCaps = mock ( PhysicalLinkCapabilities . class ) ; when ( fact . getCapabilities ( ) ) . thenReturn ( physCaps ) ; when ( physCaps . getLinkType ( ) ) . thenReturn ( PhysicalLinkTypeEnum . GPIO ) ; String pid = Gpio . class . getName ( ) + FactoryObjectInternal . ATTRIBUTES_CLASS_SUFFIX ; AttributeDefinition [ ] expectedDefs = AttributeDefinitionMocker . mockArrayAll ( ) ; MetaTypeMocker . registerMetaTypeAttributes ( apiBundle , pid , null , null , expectedDefs ) ; AttributeDefinition [ ] retrieved = m_SUT . getExtendedServiceAttributeDefinitions ( factoryServiceContext , fact , ObjectClassDefinition . ALL ) ; assertThat ( retrieved , is ( expectedDefs ) ) ; }
Verify custom attrs retrieved from metatype service based upon phys link type.
Verify custom attrs retrieved from metatype service based upon phys link type .