jcc | 3d4e14a | 2015-04-21 11:32:05 +0800 | [diff] [blame] | 1 | package org.onosproject.net.flow; |
| 2 | |
| 3 | import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable; |
| 4 | |
| 5 | import org.junit.Test; |
| 6 | |
| 7 | import com.google.common.testing.EqualsTester; |
| 8 | /** |
| 9 | * Test for FlowRuleExtPayLoad. |
| 10 | */ |
| 11 | public class FlowRuleExtPayLoadTest { |
| 12 | final byte[] b = new byte[3]; |
| 13 | final byte[] b1 = new byte[5]; |
| 14 | final FlowRuleExtPayLoad payLoad1 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b); |
| 15 | final FlowRuleExtPayLoad sameAsPayLoad1 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b); |
| 16 | final FlowRuleExtPayLoad payLoad2 = FlowRuleExtPayLoad.flowRuleExtPayLoad(b1); |
| 17 | |
| 18 | /** |
| 19 | * Checks that the FlowRuleExtPayLoad class is immutable. |
| 20 | */ |
| 21 | @Test |
| 22 | public void testImmutability() { |
| 23 | assertThatClassIsImmutable(FlowRuleExtPayLoad.class); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Checks the operation of equals(), hashCode() and toString() methods. |
| 28 | */ |
| 29 | @Test |
| 30 | public void testEquals() { |
| 31 | new EqualsTester() |
| 32 | .addEqualityGroup(payLoad1, sameAsPayLoad1) |
| 33 | .addEqualityGroup(payLoad2) |
| 34 | .testEquals(); |
| 35 | } |
| 36 | } |