Open Kilda Java Documentation
IslInfoDataTest.java
Go to the documentation of this file.
1 /* Copyright 2017 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.messaging.info.event;
17 
18 import static org.junit.Assert.assertFalse;
19 import static org.junit.Assert.assertTrue;
20 
22 
23 import com.google.common.collect.Lists;
24 import org.junit.Test;
25 
26 public class IslInfoDataTest {
27 
28  @Test
30  final SwitchId switchId = new SwitchId("00:00:00:00:00:00:00:01");
31  PathNode source = new PathNode(switchId, 1, 0);
32  PathNode destination = new PathNode(switchId, 2, 1);
33  IslInfoData isl = new IslInfoData(Lists.newArrayList(source, destination), IslChangeType.DISCOVERED);
34 
35  assertTrue(isl.isSelfLooped());
36  }
37 
38  @Test
40  final SwitchId srcSwitch = new SwitchId("00:00:00:00:00:00:00:01");
41  final SwitchId dstSwitch = new SwitchId("00:00:00:00:00:00:00:02");
42  PathNode source = new PathNode(srcSwitch, 1, 0);
43  PathNode destination = new PathNode(dstSwitch, 2, 1);
44  IslInfoData isl = new IslInfoData(Lists.newArrayList(source, destination), IslChangeType.DISCOVERED);
45 
46  assertFalse(isl.isSelfLooped());
47  }
48 }
source
Definition: nodes.py:53