mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestCustomCommsServiceImpl_Physical.java
@Test
    public void testTryCreatePhysicalLinkUnknownWithProps() throws CCommException, IOException, 
        InterruptedException, FactoryException, FactoryObjectInformationException, IllegalArgumentException, 
            ClassNotFoundException
    {
        //minor setup
        String name = "Some_Name";
        when(m_PhysInternal.getName()).thenReturn(name);
        when(m_PhysRegistry.getObjectNames()).thenReturn(new ArrayList<String>());
        when(m_PhysRegistry.getObjectByName(name)).thenReturn(m_PhysInternal);
        Map<String, Object> props = new HashMap<>();
        props.put("key", "value");
        
        //try to create
        m_SUT.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, name, props);

        verify(m_PhysRegistry, times(1)).createNewObject(m_PhysFactory, name, props);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
/**
     * Verify that if a physical link with the given name is not already created that it will be created with 
     * properties.
     */
Verify that if a physical link with the given name is not already created that it will be created with
properties.
Verify that if a physical link with the given name is not already created that it will be created with properties .
@Test
    public void testTryCreatePhysicalLinkUnknownWithProps() throws CCommException, IOException, 
        InterruptedException, FactoryException, FactoryObjectInformationException, IllegalArgumentException, 
            ClassNotFoundException
    {
        String name = "Some_Name";
        when(m_PhysInternal.getName()).thenReturn(name);
        when(m_PhysRegistry.getObjectNames()).thenReturn(new ArrayList<String>());
        when(m_PhysRegistry.getObjectByName(name)).thenReturn(m_PhysInternal);
        Map<String, Object> props = new HashMap<>();
        props.put("key", "value");
        m_SUT.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, name, props);
        verify(m_PhysRegistry, times(1)).createNewObject(m_PhysFactory, name, props);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
@ Test public void testTryCreatePhysicalLinkUnknownWithProps ( ) throws CCommException , IOException , InterruptedException , FactoryException , FactoryObjectInformationException , IllegalArgumentException , ClassNotFoundException { String name = "Some_Name" ; when ( m_PhysInternal . getName ( ) ) . thenReturn ( name ) ; when ( m_PhysRegistry . getObjectNames ( ) ) . thenReturn ( new ArrayList < String > ( ) ) ; when ( m_PhysRegistry . getObjectByName ( name ) ) . thenReturn ( m_PhysInternal ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( "key" , "value" ) ; m_SUT . tryCreatePhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , name , props ) ; verify ( m_PhysRegistry , times ( 1 ) ) . createNewObject ( m_PhysFactory , name , props ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; }
Verify that if a physical link with the given name is not already created that it will be created with
 properties.
Verify that if a physical link with the given name is not already created that it will be created with properties .
//minor setup //try to create