final WriteContext ctx) throws WriteFailedException {
LOG.debug("{}: Updating current: {} dataBefore: {}, datAfter: {}", this, id, dataBefore, dataAfter);
- /* FIXME: Equals does not work properly with augments: https://git.opendaylight.org/gerrit/#/c/37719 */
- if (dataBefore.equals(dataAfter)) {
- LOG.debug("{}: Skipping current(no update): {}", this, id);
- // No change, ignore
- return;
- }
+ // FIXME: Equals does not work properly with augments: https://git.opendaylight.org/gerrit/#/c/37719
+ // Solution: update mdsal-binding-dom-codec to 0.8.2-Beryllium-SR2 when it will be published in
+ // ODL release repository
+ //if (dataBefore.equals(dataAfter)) {
+ // LOG.debug("{}: Skipping current(no update): {}", this, id);
+ // // No change, ignore
+ // return;
+ //}
switch (traversalType) {
case PREORDER: {
LOG.debug("updateCurrentAttributes: id={}, dataBefore={}, dataAfter={}, ctx={}", id, dataBefore, dataAfter,
ctx);
+ // FIXME can be removed after updating mdsal-binding-dom-codec to 0.8.2-Beryllium-SR2
+ // and restoring equality check in AbstractCompositeWriter
+ if (dataBefore.equals(dataAfter)) {
+ LOG.debug("dataBefore equals dataAfter, update will not be performed");
+ return;
+ }
+
final String bdName = checkNotNull(dataAfter.getName());
checkArgument(bdName.equals(dataBefore.getName()),
"BridgeDomain name changed. It should be deleted and then created.");
@Test
public void testUpdateUnknownBridgeDomain() throws Exception {
final String bdName = "bd1";
- final BridgeDomain bd = generateBridgeDomain("bd1");
+ final BridgeDomain bdBefore = generateBridgeDomain(bdName, 0, 1, 0 ,1, 0);
+ final BridgeDomain bdAfter = generateBridgeDomain(bdName, 1, 1, 0 ,1, 0);
try {
- customizer.updateCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bd, bd, ctx);
+ customizer.updateCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bdBefore, bdAfter, ctx);
} catch (IllegalArgumentException e) {
verify(api, never()).bridgeDomainAddDel(any(BridgeDomainAddDel.class));
return;
public void testUpdateBridgeDomainFailed() throws Exception {
final int bdId = 1;
final String bdName = "bd1";
- final BridgeDomain bd = generateBridgeDomain(bdName);
+ final BridgeDomain bdBefore = generateBridgeDomain(bdName, 0, 1, 0 ,1, 0);
+ final BridgeDomain bdAfter = generateBridgeDomain(bdName, 1, 1, 0 ,1, 0);
namingContext.addName(bdId, bdName);
whenBridgeDomainAddDelThenFailure();
try {
- customizer.updateCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bd, bd, ctx);
+ customizer.updateCurrentAttributes(BridgeDomainTestUtils.bdIdentifierForName(bdName), bdBefore, bdAfter, ctx);
} catch (WriteFailedException.UpdateFailedException e) {
- verifyBridgeDomainAddOrUpdateWasInvoked(bd, bdId);
+ verifyBridgeDomainAddOrUpdateWasInvoked(bdAfter, bdId);
return;
}
fail("IllegalStateException was expected");