X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FDefaultDataChangeListenerTestSuite.java;h=af58f63331d3377104797864bd3c37804fa6abec;hp=54d2043dc76a6df85cafdfe468f1bf7ff5b989f3;hb=a3ebcb3c36804de1e4c0177f3462e33958b0c216;hpb=79202e1fd05d2606b35e163f608fad9cce84b5d4 diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/DefaultDataChangeListenerTestSuite.java b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/DefaultDataChangeListenerTestSuite.java index 54d2043dc7..af58f63331 100644 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/DefaultDataChangeListenerTestSuite.java +++ b/opendaylight/md-sal/sal-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/DefaultDataChangeListenerTestSuite.java @@ -13,14 +13,22 @@ import org.junit.Test; import org.opendaylight.controller.md.sal.dom.store.impl.DatastoreTestTask.WriteTransactionCustomizer; import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction; +/** + * Base template for a test suite for testing DataChangeListener functionality. + */ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataChangeListenerTest { protected static final String FOO_SIBLING = "foo-sibling"; + /** + * Callback invoked when the test suite can modify task parameters. + * + * @param task Update task configuration as needed + */ abstract protected void customizeTask(DatastoreTestTask task); @Test - public final void putTopLevelOneNested() throws InterruptedException, ExecutionException { + public final void putTopLevelOneNested() throws Exception { DatastoreTestTask task = newTestTask().test(writeOneTopMultipleNested(FOO, BAR)); customizeTask(task); @@ -29,7 +37,7 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha } @Test - public final void existingTopWriteSibling() throws InterruptedException, ExecutionException { + public final void existingTopWriteSibling() throws Exception { DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO)).test( new WriteTransactionCustomizer() { @Override @@ -46,7 +54,7 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha @Test - public final void existingTopWriteTwoNested() throws InterruptedException, ExecutionException { + public final void existingTopWriteTwoNested() throws Exception { DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO)).test( new WriteTransactionCustomizer() { @Override @@ -64,7 +72,7 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha @Test - public final void existingOneNestedWriteAdditionalNested() throws InterruptedException, ExecutionException { + public final void existingOneNestedWriteAdditionalNested() throws Exception { DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO, BAR)).test( new WriteTransactionCustomizer() { @Override @@ -79,11 +87,10 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha protected abstract void existingOneNestedWriteAdditionalNested(DatastoreTestTask task) throws InterruptedException, ExecutionException; - protected abstract void putTopLevelOneNested(DatastoreTestTask task) throws InterruptedException, - ExecutionException; + protected abstract void putTopLevelOneNested(DatastoreTestTask task) throws Exception; @Test - public final void replaceTopLevelNestedChanged() throws InterruptedException, ExecutionException { + public final void replaceTopLevelNestedChanged() throws Exception { DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO, BAR)).test( writeOneTopMultipleNested(FOO, BAZ)); customizeTask(task); @@ -95,7 +102,7 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha ExecutionException; @Test - public final void putTopLevelWithTwoNested() throws InterruptedException, ExecutionException { + public final void putTopLevelWithTwoNested() throws Exception { DatastoreTestTask task = newTestTask().test(writeOneTopMultipleNested(FOO, BAR, BAZ)); customizeTask(task); @@ -107,7 +114,7 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha ExecutionException; @Test - public final void twoNestedExistsOneIsDeleted() throws InterruptedException, ExecutionException { + public final void twoNestedExistsOneIsDeleted() throws Exception { DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO, BAR, BAZ)).test( deleteNested(FOO, BAZ)); @@ -120,7 +127,7 @@ public abstract class DefaultDataChangeListenerTestSuite extends AbstractDataCha ExecutionException; @Test - public final void nestedListExistsRootDeleted() throws InterruptedException, ExecutionException { + public final void nestedListExistsRootDeleted() throws Exception { DatastoreTestTask task = newTestTask().cleanup(null).setup(writeOneTopMultipleNested(FOO, BAR, BAZ)) .test(DatastoreTestTask.simpleDelete(TOP_LEVEL));