public void testRoundTrip() { MultiTransactionRecord request = new MultiTransactionRecord(); request.add(Op.check("check", 1)); request.add(Op.create("create", "create data".getBytes(), ZooDefs.Ids.CREATOR_ALL_ACL, (int)ZooDefs.Perms.ALL)); request.add(Op.delete("delete", 17)); request.add(Op.setData("setData", "set data".getBytes(), 19)); MultiTransactionRecord decodedRequest = codeDecode(request); Assert.assertEquals(request, decodedRequest); }
/// <summary> /// Constructs an update operation. Arguments are as for the ZooKeeper method of the same name. /// </summary> /// <param name="path"> /// the path of the node /// </param> /// <param name="data"> /// the data to set /// </param> /// <param name="version"> /// the expected matching version /// </param> public Transaction setData(string path, byte[] data, int version = -1) { ops.Add(Op.setData(path, data, version)); return(this); }