Added assert operation as per RFC 7047 section 5.2.10
[ovsdb.git] / library / src / test / java / org / opendaylight / ovsdb / lib / OvsDBClientTestIT.java
index bb1f20e2d4a98c6274648b8c20cb70c36126964e..c09afc1293219323526a7f1142ee278aae44e10d 100644 (file)
@@ -111,8 +111,27 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
 
         operationResults = results.get();
         Assert.assertFalse(operationResults.isEmpty());
+        /* Testing for Abort Error */
+        Assert.assertFalse(operationResults.get(1).getError() == null);
         System.out.println("Abort operation results = " + operationResults);
 
+        /*
+         * Adding a separate Abort operation in a transaction. Lets not mix this with other
+         * valid transactions as above.
+         */
+        results = ovs.transactBuilder()
+                .add(op.delete(bridge)
+                        .where(name.opEqual("br-int"))
+                        .operation())
+                .add(op.assertion("Assert12345")) // Failing intentionally
+                .execute();
+
+        operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        /* Testing for an Assertion Error */
+        Assert.assertFalse(operationResults.get(1).getError() == null);
+        System.out.println("Assert operation results = " + operationResults);
+
     }
 
     @Test