BUG-4340: raise test coverage to 80% - clean disabled tests
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / device / DeviceStateImplTest.java
index de0410195867121198c6fb05df8817540aec6c66..1a854dfc00507660a4a796a151afde437f7d8ee1 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.openflowplugin.impl.device;
 
 import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
-import java.util.Set;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -23,7 +21,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortGrouping;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPort;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPortBuilder;
 
@@ -75,16 +72,6 @@ public class DeviceStateImplTest {
         new DeviceStateImpl(null, nodeId);
     }
 
-    /**
-     * Test method for {@link DeviceStateImpl#DeviceStateImpl(FeaturesReply, NodeId)}.
-     */
-    @Test(expected=IllegalArgumentException.class)
-    public void testDeviceStateImplNullPhyPort(){
-        final FeaturesReply emptyFeaturesReply = Mockito.mock(FeaturesReply.class);
-        Mockito.when(emptyFeaturesReply.getPhyPort()).thenReturn(null);
-        new DeviceStateImpl(emptyFeaturesReply, nodeId);
-    }
-
     /**
      * Test method for {@link DeviceStateImpl#getNodeId()}.
      */
@@ -107,76 +94,4 @@ public class DeviceStateImplTest {
         Assert.assertEquals(expetedResult.getPhyPort(), getFeatures.getPhyPort());
     }
 
-    /**
-     * Test method for {@link DeviceStateImpl#getPhysicalPorts()}.
-     */
-    @Test
-    public void testGetPhysicalPorts(){
-        final Map<Long, PortGrouping> getPhysPort = deviceState.getPhysicalPorts();
-        Assert.assertNotNull(getPhysPort);
-        Assert.assertTrue(getPhysPort.values().contains(pPort.get(0)));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#getPortsBandwidth()}.
-     */
-    @Test
-    public void testGetPortsBandwidth(){
-        final Map<Long, Long> portBandwidth = deviceState.getPortsBandwidth();
-        Assert.assertNotNull(portBandwidth);
-        Assert.assertTrue(portBandwidth.containsKey(portNr));
-        Assert.assertEquals(this.portBandwidth, portBandwidth.get(portNr));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#getPorts()}.
-     */
-    @Test
-    public void testGetPorts(){
-        final Set<Long> portNrs = deviceState.getPorts();
-        Assert.assertTrue(portNrs.contains(portNr));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#getPhysicalPort(java.lang.Long)}.
-     */
-    @Test
-    public void testGetPhysicalPort(){
-        Assert.assertEquals(pPort.get(0), deviceState.getPhysicalPort(portNr));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#getPortBandwidth(java.lang.Long)}.
-     */
-    @Test
-    public void testGetPortBandwidth(){
-        Assert.assertEquals(portBandwidth, deviceState.getPortBandwidth((portNr)));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#isPortEnabled(long)}.
-     */
-    @Test
-    public void testIsPortEnabledLong(){
-        Assert.assertTrue(deviceState.isPortEnabled(portNr));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#isPortEnabled(PortGrouping)}.
-     */
-    @Test
-    public void testIsPortEnabledPortGrouping(){
-        Assert.assertTrue(deviceState.isPortEnabled(pPort.get(0)));
-    }
-
-    /**
-     * Test method for {@link DeviceStateImpl#getEnabledPorts()}.
-     */
-    @Test
-    public void testGetEnabledPorts(){
-        final List<PortGrouping> getEnabledPort = deviceState.getEnabledPorts();
-        Assert.assertNotNull(getEnabledPort);
-        Assert.assertTrue(getEnabledPort.contains(pPort.get(0)));
-    }
-
 }