-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
+/*\r
+ * [[ Authors will Fill in the Copyright header ]]\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Authors : Brent Salisbury, Hugo Trippaers\r
+ */\r
package org.opendaylight.ovsdb.plugin;\r
\r
import org.junit.Test;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
-import com.google.gson.internal.Pair;\r
-\r
public class OvsdbTestAddBridgeIT extends OvsdbTestBase {\r
private static final Logger logger = LoggerFactory\r
.getLogger(OvsdbTestAddBridgeIT.class);\r
@Test\r
public void addBridge() throws Throwable{\r
\r
- Pair<ConnectionService, Node> connection = getTestConnection();\r
- ConnectionService connectionService = connection.first;\r
- Node node = connection.second;\r
+ TestObjects testObjects = getTestConnection();\r
+ ConnectionService connectionService = testObjects.connectionService;\r
+ Node node = testObjects.node;\r
\r
/**\r
* Create a Bridge Domain\r
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.gson.internal.Pair;
-
public class OvsdbTestAddPortIT extends OvsdbTestBase {
private static final Logger logger = LoggerFactory
.getLogger(OvsdbTestAddPortIT.class);
@Test
public void addPort() throws Throwable{
- Pair<ConnectionService, Node> connection = getTestConnection();
- ConnectionService connectionService = connection.first;
- Node node = connection.second;
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
/**
* Create a Port and attach it to a Bridge
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.gson.internal.Pair;
-
public class OvsdbTestAddTunnelIT extends OvsdbTestBase {
private static final Logger logger = LoggerFactory
.getLogger(OvsdbTestAddTunnelIT.class);
@Test
public void addTunnel() throws Throwable{
- Pair<ConnectionService, Node> connection = getTestConnection();
- ConnectionService connectionService = connection.first;
- Node node = connection.second;
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
/**
* tunnelendpoint IP address of the
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.gson.internal.Pair;
-
public class OvsdbTestAddVlanIT extends OvsdbTestBase {
private static final Logger logger = LoggerFactory
.getLogger(OvsdbTestAddVlanIT.class);
@Test
public void addPortVlan() throws Throwable{
- Pair<ConnectionService, Node> connection = getTestConnection();
- ConnectionService connectionService = connection.first;
- Node node = connection.second;
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
int vlanid = 100;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
-import com.google.gson.internal.Pair;
-
public abstract class OvsdbTestBase {
private final static String identifier = "TEST";
return props;
}
- public Pair<ConnectionService, Node> getTestConnection() throws IOException {
+ public class TestObjects {
+ public final ConnectionService connectionService;
+ public final Node node;
+
+ public TestObjects(ConnectionService connectionService, Node node) {
+ this.connectionService = connectionService;
+ this.node = node;
+ }
+ }
+
+ public TestObjects getTestConnection() throws IOException {
Node.NodeIDType.registerIDType("OVS", String.class);
NodeConnector.NodeConnectorIDType.registerIDType("OVS", String.class,
"OVS");
if (node == null) {
throw new IOException("Failed to connecto to ovsdb server");
}
- return new Pair<ConnectionService, Node>(connectionService, node);
+ return new TestObjects(connectionService, node);
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.gson.internal.Pair;
-
public class OvsdbTestBridgeConfigIT extends OvsdbTestBase {
private static final Logger logger = LoggerFactory
.getLogger(OvsdbTestSetManagerIT.class);
@Test
public void setBridgeConfig() throws Throwable{
- Pair<ConnectionService, Node> connection = getTestConnection();
- ConnectionService connectionService = connection.first;
- Node node = connection.second;
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.gson.internal.Pair;
-
-public class OVSDBTestGetBridgeDomainsIT extends OvsdbTestBase {
+public class OvsdbTestGetBridgeDomainsIT extends OvsdbTestBase {
private static final Logger logger = LoggerFactory
- .getLogger(OVSDBTestGetBridgeDomainsIT.class);
+ .getLogger(OvsdbTestGetBridgeDomainsIT.class);
@Test
public void getBridgeDomains() throws Throwable{
- Pair<ConnectionService, Node> connection = getTestConnection();
- ConnectionService connectionService = connection.first;
- Node node = connection.second;
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
/**
* List a Bridge Domain
-/*
- * [[ Authors will Fill in the Copyright header ]]
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Authors : Brent Salisbury, Hugo Trippaers
- */
+/*\r
+ * [[ Authors will Fill in the Copyright header ]]\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Authors : Brent Salisbury, Hugo Trippaers\r
+ */\r
package org.opendaylight.ovsdb.plugin;\r
\r
import org.junit.Test;\r
import org.slf4j.Logger;\r
import org.slf4j.LoggerFactory;\r
\r
-import com.google.gson.internal.Pair;\r
-\r
public class OvsdbTestSetManagerIT extends OvsdbTestBase {\r
private static final Logger logger = LoggerFactory\r
.getLogger(OvsdbTestSetManagerIT.class);\r
\r
@Test\r
public void setManager() throws Throwable{\r
- Pair<ConnectionService, Node> connection = getTestConnection();\r
- ConnectionService connectionService = connection.first;\r
- Node node = connection.second;\r
+ TestObjects testObjects = getTestConnection();\r
+ ConnectionService connectionService = testObjects.connectionService;\r
+ Node node = testObjects.node;\r
\r
/**\r
* Implements the OVS Connection for Managers\r
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.gson.internal.Pair;
-
-public class OvsdbTestSetOFControlerIT extends OvsdbTestBase {
+public class OvsdbTestSetOFControllerIT extends OvsdbTestBase {
private static final Logger logger = LoggerFactory
- .getLogger(OvsdbTestSetOFControlerIT.class);
+ .getLogger(OvsdbTestSetOFControllerIT.class);
@Test
public void setController() throws Throwable{
- Pair<ConnectionService, Node> connection = getTestConnection();
- ConnectionService connectionService = connection.first;
- Node node = connection.second;
+ TestObjects testObjects = getTestConnection();
+ ConnectionService connectionService = testObjects.connectionService;
+ Node node = testObjects.node;
Map<ConfigConstants, Object> configs = new HashMap<ConfigConstants, Object>();
configs.put(ConfigConstants.DEST_IP, "192.168.254.1");