Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 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 | */ |
Brian O'Connor | 6de2e20 | 2015-05-21 14:30:41 -0700 | [diff] [blame] | 16 | package org.onosproject.incubator.net.resource.label; |
jcc | de3e92e | 2015-03-28 01:40:44 -0700 | [diff] [blame] | 17 | |
| 18 | import org.junit.Test; |
| 19 | import org.onosproject.event.AbstractEventTest; |
| 20 | |
| 21 | import com.google.common.testing.EqualsTester; |
| 22 | |
| 23 | /** |
| 24 | * Tests of default label resource. |
| 25 | */ |
| 26 | public class DefaultLabelResourceTest extends AbstractEventTest { |
| 27 | |
| 28 | @Test |
| 29 | public void testEquality() { |
| 30 | String deviceId1 = "of:001"; |
| 31 | String deviceId2 = "of:002"; |
| 32 | long labelResourceId1 = 100; |
| 33 | long labelResourceId2 = 200; |
| 34 | DefaultLabelResource h1 = new DefaultLabelResource(deviceId1, |
| 35 | labelResourceId1); |
| 36 | DefaultLabelResource h2 = new DefaultLabelResource(deviceId1, |
| 37 | labelResourceId1); |
| 38 | DefaultLabelResource h3 = new DefaultLabelResource(deviceId2, |
| 39 | labelResourceId2); |
| 40 | DefaultLabelResource h4 = new DefaultLabelResource(deviceId2, |
| 41 | labelResourceId2); |
| 42 | |
| 43 | new EqualsTester().addEqualityGroup(h1, h2).addEqualityGroup(h3, h4) |
| 44 | .testEquals(); |
| 45 | } |
| 46 | } |