mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/comms/TestCommsStackModel.java
@Test
    public void testSetters()
    {
      //create comms stack model
        CommsStackModelImpl model = new CommsStackModelImpl(m_CommsImageInterface);        
        //set transport
        CommsLayerBaseModel base = new CommsLayerBaseModel(0, m_Uuid, COMM_PID, "clazz", 
                CommType.TransportLayer, m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        model.setTransport(base);
        //Ensure that data is the same since type returned is not same as type passed in setter
        assertThat(model.getTransport().getUuid(), is(base.getUuid()));
        assertThat(model.getTransport().getPid(), is(base.getPid()));
        assertThat(model.getTransport().getControllerId(), is(base.getControllerId()));
        
        //set physical layer
        CommsLayerBaseModel phys = new CommsLayerBaseModel(0, m_Uuid, COMM_PID, 
                "clazz", CommType.PhysicalLink, m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        model.setPhysical(phys);
        //Ensure that data is the same since type returned is not same as type passed in setter
        assertThat(model.getPhysical().getUuid(), is(base.getUuid()));
        assertThat(model.getPhysical().getPid(), is(base.getPid()));
        assertThat(model.getPhysical().getControllerId(), is(base.getControllerId()));
        
        //set link layer
        CommsLayerLinkModelImpl link = new CommsLayerLinkModelImpl(0, m_Uuid, COMM_PID, "clazz", 
                m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        model.setLink(link);
        //Ensure that data is the same since type returned is not same as type passed in setter
        assertThat(model.getLink().getPid(), is(COMM_PID));
        assertThat(model.getLink().getUuid(), is(m_Uuid));
        assertThat(model.getLink().getControllerId(), is(link.getControllerId()));

        //set the stack complete
        model.setStackComplete();
        assertThat(model.isComplete(), is(true));
        
        List<FactoryBaseModel> layersList = model.getStackLayers();
        assertThat(layersList.size(), is(3)); //all three layers are in stack        
    }
/**
     * Test setter methods of the asset model.
     * 
     * Verify that isX methods update appropriately to newly set values.
     */
Test setter methods of the asset model.

Verify that isX methods update appropriately to newly set values.
Test setter methods of the asset model . Verify that isX methods update appropriately to newly set values .
@Test
    public void testSetters()
    {
        CommsStackModelImpl model = new CommsStackModelImpl(m_CommsImageInterface);        
        CommsLayerBaseModel base = new CommsLayerBaseModel(0, m_Uuid, COMM_PID, "clazz", 
                CommType.TransportLayer, m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        model.setTransport(base);
        assertThat(model.getTransport().getUuid(), is(base.getUuid()));
        assertThat(model.getTransport().getPid(), is(base.getPid()));
        assertThat(model.getTransport().getControllerId(), is(base.getControllerId()));
        CommsLayerBaseModel phys = new CommsLayerBaseModel(0, m_Uuid, COMM_PID, 
                "clazz", CommType.PhysicalLink, m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        model.setPhysical(phys);
        assertThat(model.getPhysical().getUuid(), is(base.getUuid()));
        assertThat(model.getPhysical().getPid(), is(base.getPid()));
        assertThat(model.getPhysical().getControllerId(), is(base.getControllerId()));
        CommsLayerLinkModelImpl link = new CommsLayerLinkModelImpl(0, m_Uuid, COMM_PID, "clazz", 
                m_FactoryMgr, m_TypesMgr, m_ConfigWrapper, m_CommsImageInterface);
        model.setLink(link);
        assertThat(model.getLink().getPid(), is(COMM_PID));
        assertThat(model.getLink().getUuid(), is(m_Uuid));
        assertThat(model.getLink().getControllerId(), is(link.getControllerId()));
        model.setStackComplete();
        assertThat(model.isComplete(), is(true));
        List<FactoryBaseModel> layersList = model.getStackLayers();
        assertThat(layersList.size(), is(3)); 
    }
@ Test public void testSetters ( ) { CommsStackModelImpl model = new CommsStackModelImpl ( m_CommsImageInterface ) ; CommsLayerBaseModel base = new CommsLayerBaseModel ( 0 , m_Uuid , COMM_PID , "clazz" , CommType . TransportLayer , m_FactoryMgr , m_TypesMgr , m_ConfigWrapper , m_CommsImageInterface ) ; model . setTransport ( base ) ; assertThat ( model . getTransport ( ) . getUuid ( ) , is ( base . getUuid ( ) ) ) ; assertThat ( model . getTransport ( ) . getPid ( ) , is ( base . getPid ( ) ) ) ; assertThat ( model . getTransport ( ) . getControllerId ( ) , is ( base . getControllerId ( ) ) ) ; CommsLayerBaseModel phys = new CommsLayerBaseModel ( 0 , m_Uuid , COMM_PID , "clazz" , CommType . PhysicalLink , m_FactoryMgr , m_TypesMgr , m_ConfigWrapper , m_CommsImageInterface ) ; model . setPhysical ( phys ) ; assertThat ( model . getPhysical ( ) . getUuid ( ) , is ( base . getUuid ( ) ) ) ; assertThat ( model . getPhysical ( ) . getPid ( ) , is ( base . getPid ( ) ) ) ; assertThat ( model . getPhysical ( ) . getControllerId ( ) , is ( base . getControllerId ( ) ) ) ; CommsLayerLinkModelImpl link = new CommsLayerLinkModelImpl ( 0 , m_Uuid , COMM_PID , "clazz" , m_FactoryMgr , m_TypesMgr , m_ConfigWrapper , m_CommsImageInterface ) ; model . setLink ( link ) ; assertThat ( model . getLink ( ) . getPid ( ) , is ( COMM_PID ) ) ; assertThat ( model . getLink ( ) . getUuid ( ) , is ( m_Uuid ) ) ; assertThat ( model . getLink ( ) . getControllerId ( ) , is ( link . getControllerId ( ) ) ) ; model . setStackComplete ( ) ; assertThat ( model . isComplete ( ) , is ( true ) ) ; List < FactoryBaseModel > layersList = model . getStackLayers ( ) ; assertThat ( layersList . size ( ) , is ( 3 ) ) ; }
Test setter methods of the asset model.
Test setter methods of the asset model .
//create comms stack model //set transport //Ensure that data is the same since type returned is not same as type passed in setter //set physical layer //Ensure that data is the same since type returned is not same as type passed in setter //set link layer //Ensure that data is the same since type returned is not same as type passed in setter //set the stack complete //all three layers are in stack        