blob: c65adfb21e44443d0ee0255676611bff17c34685 [file] [log] [blame]
Simon Hunt8d22c4b2015-08-06 16:24:43 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Simon Hunt8d22c4b2015-08-06 16:24:43 -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.
Simon Hunt8d22c4b2015-08-06 16:24:43 -070015 */
16
17package org.onosproject.ui.topo;
18
19import org.junit.Test;
20
21import static org.junit.Assert.assertFalse;
22import static org.junit.Assert.assertTrue;
23
24/**
25 * Unit tests for {@link ButtonId}.
26 */
27public class ButtonIdTest {
28
29 private static final String ID1 = "id-1";
30 private static final String ID2 = "id-2";
31
32 private ButtonId b1, b2;
33
34
35 @Test
36 public void basic() {
37 b1 = new ButtonId(ID1);
38 }
39
40 @Test
41 public void same() {
42 b1 = new ButtonId(ID1);
43 b2 = new ButtonId(ID1);
44 assertFalse("same ref?", b1 == b2);
45 assertTrue("not equal?", b1.equals(b2));
46 }
47
48 @Test
49 public void notSame() {
50 b1 = new ButtonId(ID1);
51 b2 = new ButtonId(ID2);
52 assertFalse("same ref?", b1 == b2);
53 assertFalse("equal?", b1.equals(b2));
54 }
55}