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
21
import
org
.
openkilda
.
messaging
.
model
.
SwitchId
;
22
23
import
com.google.common.collect.Lists;
24
import
org
.junit.Test;
25
26
public
class
IslInfoDataTest
{
27
28
@Test
29
public
void
shouldReturnTrueWhenSelfLooped
() {
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
39
public
void
shouldReturnFalseWhenNotSelfLooped
() {
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
}
org.openkilda.messaging.model
Definition:
AbstractNetworkEndpoint.java:16
org.openkilda.messaging
Definition:
BaseMessage.java:16
org.openkilda.messaging.info.event.PathNode
Definition:
PathNode.java:33
org
org.openkilda.messaging.info.event.IslInfoData.isSelfLooped
boolean isSelfLooped()
Definition:
IslInfoData.java:140
nodes.source
source
Definition:
nodes.py:53
org.openkilda.messaging.info.event.IslInfoData
Definition:
IslInfoData.java:34
org.openkilda.messaging.info.event.IslInfoDataTest
Definition:
IslInfoDataTest.java:26
org.openkilda.messaging.info.event.IslChangeType
Definition:
IslChangeType.java:30
org.openkilda
org.openkilda.messaging.model.SwitchId
Definition:
SwitchId.java:29
org.openkilda.messaging.info.event.IslInfoDataTest.shouldReturnFalseWhenNotSelfLooped
void shouldReturnFalseWhenNotSelfLooped()
Definition:
IslInfoDataTest.java:39
org.openkilda.messaging.info.event.IslInfoDataTest.shouldReturnTrueWhenSelfLooped
void shouldReturnTrueWhenSelfLooped()
Definition:
IslInfoDataTest.java:29
org.openkilda.messaging.info.event.IslChangeType.DISCOVERED
DISCOVERED
Definition:
IslChangeType.java:34
open-kilda-develop
services
src
messaging
src
test
java
org
openkilda
messaging
info
event
IslInfoDataTest.java
Generated by
1.8.14