Thejaswi N K
Committed by Ray Milkey

[onos-2613] - Unit testing of BgpLinkAttrProtectionType

Change-Id: I2d16c5fd863b99767a8729ea06fa04b09a362019
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
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 + */
16 +package org.onosproject.bgp;
17 +
18 +import org.junit.Test;
19 +import org.onosproject.bgpio.types.attr.BgpLinkAttrProtectionType;
20 +
21 +import com.google.common.testing.EqualsTester;
22 +
23 +/**
24 + * Test for MPLS protocol mask attribute.
25 + */
26 +public class BgpLinkAttrProtectionTypeTest {
27 + boolean bExtraTraffic = true;
28 + boolean bUnprotected = true;
29 + boolean bShared = true;
30 + boolean bDedOneIstoOne = true;
31 + boolean bDedOnePlusOne = true;
32 + boolean bEnhanced = true;
33 +
34 + boolean bExtraTraffic1 = false;
35 + boolean bUnprotected1 = false;
36 + boolean bShared1 = false;
37 + boolean bDedOneIstoOne1 = false;
38 + boolean bDedOnePlusOne1 = false;
39 + boolean bEnhanced1 = false;
40 +
41 + private final BgpLinkAttrProtectionType data = BgpLinkAttrProtectionType
42 + .of(bExtraTraffic, bUnprotected, bShared, bDedOneIstoOne,
43 + bDedOnePlusOne, bEnhanced);
44 + private final BgpLinkAttrProtectionType sameAsData = BgpLinkAttrProtectionType
45 + .of(bExtraTraffic, bUnprotected, bShared, bDedOneIstoOne,
46 + bDedOnePlusOne, bEnhanced);
47 + private final BgpLinkAttrProtectionType diffData = BgpLinkAttrProtectionType
48 + .of(bExtraTraffic1, bUnprotected1, bShared1, bDedOneIstoOne1,
49 + bDedOnePlusOne1, bEnhanced1);
50 +
51 + @Test
52 + public void basics() {
53 +
54 + new EqualsTester().addEqualityGroup(data, sameAsData)
55 + .addEqualityGroup(diffData).testEquals();
56 + }
57 +}
...\ No newline at end of file ...\ No newline at end of file