use of org.opendaylight.controller.cluster.datastore.modification.AbstractModification in project controller by opendaylight.
the class AbstractTransactionProxyTest method verifyBatchedModifications.
protected void verifyBatchedModifications(final Object message, final boolean expIsReady, final boolean expIsDoCommitOnReady, final Modification... expected) {
assertEquals("Message type", BatchedModifications.class, message.getClass());
BatchedModifications batchedModifications = (BatchedModifications) message;
assertEquals("BatchedModifications size", expected.length, batchedModifications.getModifications().size());
assertEquals("isReady", expIsReady, batchedModifications.isReady());
assertEquals("isDoCommitOnReady", expIsDoCommitOnReady, batchedModifications.isDoCommitOnReady());
for (int i = 0; i < batchedModifications.getModifications().size(); i++) {
Modification actual = batchedModifications.getModifications().get(i);
assertEquals("Modification type", expected[i].getClass(), actual.getClass());
assertEquals("getPath", ((AbstractModification) expected[i]).getPath(), ((AbstractModification) actual).getPath());
if (actual instanceof WriteModification) {
assertEquals("getData", ((WriteModification) expected[i]).getData(), ((WriteModification) actual).getData());
}
}
}
Aggregations