blob: 6a0c3833e217f4099ab54d6534cf6bade69554a2 [file] [log] [blame]
Simon Hunt642bc452016-05-04 19:34:45 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Simon Hunt642bc452016-05-04 19:34:45 -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.
15 */
16
17package org.onosproject.ui.model.topo;
18
Simon Huntc0f20c12016-05-09 09:30:20 -070019import org.junit.Before;
Simon Hunt642bc452016-05-04 19:34:45 -070020import org.junit.Test;
Simon Hunt642bc452016-05-04 19:34:45 -070021import org.onosproject.ui.model.AbstractUiModelTest;
22
23import static org.junit.Assert.assertEquals;
24
25/**
26 * Unit tests for {@link UiClusterMember}.
27 */
28public class UiClusterMemberTest extends AbstractUiModelTest {
29
Simon Huntc0f20c12016-05-09 09:30:20 -070030 private UiTopology topo;
Simon Hunt642bc452016-05-04 19:34:45 -070031 private UiClusterMember member;
32
Simon Huntc0f20c12016-05-09 09:30:20 -070033 @Before
34 public void setUp() {
Thomas Vachuskab877a6f2017-04-14 11:43:30 -070035 topo = new UiTopology(MOCK_SERVICES);
Simon Huntc0f20c12016-05-09 09:30:20 -070036 }
37
Simon Hunt642bc452016-05-04 19:34:45 -070038 @Test
39 public void basic() {
40 title("basic");
Simon Huntc0f20c12016-05-09 09:30:20 -070041 member = new UiClusterMember(topo, CNODE_1);
Simon Hunt642bc452016-05-04 19:34:45 -070042 print(member);
43
44 assertEquals("wrong id", NODE_ID, member.id());
45 assertEquals("wrong IP", NODE_IP, member.ip());
Simon Hunt642bc452016-05-04 19:34:45 -070046 }
47}