import org.opendaylight.ovsdb.lib.OvsdbConnection;
import org.opendaylight.ovsdb.lib.OvsdbConnectionListener;
import org.opendaylight.ovsdb.plugin.api.OvsdbConnectionService;
+
+import org.junit.Rule;
+import org.junit.rules.TestRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
bundlesReady = true;
LOG.info("Bundles loaded");
}
+
+ /*
+ * Method adds a log as each test method starts and finishes. This is useful when
+ * the test suite is used because the suites only print a final summary.
+ */
+ @Rule
+ public TestRule watcher = new TestWatcher() {
+ @Override
+ protected void starting(Description description) {
+ LOG.info("TestWatcher: Starting test: {}",
+ description.getDisplayName());
+ }
+
+ @Override
+ protected void finished(Description description) {
+ LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
+ }
+ };
}
identifier = connectionInfo.getRemoteAddress().getHostAddress()+":"+connectionInfo.getRemotePort();
}
assertEquals(Node.fromString("OVS|" + identifier), connectionService.getNodes().get(0));
- System.out.println("Nodes = "+ connectionService.getNodes());
+ log.info("Nodes = "+ connectionService.getNodes());
/*
* Test sequence :
* 1. Print Cache and Assert to make sure the bridge is not created yet.
Row bridgeRow = ovsdbConfigurationService.getRow(node, databaseName, bridge.getSchema().getName(), status.getUuid());
assertNotNull(bridgeRow);
bridge = connection.getClient().getTypedRowWrapper(Bridge.class, bridgeRow);
- System.out.println("Bridge UUID "+bridge.getUuid()+" Status Uuid "+status.getUuid());
+ log.info("Bridge UUID "+bridge.getUuid()+" Status Uuid "+status.getUuid());
assertEquals(bridge.getUuid(), status.getUuid());
bridge = connection.getClient().createTypedRowWrapper(Bridge.class);
public void printCache() throws Exception {
List<String> tables = ovsdbConfigurationService.getTables(node, databaseName);
- System.out.println("Tables = "+tables);
+ log.info("Tables = "+tables);
assertNotNull(tables);
for (String table : tables) {
- System.out.println("Table "+table);
+ log.info("Table "+table);
ConcurrentMap<UUID, Row<GenericTableSchema>> rows = ovsdbConfigurationService.getRows(node, databaseName, table);
- System.out.println(rows);
+ log.info(rows.toString());
}
}
import javax.inject.Inject;
import junit.framework.Assert;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TestRule;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.opendaylight.ovsdb.integrationtest.ConfigurationBundles;
import org.opendaylight.ovsdb.integrationtest.OvsdbIntegrationTestBase;
);
}
- /*
- * Method adds a log as each test method starts and finishes. This is useful when
- * the test suite is used because the suites only print a final summary.
- */
- @Rule
- public TestRule watcher = new TestWatcher() {
- @Override
- protected void starting(Description description) {
- LOG.info("TestWatcher: Starting test: {}",
- description.getDisplayName());
- }
-
- @Override
- protected void finished(Description description) {
- LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
- }
- };
-
@Before
public void setUp () throws ExecutionException, InterruptedException, IOException {
areWeReady(bc);
import java.util.concurrent.ExecutionException;
import javax.inject.Inject;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TestRule;
-import org.junit.rules.TestWatcher;
-import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.opendaylight.ovsdb.integrationtest.ConfigurationBundles;
import org.opendaylight.ovsdb.integrationtest.OvsdbIntegrationTestBase;
);
}
- /*
- * Method adds a log as each test method starts and finishes. This is useful when
- * the test suite is used because the suites only print a final summary.
- */
- @Rule
- public TestRule watcher = new TestWatcher() {
- @Override
- protected void starting(Description description) {
- LOG.info("TestWatcher: Starting test: {}",
- description.getDisplayName());
- }
-
- @Override
- protected void finished(Description description) {
- LOG.info("TestWatcher: Finished test: {}", description.getDisplayName());
- }
- };
-
@Before
public void setUp () throws ExecutionException, InterruptedException, IOException {
areWeReady(bc);