mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestCustomCommsServiceImpl_Physical.java
@Test
    public void testRequestPhysicalLinkUuid() throws FactoryException, IllegalArgumentException, 
        FactoryObjectInformationException, CCommException
    {
        String name = "name";
        
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, name);
        
        //mocking
        when(m_PhysRegistry.getObjectByUuid(m_PhysUuidUno)).thenReturn(m_PhysInternal);
        when(m_PhysInternal.isInUse()).thenReturn(false);
        
        //request
        PhysicalLink recvd = m_SUT.requestPhysicalLink(physicalLink.getUuid());
        
        // verify the received physical link is the same as the created and that its in use flag is set
        assertThat(recvd, is(notNullValue()));
        assertThat(physicalLink.getUuid(), is(recvd.getUuid()));
        
        //verify in use flag setting
        verify(m_PhysInternal).setInUse(true);
    }
/**
     * Verify that a physical link can be requested using a uuid.
     */
Verify that a physical link can be requested using a uuid.
Verify that a physical link can be requested using a uuid .
@Test
    public void testRequestPhysicalLinkUuid() throws FactoryException, IllegalArgumentException, 
        FactoryObjectInformationException, CCommException
    {
        String name = "name";
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, name);
        when(m_PhysRegistry.getObjectByUuid(m_PhysUuidUno)).thenReturn(m_PhysInternal);
        when(m_PhysInternal.isInUse()).thenReturn(false);
        PhysicalLink recvd = m_SUT.requestPhysicalLink(physicalLink.getUuid());
        assertThat(recvd, is(notNullValue()));
        assertThat(physicalLink.getUuid(), is(recvd.getUuid()));
        verify(m_PhysInternal).setInUse(true);
    }
@ Test public void testRequestPhysicalLinkUuid ( ) throws FactoryException , IllegalArgumentException , FactoryObjectInformationException , CCommException { String name = "name" ; PhysicalLink physicalLink = m_SUT . createPhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , name ) ; when ( m_PhysRegistry . getObjectByUuid ( m_PhysUuidUno ) ) . thenReturn ( m_PhysInternal ) ; when ( m_PhysInternal . isInUse ( ) ) . thenReturn ( false ) ; PhysicalLink recvd = m_SUT . requestPhysicalLink ( physicalLink . getUuid ( ) ) ; assertThat ( recvd , is ( notNullValue ( ) ) ) ; assertThat ( physicalLink . getUuid ( ) , is ( recvd . getUuid ( ) ) ) ; verify ( m_PhysInternal ) . setInUse ( true ) ; }
Verify that a physical link can be requested using a uuid.
Verify that a physical link can be requested using a uuid .
//mocking //request // verify the received physical link is the same as the created and that its in use flag is set //verify in use flag setting