blob: 9cc8cf5e7bcac11851ee97733a075127ae1c6022 [file] [log] [blame]
Shashikanth VHfe2fb202016-02-05 18:45:07 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Shashikanth VHfe2fb202016-02-05 18:45:07 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.bgpio.protocol.flowspec;
17
18import org.junit.Test;
19
20import org.onlab.packet.IpPrefix;
21
22import com.google.common.testing.EqualsTester;
23
24/**
25 * Test for BgpFsDestinationPrefix flow specification component.
26 */
27public class BgpFlowSpecPrefixTest {
28 private IpPrefix destinationPrefix1 = IpPrefix.valueOf("21.21.21.21/16");
29 private IpPrefix sourcePrefix1 = IpPrefix.valueOf("11.11.11.11/16");
30 private IpPrefix destinationPrefix2 = IpPrefix.valueOf("42.42.42.42/16");
31 private IpPrefix sourcePrefix2 = IpPrefix.valueOf("32.32.32.32/16");
32
33 private final BgpFlowSpecPrefix tlv1 = new BgpFlowSpecPrefix(destinationPrefix1, sourcePrefix1);
34 private final BgpFlowSpecPrefix sameAsTlv1 = new BgpFlowSpecPrefix(destinationPrefix1, sourcePrefix1);
35 private final BgpFlowSpecPrefix tlv2 = new BgpFlowSpecPrefix(destinationPrefix2, sourcePrefix2);
36
37 @Test
38 public void testEquality() {
39 new EqualsTester()
40 .addEqualityGroup(tlv1, sameAsTlv1)
41 .addEqualityGroup(tlv2)
42 .testEquals();
43 }
44}