IT for remaining dbs and type versions/completions bindings 54/8454/6
authorBrent Salisbury <brent.salisbury@gmail.com>
Mon, 30 Jun 2014 12:10:27 +0000 (08:10 -0400)
committerBrent Salisbury <brent.salisbury@gmail.com>
Fri, 4 Jul 2014 06:48:02 +0000 (02:48 -0400)
Patchset4-6:Modified ConfigService setManager and controllertest

Patchset3:
Changed controller table, target column to Set<String>

Patchset2:
-Updated the TypedBaseTable
s/extends TypedBaseTable/TypedBaseTable<GenericTableSchema>/g
-Adding remaining tables and IT minus Capabilities
-Will modify tests to the new abbreviated update as Dave
mentioned in his review. Need to unload local commits
for today.

Patchset1:
-Prolly a couple bindings version typos. Patch them if
you see them as Im going to nap a bit. Checking build
against IT as much as anything.

Change-Id: Ia1d9a3907f8c012ad7b1f00887d237cca1e53741
Signed-off-by: Brent Salisbury <brent.salisbury@gmail.com>
15 files changed:
plugin/src/main/java/org/opendaylight/ovsdb/plugin/ConfigurationService.java
schemas/Open_vSwitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Controller.java
schemas/Open_vSwitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Manager.java
schemas/Open_vSwitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Mirror.java
schemas/Open_vSwitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Qos.java
schemas/Open_vSwitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/Queue.java
schemas/Open_vSwitch/src/main/java/org/opendaylight/ovsdb/schema/openvswitch/SSL.java
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/ControllerTestCases.java
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/ManagerTestCases.java [new file with mode: 0644]
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/MirrorTestCases.java [new file with mode: 0644]
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/OpenVswitchSchemaSuiteIT.java
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/QosTestCases.java [new file with mode: 0644]
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/QueueTestCases.java [new file with mode: 0644]
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/SslTestCases.java [new file with mode: 0644]
schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/TearDown.java

index fc6d79337d38c034f4233c04365c1798c3617060..c6a991fc3d1e946c09e1bc529d37b91e9b18a47b 100644 (file)
@@ -23,6 +23,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutionException;
 
+import com.google.common.collect.ImmutableSet;
 import org.eclipse.osgi.framework.console.CommandInterpreter;
 import org.eclipse.osgi.framework.console.CommandProvider;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
@@ -493,7 +494,7 @@ public class ConfigurationService implements IPluginInBridgeDomainConfigService,
         for (InetAddress ofControllerAddress : ofControllerAddrs) {
             String newController = "tcp:"+ofControllerAddress.getHostAddress()+":"+ofControllerPort;
             Controller controllerRow = connection.getClient().createTypedRowWrapper(Controller.class);
-            controllerRow.setTarget(newController);
+            controllerRow.setTarget(ImmutableSet.of(newController));
             status = this.insertRow(node, controllerRow.getSchema().getName(), bridgeUUID, controllerRow.getRow());
         }
         return status.isSuccess();
@@ -978,7 +979,7 @@ public class ConfigurationService implements IPluginInBridgeDomainConfigService,
         Connection connection = connectionService.getConnection(node);
         OvsdbClient client = connection.getClient();
         Manager manager = client.createTypedRowWrapper(Manager.class);
-        manager.setTarget(managerip);
+        manager.setTarget(ImmutableSet.of(managerip));
 
         OpenVSwitch openVSwitch = connection.getClient().getTypedRowWrapper(OpenVSwitch.class, null);
         ConcurrentMap<String, Row> row = this.getRows(node, openVSwitch.getSchema().getName());
index cde0da85d75abf20accc111bc31f0f27a17e7533..96af4d3051cc9563cb56f98e4c495d340fa2e6c9 100644 (file)
@@ -16,29 +16,119 @@ import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
 
-/*
- * Reusing the existing Table definitions and many of columns are not defined here
- * TODO : Fill up the missing Columns and include Supported DB Version
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class is a typed interface to the Controller Table
  */
 
