*/
package org.opendaylight.controller.md.sal.dom.store.impl;
-import java.util.concurrent.ExecutionException;
-
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.
*
* @param task Update task configuration as needed
*/
- abstract protected void customizeTask(DatastoreTestTask task);
+ protected abstract void customizeTask(DatastoreTestTask task);
@Test
public final void putTopLevelOneNested() throws Exception {
putTopLevelOneNested(task);
}
+ protected abstract void putTopLevelOneNested(DatastoreTestTask task) throws Exception;
+
@Test
public final void existingTopWriteSibling() throws Exception {
DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO)).test(
- new WriteTransactionCustomizer() {
- @Override
- public void customize(final DOMStoreReadWriteTransaction tx) {
- tx.write(path(FOO_SIBLING), topLevelList(FOO_SIBLING).build());
- }
- });
+ tx -> tx.write(path(FOO_SIBLING), topLevelList(FOO_SIBLING).build()));
customizeTask(task);
task.run();
existingTopWriteSibling(task);
}
- protected abstract void existingTopWriteSibling(DatastoreTestTask task) throws InterruptedException, ExecutionException;
-
+ protected abstract void existingTopWriteSibling(DatastoreTestTask task) throws Exception;
@Test
public final void existingTopWriteTwoNested() throws Exception {
DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO)).test(
- new WriteTransactionCustomizer() {
- @Override
- public void customize(final DOMStoreReadWriteTransaction tx) {
- tx.write(path(FOO,BAR), nestedList(BAR).build());
- tx.write(path(FOO,BAZ), nestedList(BAZ).build());
- }
- });
+ tx -> {
+ tx.write(path(FOO,BAR), nestedList(BAR).build());
+ tx.write(path(FOO,BAZ), nestedList(BAZ).build());
+ });
customizeTask(task);
task.run();
existingTopWriteTwoNested(task);
}
- protected abstract void existingTopWriteTwoNested(DatastoreTestTask task) throws InterruptedException, ExecutionException;
+ protected abstract void existingTopWriteTwoNested(DatastoreTestTask task) throws Exception;
@Test
public final void existingOneNestedWriteAdditionalNested() throws Exception {
DatastoreTestTask task = newTestTask().setup(writeOneTopMultipleNested(FOO, BAR)).test(
- new WriteTransactionCustomizer() {
- @Override
- public void customize(final DOMStoreReadWriteTransaction tx) {
- tx.write(path(FOO,BAZ), nestedList(BAZ).build());
- }
- });
+ tx -> tx.write(path(FOO,BAZ), nestedList(BAZ).build()));
customizeTask(task);
task.run();
existingOneNestedWriteAdditionalNested(task);
}
- protected abstract void existingOneNestedWriteAdditionalNested(DatastoreTestTask task) throws InterruptedException, ExecutionException;
-
- protected abstract void putTopLevelOneNested(DatastoreTestTask task) throws Exception;
+ protected abstract void existingOneNestedWriteAdditionalNested(DatastoreTestTask task) throws Exception;
@Test
public final void replaceTopLevelNestedChanged() throws Exception {
replaceTopLevelNestedChanged(task);
}
- protected abstract void replaceTopLevelNestedChanged(DatastoreTestTask task) throws InterruptedException,
- ExecutionException;
+ protected abstract void replaceTopLevelNestedChanged(DatastoreTestTask task) throws Exception;
@Test
public final void putTopLevelWithTwoNested() throws Exception {
putTopLevelWithTwoNested(task);
}
- protected abstract void putTopLevelWithTwoNested(DatastoreTestTask task) throws InterruptedException,
- ExecutionException;
+ protected abstract void putTopLevelWithTwoNested(DatastoreTestTask task) throws Exception;
@Test
public final void twoNestedExistsOneIsDeleted() throws Exception {
twoNestedExistsOneIsDeleted(task);
}
- protected abstract void twoNestedExistsOneIsDeleted(DatastoreTestTask task) throws InterruptedException,
- ExecutionException;
+ protected abstract void twoNestedExistsOneIsDeleted(DatastoreTestTask task) throws Exception;
@Test
public final void nestedListExistsRootDeleted() throws Exception {
nestedListExistsRootDeleted(task);
}
- protected abstract void nestedListExistsRootDeleted(DatastoreTestTask task) throws InterruptedException,
- ExecutionException;
+ protected abstract void nestedListExistsRootDeleted(DatastoreTestTask task) throws Exception;
}