import javax.management.InstanceNotFoundException;
import org.junit.Rule;
+import org.junit.internal.AssumptionViolatedException;
import org.junit.rules.TestRule;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
public TestRule watcher = new TestWatcher() {
@Override
protected void starting(Description description) {
- LOG.info("TestWatcher: Starting test: {}",
- description.getDisplayName());
+ LOG.info("TestWatcher: Starting test:\n{}", description.getDisplayName());
}
@Override
protected void finished(Description description) {
- LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
+ LOG.info("TestWatcher: Finished test:\n{}", description.getDisplayName());
+ }
+
+ @Override
+ protected void succeeded(Description description) {
+ LOG.info("TestWatcher: Test succeeded:\n{}", description.getDisplayName());
+ }
+
+ @Override
+ protected void failed(Throwable ex, Description description) {
+ LOG.info("TestWatcher: Test failed:\n{} ", description.getDisplayName(), ex);
+ }
+
+ @Override
+ protected void skipped(AssumptionViolatedException ex, Description description) {
+ LOG.info("TestWatcher: Test skipped:\n{} ", description.getDisplayName(), ex);
}
};
}
private static String portStr;
private static String connectionType;
private static Boolean setup = false;
- private MdsalUtils mdsalUtils = null;
- private String extras = "false";
+ private static MdsalUtils mdsalUtils = null;
+ private static String extras = "false";
private static final String NETVIRT = "org.opendaylight.ovsdb.openstack.net-virt";
private static final String NETVIRTPROVIDERS = "org.opendaylight.ovsdb.openstack.net-virt-providers";
@Override
public Option[] getLoggingOptions() {
Option[] options = new Option[] {
- editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
+ /*editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
"log4j.logger.org.opendaylight.ovsdb",
- LogLevelOption.LogLevel.DEBUG.name()),
+ LogLevelOption.LogLevel.DEBUG.name()),*/
editConfigurationFilePut(SouthboundITConstants.ORG_OPS4J_PAX_LOGGING_CFG,
"log4j.logger.org.opendaylight.ovsdb.southbound-impl",
LogLevelOption.LogLevel.DEBUG.name())
Node node = getOvsdbNode(connectionInfo);
//Assert.assertNull(node);
Assume.assumeNotNull(node);
- LOG.info("Disonnected from {}", connectionInfoToString(connectionInfo));
+ LOG.info("Disconnected from {}", connectionInfoToString(connectionInfo));
return true;
}
private OvsdbBridgeAugmentation getBridge(ConnectionInfo connectionInfo) {
InstanceIdentifier<Node> bridgeIid =
- SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName("brtest"));
+ SouthboundMapper.createInstanceIdentifier(connectionInfo,
+ new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME));
Node bridgeNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, bridgeIid);
Assert.assertNotNull(bridgeNode);
OvsdbBridgeAugmentation ovsdbBridgeAugmentation = bridgeNode.getAugmentation(OvsdbBridgeAugmentation.class);
private boolean deleteBridge(ConnectionInfo connectionInfo) throws InterruptedException {
boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION,
- SouthboundMapper.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName("brtest")));
+ SouthboundMapper.createInstanceIdentifier(connectionInfo,
+ new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)));
Thread.sleep(OVSDB_UPDATE_TIMEOUT);
return result;
}
ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portStr);
Node ovsdbNode = connectOvsdbNode(connectionInfo);
- Assert.assertTrue(addBridge(connectionInfo, "brtest"));
+ Assert.assertTrue(addBridge(connectionInfo, SouthboundITConstants.BRIDGE_NAME));
OvsdbBridgeAugmentation bridge = getBridge(connectionInfo);
Assert.assertNotNull(bridge);
LOG.info("bridge: {}", bridge);