X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Ftest%2FAbstractDataBrokerTest.java;h=35f0650985f4b2f41ab599407e52e07a7b6a7b22;hb=03c13bd8a8bb89a729d739eb2fcd501a4dfa5439;hp=5789270dee4e60953e5d7e4805bacffcbb96b6e4;hpb=c222e37f2a0f0f3f6266242fbea2d3b018f4e6e3;p=controller.git
diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTest.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTest.java
index 5789270dee..35f0650985 100644
--- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTest.java
+++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/test/AbstractDataBrokerTest.java
@@ -7,55 +7,41 @@
*/
package org.opendaylight.controller.md.sal.binding.test;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import com.google.common.util.concurrent.ListenableFuture;
-
-public class AbstractDataBrokerTest extends AbstractSchemaAwareTest {
-
- private DataBrokerTestCustomizer testCustomizer;
- private DataBroker dataBroker;
- private DOMDataBroker domBroker;
-
+/**
+ * AbstractDataBrokerTest.
+ *
+ * @deprecated Please now use the AbstractConcurrentDataBrokerTest instead of
+ * this. Normally in a well written test this should be a drop-in
+ * replacement. Instead of {@literal @}Override
+ * setupWithDataBroker(DataBroker dataBroker), please just use
+ * JUnit's {@literal @}Before before() { ... getDataBroker() }. Some
+ * tests which relied on the Test DataBroker being synchronous,
+ * contrary to its specification as well as the production
+ * implementation, may require changes to e.g. use get() on
+ * submit()'ed transaction to make the test wait before asserts. See
+ * also
+ * bug
+ * 7538 for more details.
+ */
+@Deprecated
+public class AbstractDataBrokerTest extends AbstractBaseDataBrokerTest {
@Override
- protected void setupWithSchema(final SchemaContext context) {
- testCustomizer = createDataBrokerTestCustomizer();
- dataBroker = testCustomizer.createDataBroker();
- domBroker = testCustomizer.createDOMDataBroker();
- testCustomizer.updateSchema(context);
- setupWithDataBroker(dataBroker);
- }
-
- protected void setupWithDataBroker(final DataBroker dataBroker) {
- // Intentionally left No-op, subclasses may customize it
- }
-
- protected DataBrokerTestCustomizer createDataBrokerTestCustomizer() {
+ protected AbstractDataBrokerTestCustomizer createDataBrokerTestCustomizer() {
return new DataBrokerTestCustomizer();
}
- public DataBroker getDataBroker() {
- return dataBroker;
- }
-
- public DOMDataBroker getDomBroker() {
- return domBroker;
+ @Override
+ protected void setupWithSchema(SchemaContext context) {
+ super.setupWithSchema(context);
+ setupWithDataBroker(getDataBroker());
}
- protected static final void assertCommit(final ListenableFuture commit) {
- try {
- commit.get(500, TimeUnit.MILLISECONDS);
- } catch (InterruptedException | ExecutionException | TimeoutException e) {
- throw new IllegalStateException(e);
- }
+ protected void setupWithDataBroker(final DataBroker dataBroker) {
+ // Intentionally left No-op, subclasses may customize it
}
-
}