import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketIn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessageBuilder;
-/**
- * Created by Tomas Slusny on 24.3.2016.
- */
@RunWith(MockitoJUnitRunner.class)
public class NodeConnectorRefToPortTranslatorTest extends TestCase {
- static final String PACKET_DATA = "Test_Data";
- static final Long PORT_NO = 5l;
- static final Long SECOND_PORT_NO = 6l;
- static final BigInteger DATA_PATH_ID = BigInteger.TEN;
- static final short OF_VERSION = OFConstants.OFP_VERSION_1_3;
- static final String ID_VALUE = "openflow:" + DATA_PATH_ID;
- static final Long TABLE_ID = 42L;
+ private static final String PACKET_DATA = "Test_Data";
+ private static final Long PORT_NO = 5L;
+ private static final BigInteger DATA_PATH_ID = BigInteger.TEN;
+ private static final short OF_VERSION = OFConstants.OFP_VERSION_1_3;
+ private static final Long TABLE_ID = 42L;
private static PacketIn createPacketIn(long portNo) {
InPortBuilder inPortBuilder = new InPortBuilder()
.build();
}
- @Test(expected = NullPointerException.class)
- public void testForNotNullablePacketInInGetPortNo() throws Exception {
- NodeConnectorRefToPortTranslator.getPortNoFromPacketIn(null);
- }
-
- @Test(expected = NullPointerException.class)
- public void testForNotNullablePacketInInToNodeConnectorRef() throws Exception {
- NodeConnectorRefToPortTranslator.toNodeConnectorRef(null, DATA_PATH_ID);
- }
-
- @Test(expected = NullPointerException.class)
- public void testForNotNullableNodeConnectorRefInFromNodeConnectorRef() throws Exception {
- NodeConnectorRefToPortTranslator.fromNodeConnectorRef(null, OF_VERSION);
- }
-
@Test
- public void testGetPortNoFromPacketIn() throws Exception {
+ public void testGetPortNoFromPacketIn() {
PacketIn packetIn = createPacketIn(PORT_NO);
Long portNo = NodeConnectorRefToPortTranslator.getPortNoFromPacketIn(packetIn);
assertEquals(portNo, PORT_NO);
}
@Test
- public void testNodeConnectorConversion() throws Exception {
+ public void testNodeConnectorConversion() {
// Mock the packet in message
PacketIn packetIn = createPacketIn(PORT_NO);