Yuta HIGUCHI | 5ec89f9 | 2014-10-12 01:01:43 -0700 | [diff] [blame] | 1 | package org.onlab.onos.store.device.impl; |
Yuta HIGUCHI | 60e4abf | 2014-10-10 11:30:44 -0700 | [diff] [blame] | 2 | |
| 3 | import static org.onlab.onos.net.DeviceId.deviceId; |
| 4 | |
| 5 | import org.junit.Test; |
| 6 | import org.onlab.onos.net.DeviceId; |
| 7 | import org.onlab.onos.net.provider.ProviderId; |
| 8 | |
| 9 | import com.google.common.testing.EqualsTester; |
| 10 | |
| 11 | public class DeviceFragmentIdTest { |
| 12 | |
| 13 | private static final ProviderId PID = new ProviderId("of", "foo"); |
| 14 | private static final ProviderId PIDA = new ProviderId("of", "bar", true); |
| 15 | private static final DeviceId DID1 = deviceId("of:foo"); |
| 16 | private static final DeviceId DID2 = deviceId("of:bar"); |
| 17 | |
| 18 | @Test |
| 19 | public final void testEquals() { |
| 20 | |
| 21 | new EqualsTester() |
| 22 | .addEqualityGroup(new DeviceFragmentId(DID1, PID), |
| 23 | new DeviceFragmentId(DID1, PID)) |
| 24 | .addEqualityGroup(new DeviceFragmentId(DID2, PID), |
| 25 | new DeviceFragmentId(DID2, PID)) |
| 26 | .addEqualityGroup(new DeviceFragmentId(DID1, PIDA), |
| 27 | new DeviceFragmentId(DID1, PIDA)) |
| 28 | .addEqualityGroup(new DeviceFragmentId(DID2, PIDA), |
| 29 | new DeviceFragmentId(DID2, PIDA)) |
| 30 | .testEquals(); |
| 31 | } |
| 32 | |
| 33 | } |