blob: b353bd8d2ed7c2839c0061e302e367a072eccf35 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 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 */
tomc0ccfb22014-09-08 00:41:32 -070016package org.onlab.onos.net.link;
17
18import org.junit.Test;
19import org.onlab.onos.net.DeviceId;
20import org.onlab.onos.net.PortNumber;
21
22import static org.junit.Assert.assertEquals;
23import static org.onlab.onos.net.DefaultLinkTest.cp;
24import static org.onlab.onos.net.DeviceId.deviceId;
25import static org.onlab.onos.net.Link.Type.DIRECT;
26import static org.onlab.onos.net.PortNumber.portNumber;
27
28/**
29 * Test of the default link description.
30 */
31public class DefaultLinkDescriptionTest {
32
33 private static final DeviceId DID1 = deviceId("of:foo");
34 private static final DeviceId DID2 = deviceId("of:bar");
35 private static final PortNumber P1 = portNumber(1);
36
37 @Test
38 public void basics() {
39 LinkDescription desc = new DefaultLinkDescription(cp(DID1, P1), cp(DID2, P1), DIRECT);
40 assertEquals("incorrect src", cp(DID1, P1), desc.src());
41 assertEquals("incorrect dst", cp(DID2, P1), desc.dst());
42 assertEquals("incorrect type", DIRECT, desc.type());
43 }
44
45}