blob: 3fd70d10e9b011b9468a63cba4c1e02248a2df29 [file] [log] [blame]
Simon Huntc13082f2016-08-03 21:20:23 -07001/*
2 * Copyright 2016-present Open Networking Laboratory
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
17package org.onosproject.ui.model.topo;
18
19import org.junit.Test;
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.region.RegionId;
22import org.onosproject.ui.model.AbstractUiModelTest;
23
24import static org.junit.Assert.assertEquals;
25import static org.onosproject.net.DeviceId.deviceId;
26import static org.onosproject.net.PortNumber.P0;
27import static org.onosproject.net.region.RegionId.regionId;
28
29/**
30 * Unit tests for {@link UiRegionDeviceLink}.
31 */
32public class UiRegionDeviceLinkTest extends AbstractUiModelTest {
33
34 private static final RegionId R1 = regionId("r1");
35 private static final DeviceId DEV_X = deviceId("device-X");
36
37 @Test
38 public void basic() {
39 title("basic");
40 UiLinkId id = UiLinkId.uiLinkId(R1, DEV_X, P0);
41 UiRegionDeviceLink link = new UiRegionDeviceLink(null, id);
42 print(link);
43 assertEquals("region", R1, link.region());
44 assertEquals("device", DEV_X, link.device());
45 assertEquals("port", P0, link.port());
46 }
47}