import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
-import junit.framework.Assert;
-
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.ovsdb.lib.MonitorCallBack;
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
import org.opendaylight.ovsdb.lib.schema.TableSchema;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
public class OvsdbClientTestIT extends OvsdbTestBase {
- Logger logger = LoggerFactory.getLogger(OvsdbClientTestIT.class);
OvsdbClient ovs;
DatabaseSchema dbSchema = null;
System.out.println("t = " + t);
}
});
- if (updates != null) results.add(updates);
+ if (updates != null) {
+ results.add(updates);
+ }
for (int i = 0; i < 3 ; i++) { //wait 3 seconds to get a result
System.out.println("waiting on monitor response for Bridge Table...");
- if (!results.isEmpty()) break;
+ if (!results.isEmpty()) {
+ break;
+ }
Thread.sleep(1000);
}
Assert.assertTrue(update.getRows().size() > 0);
for (UUID uuid : update.getRows().keySet()) {
Row<GenericTableSchema> aNew = update.getNew(uuid);
- if (!aNew.getColumn(name).getData().equals(testBridgeName)) continue;
+ if (!aNew.getColumn(name).getData().equals(testBridgeName)) {
+ continue;
+ }
if (filter) {
Assert.assertEquals(builder.getColumns().size(), aNew.getColumns().size());
} else {
@After
public void tearDown() throws InterruptedException, ExecutionException {
- if (dbSchema == null) return;
+ if (dbSchema == null) {
+ return;
+ }
TableSchema<GenericTableSchema> bridge = dbSchema.table("Bridge", GenericTableSchema.class);
ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
GenericTableSchema ovsTable = dbSchema.table("Open_vSwitch", GenericTableSchema.class);