2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.bgpio.types.attr;
18 import org.junit.Test;
20 import com.google.common.testing.EqualsTester;
23 * Test for MPLS protocol mask attribute.
25 public class BgpLinkAttrProtectionTypeTest {
26 boolean bExtraTraffic = true;
27 boolean bUnprotected = true;
28 boolean bShared = true;
29 boolean bDedOneIstoOne = true;
30 boolean bDedOnePlusOne = true;
31 boolean bEnhanced = true;
33 boolean bExtraTraffic1 = false;
34 boolean bUnprotected1 = false;
35 boolean bShared1 = false;
36 boolean bDedOneIstoOne1 = false;
37 boolean bDedOnePlusOne1 = false;
38 boolean bEnhanced1 = false;
40 private final BgpLinkAttrProtectionType data = BgpLinkAttrProtectionType
41 .of(bExtraTraffic, bUnprotected, bShared, bDedOneIstoOne,
42 bDedOnePlusOne, bEnhanced);
43 private final BgpLinkAttrProtectionType sameAsData = BgpLinkAttrProtectionType
44 .of(bExtraTraffic, bUnprotected, bShared, bDedOneIstoOne,
45 bDedOnePlusOne, bEnhanced);
46 private final BgpLinkAttrProtectionType diffData = BgpLinkAttrProtectionType
47 .of(bExtraTraffic1, bUnprotected1, bShared1, bDedOneIstoOne1,
48 bDedOnePlusOne1, bEnhanced1);
51 public void basics() {
53 new EqualsTester().addEqualityGroup(data, sameAsData)
54 .addEqualityGroup(diffData).testEquals();