blob: f1d2a1fa8a55562a6269b0b961e0424c349386b9 [file] [log] [blame]
Thejaswi N K326fe692015-11-20 23:40:59 +05301/*
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 */
16package org.onosproject.bgpio.types.attr;
17
18import java.util.ArrayList;
19
20import org.junit.Test;
21
22import com.google.common.testing.EqualsTester;
23
24/**
25 * Test for BGP unreserved bandwidth attribute.
26 */
27public class BgpLinkAttrUnRsrvdLinkBandwidthTest {
28 ArrayList<Float> maxUnResBandwidth = new ArrayList<Float>();
29 ArrayList<Float> maxUnResBandwidth1 = new ArrayList<Float>();
30 short sType = 10;
31
32 private final BgpLinkAttrUnRsrvdLinkBandwidth isisData = BgpLinkAttrUnRsrvdLinkBandwidth
33 .of(maxUnResBandwidth, sType);
34 private final BgpLinkAttrUnRsrvdLinkBandwidth sameAsIsisData = BgpLinkAttrUnRsrvdLinkBandwidth
35 .of(maxUnResBandwidth, sType);
36 private final BgpLinkAttrUnRsrvdLinkBandwidth isisDiff = BgpLinkAttrUnRsrvdLinkBandwidth
37 .of(maxUnResBandwidth1, sType);
38
39 @Test
40 public void basics() {
41
42 maxUnResBandwidth.add(new Float(1));
43 maxUnResBandwidth.add(new Float(2));
44 maxUnResBandwidth.add(new Float(3));
45 maxUnResBandwidth.add(new Float(4));
46
47 maxUnResBandwidth1.add(new Float(1));
48 maxUnResBandwidth1.add(new Float(2));
49 maxUnResBandwidth1.add(new Float(3));
50 maxUnResBandwidth1.add(new Float(1));
51
52 new EqualsTester().addEqualityGroup(isisData, sameAsIsisData)
53 .addEqualityGroup(isisDiff).testEquals();
54
55 }
56}