mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestCustomCommsServiceImpl_Physical.java
@Test
    public void testRequestPhysicalLink() throws IllegalArgumentException, CCommException, 
        FactoryObjectInformationException 
    {
        String name = "name";
        
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, name);
        
        //mocking
        when(m_PhysRegistry.getObjectByName(name)).thenReturn(m_PhysInternal);
        when(m_PhysInternal.isInUse()).thenReturn(false);
        
        //act
        PhysicalLink recvd = m_SUT.requestPhysicalLink(name);
        
        //assertions
        assertThat(recvd, is(notNullValue()));
        assertThat(physicalLink.getName(), is(recvd.getName()));
        
        //verification
        verify(m_PhysInternal).setInUse(true);
    }
/**
     * Verify that a physical link can be requested successfully.
     */
Verify that a physical link can be requested successfully.
Verify that a physical link can be requested successfully .
@Test
    public void testRequestPhysicalLink() throws IllegalArgumentException, CCommException, 
        FactoryObjectInformationException 
    {
        String name = "name";
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, name);
        when(m_PhysRegistry.getObjectByName(name)).thenReturn(m_PhysInternal);
        when(m_PhysInternal.isInUse()).thenReturn(false);
        PhysicalLink recvd = m_SUT.requestPhysicalLink(name);
        assertThat(recvd, is(notNullValue()));
        assertThat(physicalLink.getName(), is(recvd.getName()));
        verify(m_PhysInternal).setInUse(true);
    }
@ Test public void testRequestPhysicalLink ( ) throws IllegalArgumentException , CCommException , FactoryObjectInformationException { String name = "name" ; PhysicalLink physicalLink = m_SUT . createPhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , name ) ; when ( m_PhysRegistry . getObjectByName ( name ) ) . thenReturn ( m_PhysInternal ) ; when ( m_PhysInternal . isInUse ( ) ) . thenReturn ( false ) ; PhysicalLink recvd = m_SUT . requestPhysicalLink ( name ) ; assertThat ( recvd , is ( notNullValue ( ) ) ) ; assertThat ( physicalLink . getName ( ) , is ( recvd . getName ( ) ) ) ; verify ( m_PhysInternal ) . setInUse ( true ) ; }
Verify that a physical link can be requested successfully.
Verify that a physical link can be requested successfully .
//mocking //act //assertions //verification