Search in sources :

Example 1 with BgpFsActionTrafficRate

use of org.onosproject.bgpio.types.BgpFsActionTrafficRate in project onos by opennetworkinglab.

the class BgpFlowSpecNlriTest method testEquality.

@Test
public void testEquality() {
    flowSpecComponents1.add(portNum1);
    byte[] port1 = new byte[] { (byte) 0x1 };
    operatorValue1.add(new BgpFsOperatorValue((byte) 0x81, port1));
    byte[] port11 = new byte[] { (byte) 0x1 };
    operatorValue1.add(new BgpFsOperatorValue((byte) 0x82, port11));
    List<BgpValueType> fsTlvs1 = new LinkedList<>();
    fsTlvs1.add(new BgpFsActionTrafficRate((short) 1, 1));
    flowSpecDetails1.setFsActionTlv(fsTlvs1);
    flowSpecComponents.add(portNum);
    byte[] port = new byte[] { (byte) 0x1 };
    operatorValue.add(new BgpFsOperatorValue((byte) 0x81, port));
    byte[] port4 = new byte[] { (byte) 0x1 };
    operatorValue.add(new BgpFsOperatorValue((byte) 0x82, port4));
    List<BgpValueType> fsTlvs = new LinkedList<>();
    fsTlvs.add(new BgpFsActionTrafficRate((short) 1, 1));
    flowSpecComponents2.add(portNum2);
    byte[] port2 = new byte[] { (byte) 0x1 };
    operatorValue2.add(new BgpFsOperatorValue((byte) 0x82, port2));
    byte[] port22 = new byte[] { (byte) 0x1 };
    operatorValue2.add(new BgpFsOperatorValue((byte) 0x82, port22));
    List<BgpValueType> fsTlvs2 = new LinkedList<>();
    fsTlvs2.add(new BgpFsActionTrafficRate((short) 1, 1));
    flowSpecDetails2.setFsActionTlv(fsTlvs2);
    new EqualsTester().addEqualityGroup(flowSpecDetails1, flowSpecDetails).addEqualityGroup(flowSpecDetails2).testEquals();
}
Also used : BgpValueType(org.onosproject.bgpio.types.BgpValueType) BgpFsActionTrafficRate(org.onosproject.bgpio.types.BgpFsActionTrafficRate) EqualsTester(com.google.common.testing.EqualsTester) BgpFsOperatorValue(org.onosproject.bgpio.types.BgpFsOperatorValue) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Aggregations

EqualsTester (com.google.common.testing.EqualsTester)1 LinkedList (java.util.LinkedList)1 Test (org.junit.Test)1 BgpFsActionTrafficRate (org.onosproject.bgpio.types.BgpFsActionTrafficRate)1 BgpFsOperatorValue (org.onosproject.bgpio.types.BgpFsOperatorValue)1 BgpValueType (org.onosproject.bgpio.types.BgpValueType)1