Open Kilda Java Documentation
DiscoverPathCommandDataTest.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.command.discovery;
17 
20 import static org.junit.Assert.assertEquals;
21 import static org.junit.Assert.assertFalse;
22 import static org.junit.Assert.assertNotNull;
23 
25 
26 import org.junit.Test;
27 
29  @Test
30  public void toStringTest() throws Exception {
32  data.setSrcPortNo(inputPort);
33  String dataString = data.toString();
34  assertNotNull(dataString);
35  assertFalse(dataString.isEmpty());
36  }
37 
38  @Test
39  public void srcSwitchId() throws Exception {
41  data.setSrcSwitchId(switchId);
42  assertEquals(switchId, data.getSrcSwitchId());
43  }
44 
45  @Test
46  public void srcPortNo() throws Exception {
48  data.setSrcPortNo(inputPort);
49  assertEquals(inputPort, data.getSrcPortNo());
50  }
51 
52  @Test
53  public void dstSwitchId() throws Exception {
55  data.setDstSwitchId(switchId);
56  assertEquals(switchId, data.getDstSwitchId());
57  }
58 
59 }