X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FWildcardedScopeBaseTest.java;h=cdf465aacee9da2226d6a2f3b9721b6f8770306e;hb=6faa900c307b5d97fc7726d31b6dad0e67077db8;hp=4c1a860f2a0538da02174c1cc97e57f4b3557dba;hpb=a9533db1d57a2729772ee192a2f96d358c71bede;p=controller.git diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/WildcardedScopeBaseTest.java b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/WildcardedScopeBaseTest.java index 4c1a860f2a..cdf465aace 100644 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/WildcardedScopeBaseTest.java +++ b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/WildcardedScopeBaseTest.java @@ -11,17 +11,15 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope; import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelList; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite { - private static final InstanceIdentifier TOP_LEVEL_LIST_ALL = TOP_LEVEL.node(TopLevelList.QNAME).node( + private static final YangInstanceIdentifier TOP_LEVEL_LIST_ALL = TOP_LEVEL.node(TopLevelList.QNAME).node( TopLevelList.QNAME); @Override @@ -32,7 +30,7 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite @Override public void putTopLevelOneNested(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - AsyncDataChangeEvent> change = task.getChangeEvent().get(); + AsyncDataChangeEvent> change = task.getChangeEvent(); assertNotNull(change); @@ -48,7 +46,7 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite public void replaceTopLevelNestedChanged(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - AsyncDataChangeEvent> change = task.getChangeEvent().get(); + AsyncDataChangeEvent> change = task.getChangeEvent(); assertNotNull(change); assertContains(change.getCreatedData(), path(FOO, BAZ)); @@ -62,7 +60,7 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite protected void putTopLevelWithTwoNested(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - AsyncDataChangeEvent> change = task.getChangeEvent().get(); + AsyncDataChangeEvent> change = task.getChangeEvent(); assertNotNull(change); assertFalse(change.getCreatedData().isEmpty()); @@ -77,7 +75,6 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite protected void twoNestedExistsOneIsDeleted(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - Future future = task.getChangeEvent(); /* * Base listener should be notified only and only if actual node changed its state, * since deletion of child, did not result in change of node we are listening @@ -85,14 +82,14 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite * and this means settable future containing receivedDataChangeEvent is not done. * */ - assertFalse(future.isDone()); + task.verifyNoChangeEvent(); } @Override public void nestedListExistsRootDeleted(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - AsyncDataChangeEvent> change = task.getChangeEvent().get(); + AsyncDataChangeEvent> change = task.getChangeEvent(); assertEmpty(change.getCreatedData()); assertEmpty(change.getUpdatedData()); @@ -103,7 +100,6 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite @Override protected void existingOneNestedWriteAdditionalNested(final DatastoreTestTask task) { - Future future = task.getChangeEvent(); /* * One listener should be notified only and only if actual node changed its state, * since deletion of nested child (in this case /nested-list/nested-list[foo], @@ -112,12 +108,11 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite * and this means settable future containing receivedDataChangeEvent is not done. * */ - assertFalse(future.isDone()); + task.verifyNoChangeEvent(); } @Override protected void existingTopWriteTwoNested(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - Future future = task.getChangeEvent(); /* * One listener should be notified only and only if actual node changed its state, * since deletion of nested child (in this case /nested-list/nested-list[foo], @@ -126,12 +121,12 @@ public class WildcardedScopeBaseTest extends DefaultDataChangeListenerTestSuite * and this means settable future containing receivedDataChangeEvent is not done. * */ - assertFalse(future.isDone()); + task.verifyNoChangeEvent(); } @Override protected void existingTopWriteSibling(final DatastoreTestTask task) throws InterruptedException, ExecutionException { - AsyncDataChangeEvent> change = task.getChangeEvent().get(); + AsyncDataChangeEvent> change = task.getChangeEvent(); assertContains(change.getCreatedData(), path(FOO_SIBLING)); assertNotContains(change.getUpdatedData(), path(FOO), TOP_LEVEL);