Open Kilda Java Documentation
MininetPerfTest.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.perf;
17 
18 import com.google.common.base.Charsets;
19 import com.google.common.io.Resources;
21 import org.junit.Test;
22 
23 import java.io.IOException;
24 import java.net.URL;
25 
29 public class MininetPerfTest {
30 
31  public static final String defaultHost = "localhost";
32 
33 
34  private void testIt(URL url) throws IOException {
35  TopologyHelp.DeleteMininetTopology(); // clear out mininet
36  String result = TopologyHelp.ClearTopology(); // clear out neo4j / topology-engine
37  System.out.println("Just cleared the Topology Engine. Result = " + result);
38 
39  String doc = Resources.toString(url, Charsets.UTF_8);
41  }
42 
43  @Test
44  public void test5_20() throws IOException {
45  testIt(Resources.getResource("topologies/rand-5-20.json"));
46  }
47 
48  @Test
49  public void test50_150() throws IOException {
50  testIt(Resources.getResource("topologies/rand-50-150.json"));
51  }
52 
53  @Test
54  public void test200_500() throws IOException {
55  testIt(Resources.getResource("topologies/rand-200-500.json"));
56  }
57 
58 
59 }
static boolean TestMininetCreate(String json)
list result
Definition: plan-d.py:72
static boolean DeleteMininetTopology()