jcc | de3e92e | 2015-03-28 01:40:44 -0700 | [diff] [blame] | 1 | package org.onosproject.net.resource; |
| 2 | |
| 3 | import org.junit.Test; |
| 4 | import org.onosproject.event.AbstractEventTest; |
| 5 | |
| 6 | import com.google.common.testing.EqualsTester; |
| 7 | |
| 8 | /** |
| 9 | * Tests of default label resource. |
| 10 | */ |
| 11 | public class DefaultLabelResourceTest extends AbstractEventTest { |
| 12 | |
| 13 | @Test |
| 14 | public void testEquality() { |
| 15 | String deviceId1 = "of:001"; |
| 16 | String deviceId2 = "of:002"; |
| 17 | long labelResourceId1 = 100; |
| 18 | long labelResourceId2 = 200; |
| 19 | DefaultLabelResource h1 = new DefaultLabelResource(deviceId1, |
| 20 | labelResourceId1); |
| 21 | DefaultLabelResource h2 = new DefaultLabelResource(deviceId1, |
| 22 | labelResourceId1); |
| 23 | DefaultLabelResource h3 = new DefaultLabelResource(deviceId2, |
| 24 | labelResourceId2); |
| 25 | DefaultLabelResource h4 = new DefaultLabelResource(deviceId2, |
| 26 | labelResourceId2); |
| 27 | |
| 28 | new EqualsTester().addEqualityGroup(h1, h2).addEqualityGroup(h3, h4) |
| 29 | .testEquals(); |
| 30 | } |
| 31 | } |