Thejaswi N K
Committed by Gerrit Code Review

[onos-2613] - Test for BGP unreserved bandwidth attribute.

Change-Id: I6e99e731e355da432bf709b912e8c28df3ea2156
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.bgpio.types.attr;
17 +
18 +import java.util.ArrayList;
19 +
20 +import org.junit.Test;
21 +
22 +import com.google.common.testing.EqualsTester;
23 +
24 +/**
25 + * Test for BGP unreserved bandwidth attribute.
26 + */
27 +public 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 +}
...\ No newline at end of file ...\ No newline at end of file