blob: e8bc68ccf6352d110d73b4390710b740481cb236 [file] [log] [blame]
Konstantinos Kanonakis0a9031d2016-09-22 11:35:11 -05001/*
2 * Copyright 2016-present 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.net.behaviour;
17
18import com.google.common.testing.EqualsTester;
19import org.junit.Test;
20import org.onlab.packet.DscpClass;
21import static org.onosproject.net.behaviour.BandwidthProfileAction.Action;
22
23/**
24 * Test for BandwidthProfileAction class.
25 */
26public class BandwidthProfileActionTest {
27
28 @Test
29 public void testEquals() {
30 BandwidthProfileAction passAction1 = BandwidthProfileAction.builder()
31 .action(Action.PASS)
32 .build();
33 BandwidthProfileAction passAction2 = BandwidthProfileAction.builder()
34 .action(Action.PASS)
35 .build();
36 BandwidthProfileAction discardAction1 = BandwidthProfileAction.builder()
37 .action(Action.DISCARD)
38 .build();
39 BandwidthProfileAction discardAction2 = BandwidthProfileAction.builder()
40 .action(Action.DISCARD)
41 .build();
42 BandwidthProfileAction remarkAction1 = BandwidthProfileAction.builder()
43 .action(Action.REMARK)
44 .dscpClass(DscpClass.AF11)
45 .build();
46 BandwidthProfileAction remarkAction2 = BandwidthProfileAction.builder()
47 .action(Action.REMARK)
48 .dscpClass(DscpClass.AF11)
49 .build();
50 new EqualsTester()
51 .addEqualityGroup(passAction1, passAction2)
52 .addEqualityGroup(discardAction1, discardAction2)
53 .addEqualityGroup(remarkAction1, remarkAction2)
54 .testEquals();
55 }
56}