blob: 26a743a4835ed1777627af348c2bf6c4235b1c28 [file] [log] [blame]
Thomas Vachuska58de4162015-09-10 16:15:33 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Thomas Vachuska58de4162015-09-10 16:15:33 -07003 *
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 */
jcc3d4e14a2015-04-21 11:32:05 +080016package org.onosproject.net.flow;
17
18import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
19
20import org.junit.Test;
21
22import com.google.common.testing.EqualsTester;
23/**
24 * Test for FlowRuleExtPayLoad.
25 */
26public class FlowRuleExtPayLoadTest {
27 final byte[] b = new byte[3];
28 final byte[] b1 = new byte[5];
29 final FlowRuleExtPayLoad payLoad1 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
30 final FlowRuleExtPayLoad sameAsPayLoad1 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b);
31 final FlowRuleExtPayLoad payLoad2 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b1);
32
33 /**
34 * Checks that the FlowRuleExtPayLoad class is immutable.
35 */
36 @Test
37 public void testImmutability() {
38 assertThatClassIsImmutable(FlowRuleExtPayLoad.class);
39 }
40
41 /**
42 * Checks the operation of equals(), hashCode() and toString() methods.
43 */
44 @Test
45 public void testEquals() {
46 new EqualsTester()
47 .addEqualityGroup(payLoad1, sameAsPayLoad1)
48 .addEqualityGroup(payLoad2)
49 .testEquals();
50 }
51}