Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -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 | */ |
| 16 | |
| 17 | package org.onosproject.ui.model.topo; |
| 18 | |
Simon Hunt | c0f20c1 | 2016-05-09 09:30:20 -0700 | [diff] [blame] | 19 | import org.junit.Before; |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 20 | import org.junit.Test; |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 21 | import org.onosproject.ui.model.AbstractUiModelTest; |
| 22 | |
| 23 | import static org.junit.Assert.assertEquals; |
| 24 | |
| 25 | /** |
| 26 | * Unit tests for {@link UiClusterMember}. |
| 27 | */ |
| 28 | public class UiClusterMemberTest extends AbstractUiModelTest { |
| 29 | |
Simon Hunt | c0f20c1 | 2016-05-09 09:30:20 -0700 | [diff] [blame] | 30 | private UiTopology topo; |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 31 | private UiClusterMember member; |
| 32 | |
Simon Hunt | c0f20c1 | 2016-05-09 09:30:20 -0700 | [diff] [blame] | 33 | @Before |
| 34 | public void setUp() { |
Thomas Vachuska | b877a6f | 2017-04-14 11:43:30 -0700 | [diff] [blame] | 35 | topo = new UiTopology(MOCK_SERVICES); |
Simon Hunt | c0f20c1 | 2016-05-09 09:30:20 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 38 | @Test |
| 39 | public void basic() { |
| 40 | title("basic"); |
Simon Hunt | c0f20c1 | 2016-05-09 09:30:20 -0700 | [diff] [blame] | 41 | member = new UiClusterMember(topo, CNODE_1); |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 42 | print(member); |
| 43 | |
| 44 | assertEquals("wrong id", NODE_ID, member.id()); |
| 45 | assertEquals("wrong IP", NODE_IP, member.ip()); |
Simon Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 46 | } |
| 47 | } |