-@TypedTable(name="Controller", database="Open_vSwitch")
+@TypedTable (name="Controller", database="Open_vSwitch", fromVersion="1.0.0")
 public interface Controller extends TypedBaseTable<GenericTableSchema> {
 
-    @TypedColumn(name="target", method=MethodType.GETCOLUMN)
-    public Column<GenericTableSchema, String> getTargetColumn();
+    @TypedColumn (name = "target", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set <String>> getTargetColumn();
 
-    @TypedColumn(name="target", method=MethodType.SETDATA)
-    public void setTarget(String target);
+    @TypedColumn (name = "target", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setTarget(Set <String> target);
 
-    @TypedColumn(name="controller_burst_limit", method=MethodType.GETCOLUMN)
+    @TypedColumn (name = "controller_burst_limit", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
     public Column<GenericTableSchema, Integer> getBurstLimitColumn();
 
-    @TypedColumn(name="controller_burst_limit", method=MethodType.SETDATA)
+    @TypedColumn (name = "controller_burst_limit", method = MethodType.SETDATA, fromVersion = "1.0.0")
     public void setBurstLimit(Integer burstLimit);
 
-    @TypedColumn(name="controller_rate_limit", method=MethodType.GETCOLUMN)
+    @TypedColumn (name = "controller_rate_limit", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
     public Column<GenericTableSchema, Integer> getRateLimitColumn();
 
-    @TypedColumn(name="controller_rate_limit", method=MethodType.SETDATA)
-    public void setRateLimit(Integer burstLimit);
+    @TypedColumn (name = "controller_rate_limit", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setRateLimit(Integer rateLimit);
+
+    @TypedColumn (name = "connection_mode", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<String>> getConnectionModeColumn();
+
+    @TypedColumn (name = "connection_mode", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setConnectionMode(Set<String> connectionMode);
+
+    @TypedColumn (name = "enable_async_messages", method = MethodType.GETCOLUMN, fromVersion = "6.7.0")
+    public Column<GenericTableSchema, Set<Boolean>> getEnableAsyncMessagesColumn();
+
+    @TypedColumn (name = "enable_async_messages", method = MethodType.SETDATA, fromVersion = "6.7.0")
+    public void setEnableAsyncMessages(Set<Boolean> enableAsyncMessages);
+
+    @TypedColumn (name = "external_ids", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn();
+
+    @TypedColumn (name = "external_ids", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setExternalIds(Map<String, String> externalIds);
+
+    @TypedColumn (name = "local_netmask", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<String>> getLocalNetmaskColumn();
+
+    @TypedColumn (name = "local_netmask", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setLocalNetmask(Set<String> localNetmask);
+
+    @TypedColumn (name = "local_gateway", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<String>> getLocalGatewayColumn();
+
+    @TypedColumn (name = "local_gateway", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setLocalGateway(Set<String> localGateway);
+
+    @TypedColumn (name = "status", method = MethodType.GETCOLUMN, fromVersion = "1.1.0")
+    public Column<GenericTableSchema, Map<String, String>> getStatusColumn();
+
+    @TypedColumn (name = "status", method = MethodType.SETDATA, fromVersion = "1.1.0")
+    public void setStatus(Map<String, String> status);
+
+    @TypedColumn (name = "role", method = MethodType.GETCOLUMN, fromVersion = "1.1.0")
+    public Column<GenericTableSchema, Set<String>> getRoleColumn();
+
+    @TypedColumn (name = "role", method = MethodType.SETDATA, fromVersion = "1.1.0")
+    public void setRole(Set<String> role);
+
+    @TypedColumn (name = "inactivity_probe", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<Integer>> getInactivityProbeColumn();
+
+    @TypedColumn (name = "inactivity_probe", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setInactivityProbe(Set<Integer> inactivityProbe);
+
+    @TypedColumn (name = "is_connected", method = MethodType.GETCOLUMN, fromVersion = "1.1.0")
+    public Column<GenericTableSchema, Boolean> getIsConnectedColumn();
+
+    @TypedColumn (name = "is_connected", method = MethodType.SETDATA, fromVersion = "1.1.0")
+    public void setIsConnected(Boolean isConnected);
+
+    @TypedColumn (name = "other_config", method = MethodType.GETCOLUMN, fromVersion = "6.8.0")
+    public Column<GenericTableSchema, Map<String, String>> getOtherConfigColumn();
+
+    @TypedColumn (name = "other_config", method = MethodType.SETDATA, fromVersion = "6.8.0")
+    public void setOtherConfig(Map<String, String> otherConfig);
+
+    @TypedColumn (name = "max_backoff", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Integer> getMaxBackoffColumn();
+
+    @TypedColumn (name = "max_backoff", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setMaxBackoff(Integer maxBackoff);
+
+    @TypedColumn (name = "local_ip", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<String>> getLocalIpColumn();
+
+    @TypedColumn (name = "local_ip", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setLocalIp(Set<String> localIp);
+
+    @TypedColumn (name = "discover_update_resolv_conf", method = MethodType.GETCOLUMN,
+                  fromVersion="1.0.0", untilVersion="3.0.0")
+    public Column<GenericTableSchema, Set<String>> getDiscoverUpdateResolvConfColumn();
+
+    @TypedColumn (name = "discover_update_resolv_conf", method = MethodType.SETDATA,
+                  fromVersion="1.0.0", untilVersion="3.0.0")
+    public void setDiscoverUpdateResolvConf(Set<String> discoverUpdateResolvConf);
+
+    @TypedColumn (name = "discover_accept_regex", method = MethodType.GETCOLUMN,
+                  fromVersion="1.0.0", untilVersion="3.0.0")
+    public Column<GenericTableSchema, Set<String>> getDiscoverAcceptRegexColumn();
+
+    @TypedColumn (name = "discover_accept_regex", method = MethodType.SETDATA,
+                  fromVersion="1.0.0", untilVersion="3.0.0")
+    public void setDiscoverAcceptRegex(Set<String> discoverAcceptRegex);
 }
index f3a3596fdefb77af567f14afd656e26edacb2569..3a26a110ccd60430e12784217ab68c50a41ffab8 100644 (file)
@@ -16,14 +16,60 @@ import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
 
-/*
- * Reusing the existing Table definitions and many of columns are not defined here
- * TODO : Fill up the missing Columns and include Supported DB Version
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * This class is a typed interface to the Manager Table
  */
-@TypedTable(name="Manager", database="Open_vSwitch")
+@TypedTable (name="Manager", database="Open_vSwitch", fromVersion = "1.0.0")
 public interface Manager extends TypedBaseTable<GenericTableSchema> {
-    @TypedColumn(name="target", method=MethodType.GETCOLUMN)
-    public Column<GenericTableSchema, String> getTargetColumn() ;
-    @TypedColumn(name="target", method=MethodType.SETDATA)
-    public void setTarget(String target) ;
-}
+
+    @TypedColumn (name="target", method= MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<String>> getTargetColumn();
+
+    @TypedColumn (name="target", method= MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setTarget(Set<String> target) ;
+
+    @TypedColumn (name = "is_connected", method = MethodType.GETCOLUMN, fromVersion = "1.1.0")
+    public Column<GenericTableSchema, Boolean> getIsConnectedColumn();
+
+    @TypedColumn (name = "is_connected", method = MethodType.SETDATA, fromVersion = "1.1.0")
+    public void setIsConnected(Boolean isConnected);
+
+    @TypedColumn (name = "other_config", method = MethodType.GETCOLUMN, fromVersion = "6.8.0")
+    public Column<GenericTableSchema, Map<String, String>> getOtherConfigColumn();
+
+    @TypedColumn (name = "other_config", method = MethodType.SETDATA, fromVersion = "6.8.0")
+    public void setOtherConfig(Map<String, String> otherConfig);
+
+    @TypedColumn (name = "external_ids", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn();
+
+    @TypedColumn (name = "external_ids", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setExternalIds(Map<String, String> externalIds);
+
+    @TypedColumn (name = "max_backoff", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<Integer>> getMaxBackoffColumn();
+
+    @TypedColumn (name = "max_backoff", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setMaxBackoff(Set<Integer> maxBackoff);
+
+    @TypedColumn (name = "status", method = MethodType.GETCOLUMN, fromVersion = "1.1.0")
+    public Column<GenericTableSchema, Map<String, String>> getStatusColumn();
+
+    @TypedColumn (name = "status", method = MethodType.SETDATA, fromVersion = "1.1.0")
+    public void setStatus(Map<String, String> status);
+
+    @TypedColumn (name = "inactivity_probe", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<Integer>> getInactivityProbeColumn();
+
+    @TypedColumn (name = "inactivity_probe", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setInactivityProbe(Set<Integer> inactivityProbe);
+
+    @TypedColumn (name = "connection_mode", method = MethodType.GETCOLUMN, fromVersion = "1.0.0")
+    public Column<GenericTableSchema, Set<String>> getConnectionModeColumn();
+
+    @TypedColumn (name = "connection_mode", method = MethodType.SETDATA, fromVersion = "1.0.0")
+    public void setConnectionMode(Set<String> connectionMode);
+}
\ No newline at end of file
index db859a7d27309e78100009b62e7991b8ed211f3d..f99515ba325e19f7e1340edc1875bc8ea0f00691 100644 (file)
@@ -9,9 +9,6 @@
  */
 package org.opendaylight.ovsdb.schema.openvswitch;
 
-import java.util.Map;
-import java.util.Set;
-
 import org.opendaylight.ovsdb.lib.notation.Column;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
@@ -20,51 +17,69 @@ import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
 
+import java.util.Map;
+import java.util.Set;
 
-/*
- * Reusing the existing Table definitions and many of columns are not defined here
- * TODO : Fill up the missing Columns and include Supported DB Version
+/**
+ * This class is a typed interface to the Mirror Table
  */
-@TypedTable(name="Mirror", database="Open_vSwitch")
+@TypedTable (name="Mirror", database="Open_vSwitch", fromVersion="1.0.0")
 public interface Mirror extends TypedBaseTable<GenericTableSchema> {
 
-    @TypedColumn(name="name", method=MethodType.GETCOLUMN)
+    @TypedColumn(name="name", method=MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, String> getNameColumn();
-    @TypedColumn(name="name", method=MethodType.SETDATA)
-    public void setName(String name);
 
-    @TypedColumn(name="select_src_port", method=MethodType.GETCOLUMN)
+    @TypedColumn(name="name", method=MethodType.SETDATA, fromVersion="1.0.0")
+    public void setName(Set<String> name);
+
+    @TypedColumn(name="name", method=MethodType.GETDATA, fromVersion="1.0.0")
+    public Set<String> getName();
+
+    @TypedColumn(name="select_src_port", method=MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Set<UUID>> getSelectSrcPortColumn();
-    @TypedColumn(name="select_src_port", method=MethodType.SETDATA)
+
+    @TypedColumn(name="select_src_port", method=MethodType.SETDATA, fromVersion="1.0.0")
     public void setSelectSrcPort(Set<UUID> selectSrcPort);
 
-    @TypedColumn(name="select_dst_port", method=MethodType.GETCOLUMN)
+    @TypedColumn(name="select_dst_port", method=MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Set<UUID>> getSelectDstPortColumn();
-    @TypedColumn(name="select_dst_port", method=MethodType.SETDATA)
+
+    @TypedColumn(name="select_dst_port", method=MethodType.SETDATA, fromVersion="1.0.0")
     public void setSelectDstPort(Set<UUID> selectDstPrt);
 
-    @TypedColumn(name="select_vlan", method=MethodType.GETCOLUMN)
+    @TypedColumn(name="select_vlan", method=MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Set<Integer>> getSelectVlanColumn();
-    @TypedColumn(name="select_vlan", method=MethodType.SETDATA)
+
+    @TypedColumn(name="select_vlan", method=MethodType.SETDATA, fromVersion="1.0.0")
     public void setSelectVlan(Set<Integer> selectVlan);
 
-    @TypedColumn(name="output_port", method=MethodType.GETCOLUMN)
+    @TypedColumn(name="output_port", method=MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Set<UUID>> getOutputPortColumn();
-    @TypedColumn(name="output_port", method=MethodType.SETDATA)
+
+    @TypedColumn(name="output_port", method=MethodType.SETDATA, fromVersion="1.0.0")
     public void setOutputPort(Set<UUID> outputPort);
 
-    @TypedColumn(name="output_vlan", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="output_vlan", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Set<Integer>> getOutputVlanColumn();
-    @TypedColumn(name="output_vlan", method=MethodType.SETDATA)
+
+    @TypedColumn (name="output_vlan", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setOutputVlan(Set<Integer> outputVlan);
 
-    @TypedColumn(name="statistics", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="statistics", method= MethodType.GETCOLUMN, fromVersion="6.4.0")
     public Column<GenericTableSchema, Map<String, Integer>> getStatisticsColumn();
-    @TypedColumn(name="statistics", method=MethodType.SETDATA)
+
+    @TypedColumn (name="statistics", method= MethodType.SETDATA, fromVersion="6.4.0")
     public void setStatistics(Map<String, Integer> statistics);
 
-    @TypedColumn(name="external_ids", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="external_ids", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn();
-    @TypedColumn(name="external_ids", method=MethodType.SETDATA)
+
+    @TypedColumn (name="external_ids", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setExternalIds(Map<String, String> externalIds);
-}
+
+    @TypedColumn (name="select_all", method= MethodType.GETCOLUMN, fromVersion="6.2.0")
+    public Column<GenericTableSchema, Boolean> getSelectAllColumn();
+
+    @TypedColumn (name="select_all", method= MethodType.SETDATA, fromVersion="6.2.0")
+    public void setSelectAll(Boolean selectAll);
+}
\ No newline at end of file
index 4508157b482c55f808a6c27f89331d46958810a5..1012281c5e559f050697c4343d2d87b06fa39872 100644 (file)
@@ -10,8 +10,6 @@
 package org.opendaylight.ovsdb.schema.openvswitch;
 
 
-import java.util.Map;
-
 import org.opendaylight.ovsdb.lib.notation.Column;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
@@ -20,31 +18,36 @@ import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
 
+import java.util.Map;
+import java.util.Set;
 
-/*
- * Reusing the existing Table definitions and many of columns are not defined here
- * TODO : Fill up the missing Columns and include Supported DB Version
+/**
+ *  This class is a typed interface to the QoS Table
  */
-
-@TypedTable(name="Qos", database="Open_vSwitch")
+@TypedTable (name="QoS", database="Open_vSwitch", fromVersion="1.0.0")
 public interface Qos extends TypedBaseTable<GenericTableSchema> {
-    @TypedColumn(name="queues", method=MethodType.GETCOLUMN)
+
+    @TypedColumn (name="queues", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<Integer, UUID>> getQueuesColumn() ;
-    @TypedColumn(name="queues", method=MethodType.SETDATA)
+
+    @TypedColumn (name="queues", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setQueues(Map<Integer, UUID> queues) ;
 
-    @TypedColumn(name="type", method=MethodType.GETCOLUMN)
-    public Column<GenericTableSchema, String> getTypeColumn() ;
-    @TypedColumn(name="type", method=MethodType.SETDATA)
-    public void setType(String type) ;
+    @TypedColumn (name="type", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
+    public Column<GenericTableSchema, Set<String>> getTypeColumn() ;
+
+    @TypedColumn (name="type", method= MethodType.SETDATA, fromVersion="1.0.0")
+    public void setType(Set<String> type) ;
 
-    @TypedColumn(name="other_config", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="other_config", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<String, String>> getOtherConfigColumn() ;
-    @TypedColumn(name="other_config", method=MethodType.SETDATA)
+
+    @TypedColumn (name="other_config", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setOtherConfig(Map<String, String> otherConfig) ;
 
-    @TypedColumn(name="externalIds", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="externalIds", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn() ;
-    @TypedColumn(name="externalIds", method=MethodType.SETDATA)
+
+    @TypedColumn (name="externalIds", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setExternalIds(Map<String, String> externalIds) ;
-}
+}
\ No newline at end of file
index ea47dbb1c40f47360ef12f9b4c76bd4d0559bfea..14518ba6dcb838cbb4100f6374e7121bd21d46e4 100644 (file)
@@ -10,9 +10,6 @@
 package org.opendaylight.ovsdb.schema.openvswitch;
 
 
-import java.util.Map;
-import java.util.Set;
-
 import org.opendaylight.ovsdb.lib.notation.Column;
 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
 import org.opendaylight.ovsdb.lib.schema.typed.MethodType;
@@ -20,26 +17,30 @@ import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
 
+import java.util.Map;
+import java.util.Set;
 
-/*
- * Reusing the existing Table definitions and many of columns are not defined here
- * TODO : Fill up the missing Columns and include Supported DB Version
+/**
+ * This class is a typed interface to the Queue Table
  */
-
-@TypedTable(name="Queue", database="Open_vSwitch")
+@TypedTable (name="Queue", database="Open_vSwitch", fromVersion="1.0.0")
 public interface Queue extends TypedBaseTable<GenericTableSchema> {
-    @TypedColumn(name="dscp", method=MethodType.GETCOLUMN)
+
+    @TypedColumn (name="dscp", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Set<Integer>> getDscpColumn() ;
-    @TypedColumn(name="dscp", method=MethodType.SETDATA)
+
+    @TypedColumn (name="dscp", method= MethodType.SETDATA, fromVersion="6.4.0")
     public void setDscp(Set<Integer> dscp) ;
 
-    @TypedColumn(name="other_config", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="other_config", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<String, String>> getOtherConfigColumn() ;
-    @TypedColumn(name="other_config", method=MethodType.SETDATA)
+
+    @TypedColumn (name="other_config", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setOtherConfig(Map<String, String> otherConfig) ;
 
-    @TypedColumn(name="external_ids", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="external_ids", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn() ;
-    @TypedColumn(name="external_ids", method=MethodType.SETDATA)
+
+    @TypedColumn (name="external_ids", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setExternalIds(Map<String, String> externalIds) ;
 }
\ No newline at end of file
index 34a2d57df1e1c709a8b516629fec70f731473456..815867fdbb6f9b7226ac763432380d12added0d4 100644 (file)
@@ -9,42 +9,48 @@
  */
 package org.opendaylight.ovsdb.schema.openvswitch;
 
-import java.util.Map;
-
 import org.opendaylight.ovsdb.lib.notation.Column;
 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
 import org.opendaylight.ovsdb.lib.schema.typed.MethodType;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedBaseTable;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedColumn;
 import org.opendaylight.ovsdb.lib.schema.typed.TypedTable;
-/*
- * Reusing the existing Table definitions and many of columns are not defined here
- * TODO : Fill up the missing Columns and include Supported DB Version
+
+import java.util.Map;
+
+/**
+ * This class is a typed interface to the SSL Table
  */
-@TypedTable(name="SSL", database="Open_vSwitch")
+@TypedTable (name="SSL", database="Open_vSwitch", fromVersion="1.0.0")
 public interface SSL extends TypedBaseTable<GenericTableSchema> {
-    @TypedColumn(name="ca_cert", method=MethodType.GETCOLUMN)
+
+    @TypedColumn (name="ca_cert", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, String> getCaCertColumn() ;
-    @TypedColumn(name="ca_cert", method=MethodType.SETDATA)
+
+    @TypedColumn (name="ca_cert", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setCaCert(String caCert) ;
 
-    @TypedColumn(name="external_ids", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="external_ids", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Map<String, String>> getExternalIdsColumn() ;
-    @TypedColumn(name="external_ids", method=MethodType.SETDATA)
+
+    @TypedColumn (name="external_ids", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setExternalIds(Map<String, String> externalIds) ;
 
-    @TypedColumn(name="bootstrap_ca_cert", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="bootstrap_ca_cert", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, Boolean> getBootstrapCaCertColumn() ;
-    @TypedColumn(name="bootstrap_ca_cert", method=MethodType.SETDATA)
+
+    @TypedColumn (name="bootstrap_ca_cert", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setBootstrapCaCert(Boolean bootstrapCaCert) ;
 
-    @TypedColumn(name="certificate", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="certificate", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, String> getCertificateColumn() ;
-    @TypedColumn(name="certificate", method=MethodType.SETDATA)
+
+    @TypedColumn (name="certificate", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setCertificate(String certificate) ;
 
-    @TypedColumn(name="private_key", method=MethodType.GETCOLUMN)
+    @TypedColumn (name="private_key", method= MethodType.GETCOLUMN, fromVersion="1.0.0")
     public Column<GenericTableSchema, String> getPrivateKeyColumn() ;
-    @TypedColumn(name="private_key", method=MethodType.SETDATA)
+
+    @TypedColumn (name="private_key", method= MethodType.SETDATA, fromVersion="1.0.0")
     public void setPrivateKey(String private_key) ;
-}
+}
\ No newline at end of file
index f1bd7c0d2210fc5de83b3a417c0830c427496100..f4463ac4459e00774ddeb68d7dfe23f7290c3add 100644 (file)
@@ -17,6 +17,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
+import com.google.common.collect.ImmutableSet;
 
 import junit.framework.Assert;
 
@@ -46,9 +47,9 @@ public class ControllerTestCases extends OpenVswitchSchemaTestBase {
     @Test
     public void createTypedController() throws IOException, InterruptedException, ExecutionException, NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
         Controller controller1 = ovs.createTypedRowWrapper(Controller.class);
-        controller1.setTarget("tcp:1.1.1.1:6640");
+        controller1.setTarget(ImmutableSet.of("tcp:1.1.1.1:6640"));
         Controller controller2 = ovs.createTypedRowWrapper(Controller.class);
-        controller2.setTarget("tcp:2.2.2.2:6640");
+        controller2.setTarget(ImmutableSet.of("tcp:2.2.2.2:6640"));
 
         Bridge bridge = ovs.getTypedRowWrapper(Bridge.class, null);
 
diff --git a/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/ManagerTestCases.java b/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/ManagerTestCases.java
new file mode 100644 (file)
index 0000000..f755faf
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ */
+
+package org.opendaylight.ovsdb.schema.openvswitch;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
+import junit.framework.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+
+public class ManagerTestCases extends OpenVswitchSchemaTestBase {
+    Logger logger = LoggerFactory.getLogger(ManagerTestCases.class);
+
+    @Before
+    public void setUp() throws ExecutionException, InterruptedException, TimeoutException, IOException {
+        super.setUp();
+    }
+
+    @Test
+    public void testCreateTypedManagerTable() throws InterruptedException, ExecutionException, IllegalArgumentException {
+
+        String mgrUuidStr = "sslUuidName";
+        ImmutableMap<String, String> externalIds = ImmutableMap.of("slaveof", "themaster");
+
+        UUID openVSwitchRowUuid = this.getOpenVSwitchTableUuid(ovs, OpenVswitchSchemaSuiteIT.getTableCache());
+        OpenVSwitch openVSwitch = ovs.getTypedRowWrapper(OpenVSwitch.class, null);
+
+        Manager manager = ovs.createTypedRowWrapper(Manager.class);
+        manager.setInactivityProbe(Sets.newHashSet(8192));
+        manager.setMaxBackoff(Sets.newHashSet(4094));
+        manager.setTarget(Sets.newHashSet("172.16.50.50:6640"));
+        manager.setExternalIds(externalIds);
+
+        int insertSslOperationIndex = 0;
+        TransactionBuilder transactionBuilder = ovs.transactBuilder()
+                .add(op.insert(manager.getSchema())
+                        .withId(mgrUuidStr)
+                        .value(manager.getTargetColumn())
+                        .value(manager.getInactivityProbeColumn())
+                        .value(manager.getMaxBackoffColumn())
+                        .value(manager.getExternalIdsColumn()))
+                .add(op.comment("Inserting Slave Manager"))
+                .add(op.mutate(openVSwitch.getSchema())
+                        .addMutation(openVSwitch.getManagerOptionsColumn().getSchema(), Mutator.INSERT,
+                                Sets.newHashSet(new UUID(mgrUuidStr)))
+                        .where(openVSwitch.getUuidColumn().getSchema().opEqual(openVSwitchRowUuid))
+                        .build());
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
+        // Store the returned SSL row UUID to be used in the TearDown deletion transaction
+        OpenVswitchSchemaSuiteIT.setTestManagerUuid(operationResults.get(insertSslOperationIndex).getUuid());
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder.getOperations().size(), operationResults.size());
+        logger.info("Mutate operation results for Manager = {} ", operationResults);
+
+    }
+
+    @Override
+    public void update(Object context, UpdateNotification upadateNotification) {
+
+    }
+
+    @Override
+    public void locked(Object context, List<String> ids) {
+
+    }
+
+    @Override
+    public void stolen(Object context, List<String> ids) {
+
+    }
+}
diff --git a/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/MirrorTestCases.java b/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/MirrorTestCases.java
new file mode 100644 (file)
index 0000000..c2c2fad
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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, Dave Tucker
+ */
+
+package org.opendaylight.ovsdb.schema.openvswitch;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
+import junit.framework.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+public class MirrorTestCases extends OpenVswitchSchemaTestBase {
+
+    Logger logger = LoggerFactory.getLogger(MirrorTestCases.class);
+
+    @Before
+    public void setUp() throws ExecutionException, InterruptedException, TimeoutException, IOException {
+        super.setUp();
+    }
+
+    @Test
+    public void testCreateTypedMirror() throws InterruptedException, ExecutionException, IllegalArgumentException{
+
+        String mirrorUuidStr = "testMirror";
+        String mirrorName = "my_name_is_mirror";
+        Integer outputVid = 1024;
+        Integer selectVid = 2048;
+
+        Mirror mirror = ovs.createTypedRowWrapper(Mirror.class);
+        mirror.setName(ImmutableSet.of(mirrorName));
+        mirror.setExternalIds(ImmutableMap.of("overlays", "ftw"));
+        mirror.setOutputVlan(ImmutableSet.of(outputVid));
+        mirror.setSelectVlan(ImmutableSet.of(selectVid));
+        mirror.setExternalIds(ImmutableMap.of("reading", "urmail"));
+        Bridge bridge = ovs.getTypedRowWrapper(Bridge.class, null);
+
+        int insertMirrorOperationIndex = 0;
+        TransactionBuilder transactionBuilder = ovs.transactBuilder()
+                .add(op.insert(mirror.getSchema())
+                        .withId(mirrorUuidStr)
+                        .value(mirror.getNameColumn())
+                        .value(mirror.getExternalIdsColumn()))
+                .add(op.mutate(bridge.getSchema())
+                        .addMutation(bridge.getMirrorsColumn().getSchema(), Mutator.INSERT,
+                                Sets.newHashSet(new UUID(mirrorUuidStr)))
+                        .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
+                        .build());
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder
+                .getOperations().size(), operationResults.size());
+        // Store the returned Mirror row UUID to be used in the TearDown cleanup transaction
+        OpenVswitchSchemaSuiteIT.setTestMirrorUuid
+                (operationResults.get(insertMirrorOperationIndex).getUuid());
+        logger.info("Insert, Update & Mutate operation results for QOS " + operationResults);
+    }
+
+    @Override
+    public void update(Object context, UpdateNotification upadateNotification) {
+
+    }
+
+    @Override
+    public void locked(Object context, List<String> ids) {
+
+    }
+
+    @Override
+    public void stolen(Object context, List<String> ids) {
+
+    }
+}
index 94583813d4cd7aab0b74020771475c0b0526a9e3..3fe071596e7e9d317978f13de1e7a65d062d498d 100644 (file)
@@ -29,6 +29,11 @@ import java.util.Map;
         IpfixTestCases.class,
         FlowSampleCollectorSetTestCases.class,
         FlowTableTestCases.class,
+        SslTestCases.class,
+        QosTestCases.class,
+        QueueTestCases.class,
+        ManagerTestCases.class,
+        MirrorTestCases.class,
         TearDown.class
 })
 public class OpenVswitchSchemaSuiteIT {
@@ -36,6 +41,13 @@ public class OpenVswitchSchemaSuiteIT {
     // Keep this data between test runs
     static OvsdbClient ovsdbClient;
     static UUID testBridgeUuid;
+    static UUID testSslUuid;
+    static UUID testQosUuid;
+    static UUID testQosPortUuid;
+    static UUID testQueueUuid;
+    static UUID testManagerUuid;
+    static UUID testMirrorUuid;
+
     static Map<String, Map<UUID, Row>> tableCache = new HashMap<String, Map<UUID, Row>>();
 
     public static OvsdbClient getOvsdbClient() {
@@ -54,7 +66,57 @@ public class OpenVswitchSchemaSuiteIT {
         OpenVswitchSchemaSuiteIT.testBridgeUuid = testBridgeUuid;
     }
 
+    public static UUID getTestSslUuid() {
+        return testSslUuid;
+    }
+
+    public static void setTestSslUuid(UUID testSslUuid) {
+        OpenVswitchSchemaSuiteIT.testSslUuid = testSslUuid;
+    }
+
+    public static UUID getTestQosUuid() {
+        return testQosUuid;
+    }
+
+    public static void setTestQosUuid(UUID testQosUuid) {
+        OpenVswitchSchemaSuiteIT.testQosUuid = testQosUuid;
+    }
+
+    public static UUID getTestQosPortUuid() {
+        return testQosPortUuid;
+    }
+
+    public static void setTestQosPortUuid(UUID testQosPortUuid) {
+        OpenVswitchSchemaSuiteIT.testQosPortUuid = testQosPortUuid;
+    }
+
+    public static UUID getTestQueueUuid() {
+        return testQueueUuid;
+    }
+
+    public static void setTestQueueUuid(UUID testQueueUuid) {
+        OpenVswitchSchemaSuiteIT.testQueueUuid = testQueueUuid;
+    }
+
+    public static UUID getTestManagerUuid() {
+        return testManagerUuid;
+    }
+
+    public static void setTestManagerUuid(UUID testManagerUuid) {
+        OpenVswitchSchemaSuiteIT.testManagerUuid = testManagerUuid;
+    }
+
+    public static UUID getTestMirrorUuid() {
+        return testMirrorUuid;
+    }
+
+    public static void setTestMirrorUuid(UUID testMirrorUuid) {
+        OpenVswitchSchemaSuiteIT.testMirrorUuid = testMirrorUuid;
+    }
+
     public static Map<String, Map<UUID, Row>> getTableCache() {
         return tableCache;
     }
+
+
 }
diff --git a/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/QosTestCases.java b/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/QosTestCases.java
new file mode 100644 (file)
index 0000000..5a325b5
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ */
+package org.opendaylight.ovsdb.schema.openvswitch;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
+import junit.framework.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+public class QosTestCases extends OpenVswitchSchemaTestBase {
+    Logger logger = LoggerFactory.getLogger(QosTestCases.class);
+
+    @Before
+    public void setUp() throws ExecutionException, InterruptedException, TimeoutException, IOException {
+        super.setUp();
+    }
+
+    /**
+     * Test creates a functional port (including Interface table row)
+     * on br_test with a reference to a QoS row. The QueueTestCases
+     * IT test builds upon these elements and adds a Queue that is
+     * referenced in the QoS queue column.
+     *
+     * @throws InterruptedException the interrupted exception
+     * @throws ExecutionException   the execution exception
+     */
+    @Test
+    public void testCreateTypedQos() throws InterruptedException, ExecutionException {
+
+        String portUuidStr = "testQosPortUuid";
+        String intfUuidStr = "testQosIntfUuid";
+        String qosUuidStr = "testQosUuid";
+        String qosPort = "testQosPort";
+
+
+        Port port = ovs.createTypedRowWrapper(Port.class);
+        port.setName(qosPort);
+        port.setInterfaces(ImmutableSet.of(new UUID(intfUuidStr)));
+        port.setQos(ImmutableSet.of(new UUID(qosUuidStr)));
+        port.setOtherConfig(ImmutableMap.of("m0r3", "c0ff33"));
+
+        Interface intf = ovs.createTypedRowWrapper(Interface.class);
+        intf.setName(port.getNameColumn().getData());
+        intf.setOtherConfig(ImmutableMap.of("proto", "duction"));
+        intf.setExternalIds(ImmutableMap.of("stringly", "typed"));
+
+        Qos qos = ovs.createTypedRowWrapper(Qos.class);
+        qos.setOtherConfig(ImmutableMap.of("mmm", "kay"));
+        qos.setType(ImmutableSet.of("404"));
+
+        int insertPortOperationIndex = 0;
+        int insertQosOperationIndex = 2;
+        Bridge bridge = ovs.getTypedRowWrapper(Bridge.class, null);
+
+        TransactionBuilder transactionBuilder = ovs.transactBuilder()
+                .add(op.insert(port.getSchema())
+                        .withId(portUuidStr)
+                        .value(port.getNameColumn()))
+                .add(op.insert(intf.getSchema())
+                        .withId(intfUuidStr)
+                        .value(intf.getExternalIdsColumn())
+                        .value(intf.getNameColumn())
+                        .value(intf.getOtherConfigColumn()))
+                .add(op.insert(qos.getSchema())
+                        .withId(qosUuidStr)
+                        .value(qos.getTypeColumn())
+                        .value(qos.getOtherConfigColumn()))
+                .add(op.update(port.getSchema())
+                        .set(port.getOtherConfigColumn())
+                        .set(port.getInterfacesColumn())
+                        .set(port.getQosColumn())
+                        .where(port.getNameColumn().getSchema().opEqual(port.getName()))
+                        .build())
+                .add(op.mutate(bridge.getSchema())
+                        .addMutation(bridge.getPortsColumn().getSchema(), Mutator.INSERT,
+                                Sets.newHashSet(new UUID(portUuidStr)))
+                        .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
+                        .build());
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder
+                .getOperations().size(), operationResults.size());
+        // Store the returned QoS row UUID to be used in the TearDown deletion transaction
+        OpenVswitchSchemaSuiteIT.setTestQosUuid
+                (operationResults.get(insertQosOperationIndex).getUuid());
+        // Store the returned Port row UUID to be used in the TearDown deletion transaction
+        OpenVswitchSchemaSuiteIT.setTestQosPortUuid
+                (operationResults.get(insertPortOperationIndex).getUuid());
+        logger.info("Insert, Update & Mutate operation results for QOS " + operationResults);
+    }
+
+    @Override
+    public void update(Object context, UpdateNotification upadateNotification) {
+
+    }
+
+    @Override
+    public void locked(Object context, List<String> ids) {
+
+    }
+
+    @Override
+    public void stolen(Object context, List<String> ids) {
+
+    }
+}
\ No newline at end of file
diff --git a/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/QueueTestCases.java b/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/QueueTestCases.java
new file mode 100644 (file)
index 0000000..ee15d63
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ */
+package org.opendaylight.ovsdb.schema.openvswitch;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import junit.framework.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+public class QueueTestCases extends OpenVswitchSchemaTestBase {
+    Logger logger = LoggerFactory.getLogger(QueueTestCases.class);
+
+    @Before
+    public void setUp() throws ExecutionException, InterruptedException, TimeoutException, IOException {
+        super.setUp();
+    }
+
+    @Test
+    public void testCreateTypedQueueTable() throws InterruptedException, ExecutionException, IllegalArgumentException {
+        /**
+         * This is an arbitrary String that is a placeholder for
+         * the future UUID generated by the OVSDB Server in the
+         * future transaction. While it is possible to generate
+         * ones own UUID for the transaction it is not recommended
+         * since it wouldn't add any conceivable value.
+         */
+        String queueUuidStr = "queueUuidStr";
+        Integer dscpVal = 4;
+        Queue queue = ovs.createTypedRowWrapper(Queue.class);
+        // Example of explicit ImmutableSet/Map Attribute declaration
+        ImmutableSet<Integer> dscp = ImmutableSet.of(dscpVal);
+        ImmutableMap<String, String> externalIds = ImmutableMap.of("little", "coat");
+        // Example of condensing the attributes bindings in one line
+        queue.setOtherConfig(ImmutableMap.of("war", "onfun"));
+        // Bind the Attributes to the transaction. These values end up in columns.
+        queue.setExternalIds(externalIds);
+        queue.setDscp(dscp);
+        // Get the parent Qos table row UUID to insert the queue.
+        Qos qos = ovs.getTypedRowWrapper(Qos.class, null);
+        // Queue key that is mapped to the queue record/value/ofp_action_enqueue
+        Integer queueKey = Integer.valueOf(0);
+        // The transaction index for the Queue insert is used to store the Queue UUID
+        int insertQueueOperationIndex = 0;
+        // Reference the Port row to insert the Queue with UID or Port name
+        TransactionBuilder transactionBuilder = ovs.transactBuilder()
+                .add(op.insert(queue.getSchema())
+                        .withId(queueUuidStr)
+                        .value(queue.getDscpColumn())
+                        .value(queue.getExternalIdsColumn())
+                        .value(queue.getOtherConfigColumn()))
+                .add(op.mutate(qos.getSchema())
+                        .addMutation(qos.getQueuesColumn().getSchema(), Mutator.INSERT,
+                                ImmutableMap.of(queueKey, new UUID(queueUuidStr)))
+                        .where(qos.getUuidColumn().getSchema()
+                                .opEqual(OpenVswitchSchemaSuiteIT.getTestQosUuid()))
+                        .build());
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
+        // Store the returned Queue row UUID to be used in the TearDown deletion transaction
+        OperationResult operationResult = operationResults.get(insertQueueOperationIndex);
+        OpenVswitchSchemaSuiteIT.setTestQueueUuid(operationResult.getUuid());
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder.getOperations().size(), operationResults.size());
+        logger.info("Insert & Mutate operation results for Queue = {} ", operationResults);
+
+    }
+
+    @Override
+    public void update(Object context, UpdateNotification upadateNotification) {
+
+    }
+
+    @Override
+    public void locked(Object context, List<String> ids) {
+
+    }
+
+    @Override
+    public void stolen(Object context, List<String> ids) {
+
+    }
+}
diff --git a/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/SslTestCases.java b/schemas/Open_vSwitch/src/test/java/org/opendaylight/ovsdb/schema/openvswitch/SslTestCases.java
new file mode 100644 (file)
index 0000000..253824d
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ */
+
+package org.opendaylight.ovsdb.schema.openvswitch;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Sets;
+import com.google.common.util.concurrent.ListenableFuture;
+import junit.framework.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.notation.UUID;
+import org.opendaylight.ovsdb.lib.operations.OperationResult;
+import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+
+public class SslTestCases extends OpenVswitchSchemaTestBase {
+    Logger logger = LoggerFactory.getLogger(SslTestCases.class);
+
+    @Before
+    public void setUp() throws ExecutionException, InterruptedException, TimeoutException, IOException {
+        super.setUp();
+    }
+
+    @Test
+    public void testCreateTypedSslTable() throws InterruptedException, ExecutionException, IllegalArgumentException {
+
+        String sslUuidStr = "sslUuidName";
+        String caCert = "PARC";
+        String certificate = "01101110 01100101 01110010 01100100";
+        String privateKey = "SSL_Table_Test_Secret";
+        ImmutableMap<String, String> externalIds = ImmutableMap.of("roomba", "powered");
+
+        SSL ssl = ovs.createTypedRowWrapper(SSL.class);
+        ssl.setCaCert(caCert);
+        ssl.setCertificate(certificate);
+        ssl.setPrivateKey(privateKey);
+        ssl.setExternalIds(externalIds);
+        // Get the parent OVS table UUID in it's single row
+        UUID openVSwitchRowUuid = this.getOpenVSwitchTableUuid(ovs, OpenVswitchSchemaSuiteIT.getTableCache());
+        OpenVSwitch openVSwitch = ovs.getTypedRowWrapper(OpenVSwitch.class, null);
+        // The transaction index for the SSL insert is used to store the SSL UUID
+        int insertSslOperationIndex = 0;
+        TransactionBuilder transactionBuilder = ovs.transactBuilder()
+                .add(op.insert(ssl.getSchema())
+                        .withId(sslUuidStr)
+                        .value(ssl.getCertificateColumn())
+                        .value(ssl.getPrivateKeyColumn())
+                        .value(ssl.getCaCertColumn())
+                        .value(ssl.getExternalIdsColumn()))
+                .add(op.mutate(openVSwitch.getSchema())
+                        .addMutation(openVSwitch.getSslColumn().getSchema(), Mutator.INSERT,
+                                Sets.newHashSet(new UUID(sslUuidStr)))
+                        .where(openVSwitch.getUuidColumn().getSchema().opEqual(openVSwitchRowUuid))
+                        .build());
+
+        ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
+        List<OperationResult> operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
+        // Store the returned SSL row UUID to be used in the TearDown deletion transaction
+        OpenVswitchSchemaSuiteIT.setTestSslUuid(operationResults.get(insertSslOperationIndex).getUuid());
+        // Check if Results matches the number of operations in transaction
+        Assert.assertEquals(transactionBuilder.getOperations().size(), operationResults.size());
+        logger.info("Insert & Mutate operation results for SSL = {} ", operationResults);
+
+    }
+
+    @Override
+    public void update(Object context, UpdateNotification upadateNotification) {
+
+    }
+
+    @Override
+    public void locked(Object context, List<String> ids) {
+
+    }
+
+    @Override
+    public void stolen(Object context, List<String> ids) {
+
+    }
+}
index 5b074f7459f257fb23dbca6faf617ba8ac0429c5..1a1b6f680c506f8bc246b036dc135023f5f0b6d3 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.ovsdb.schema.openvswitch;
 
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
+import junit.framework.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.ovsdb.lib.message.UpdateNotification;
@@ -38,10 +39,27 @@ public class TearDown extends OpenVswitchSchemaTestBase {
         schemaVersion = ovs.getDatabaseSchema("Open_vSwitch").getVersion();
     }
 
+    /**
+     * Tear down the rows in the OVSDB server created by the
+     * integration tests. Deleting the parent Bridge Row in the
+     * Bridge table will cause the OVSDB server to GC most most
+     * of the table rows. The remaining tables with references
+     * are deleted with the follwoing transaction.
+     *
+     * @throws InterruptedException the interrupted exception
+     * @throws ExecutionException the execution exception
+     * @throws IOException the iO exception
+     * @throws TimeoutException the timeout exception
+     */
     @Test
     public void tearDown() throws InterruptedException, ExecutionException, IOException, TimeoutException {
         Bridge bridge = this.ovs.getTypedRowWrapper(Bridge.class, null);
         OpenVSwitch openVSwitch = this.ovs.getTypedRowWrapper(OpenVSwitch.class, null);
+        SSL ssl = this.ovs.getTypedRowWrapper(SSL.class, null);
+        Qos qos = this.ovs.getTypedRowWrapper(Qos.class, null);
+        Port port = this.ovs.getTypedRowWrapper(Port.class, null);
+        Queue queue = this.ovs.getTypedRowWrapper(Queue.class, null);
+        Manager manager = this.ovs.getTypedRowWrapper(Manager.class, null);
 
         TransactionBuilder transactionBuilder = this.ovs.transactBuilder();
 
@@ -54,13 +72,46 @@ public class TearDown extends OpenVswitchSchemaTestBase {
         transactionBuilder.add(op.delete(bridge.getSchema())
                 .where(bridge.getNameColumn().getSchema().opEqual(TEST_BRIDGE_NAME))
                 .build())
-                .add(op.mutate(openVSwitch.getSchema())
-                        .addMutation(openVSwitch.getBridgesColumn().getSchema(), Mutator.DELETE, Sets.newHashSet(OpenVswitchSchemaSuiteIT.getTestBridgeUuid())))
+                .add(op.delete(ssl.getSchema()) // Delete an SSL row in the SSL table
+                        .where(ssl.getUuidColumn().getSchema()
+                                .opEqual(OpenVswitchSchemaSuiteIT.getTestSslUuid()))
+                        .build())
+                .add(op.delete(manager.getSchema()) // Delete a Manager row in the SSL table
+                        .where(manager.getUuidColumn().getSchema()
+                                .opEqual(OpenVswitchSchemaSuiteIT.getTestManagerUuid()))
+                        .build())
+                .add(op.delete(queue.getSchema()) // Delete a Queue row in the Queue table
+                        .where(queue.getUuidColumn().getSchema()
+                                .opEqual(OpenVswitchSchemaSuiteIT.getTestQueueUuid()))
+                        .build())
+                .add(op.delete(qos.getSchema()) // Delete a QoS row in the QOS table
+                        .where(qos.getUuidColumn().getSchema()
+                                .opEqual(OpenVswitchSchemaSuiteIT.getTestQosUuid()))
+                        .build())
+                .add(op.delete(port.getSchema()) // Delete a Port row in the Port table
+                        .where(port.getUuidColumn().getSchema()
+                                .opEqual(OpenVswitchSchemaSuiteIT.getTestQosPortUuid()))
+                        .build())
+                .add(op.mutate(openVSwitch.getSchema()) // Delete a manager_opt column in the OVS table
+                        .addMutation(openVSwitch.getManagerOptionsColumn().getSchema(), Mutator.DELETE,
+                                Sets.newHashSet(OpenVswitchSchemaSuiteIT.getTestManagerUuid())))
+                .add(op.mutate(openVSwitch.getSchema()) // Delete an SSL column in the OVS table
+                        .addMutation(openVSwitch.getSslColumn().getSchema(), Mutator.DELETE,
+                                Sets.newHashSet(OpenVswitchSchemaSuiteIT.getTestSslUuid())))
+                .add(op.mutate(port.getSchema()) // Delete the Qos reference in the Qos test Port row
+                        .addMutation(port.getQosColumn().getSchema(), Mutator.DELETE,
+                                Sets.newHashSet(OpenVswitchSchemaSuiteIT.getTestQosPortUuid())))
+                .add(op.mutate(openVSwitch.getSchema()) // Delete a bridge column reference in the OVS table
+                        .addMutation(openVSwitch.getBridgesColumn().getSchema(), Mutator.DELETE,
+                                Sets.newHashSet(OpenVswitchSchemaSuiteIT.getTestBridgeUuid())))
                 .add(op.commit(true))
                 .execute();
 
         ListenableFuture<List<OperationResult>> results = transactionBuilder.execute();
         List<OperationResult> operationResults = results.get();
+        for (OperationResult result : operationResults) {
+            Assert.assertNull(result.getError());
+        }
         System.out.println("Delete operation results = " + operationResults);
         // tableCache = new HashMap<String, Map<UUID, Row>>();
     }