AbstractConcurrentDataBrokerTest @deprecate-s the AbstractDataBrokerTest 81/90081/1
authorMichael Vorburger <vorburger@redhat.com>
Mon, 6 Feb 2017 23:23:31 +0000 (00:23 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 29 May 2020 11:59:00 +0000 (13:59 +0200)
This is take #2 on a similar earlier attempt which made the same change
directly in AbstractDataBrokerTest, which broke some downstrean tests,
which were BADLY WRITTEN (!) because the assumed single threaded direct
execution (which DataBroker does not guarantee).

https://bugs.opendaylight.org/show_bug.cgi?id=7538 has full background

JIRA: MDSAL-556
Change-Id: I05ac3525bdcf1ab9c99dfa15b98e090848d0fddc
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3282f1989aba438817739bbf611fd133c381a5e7)

binding/mdsal-binding-dom-adapter/src/test/java/org/opendaylight/mdsal/binding/dom/adapter/test/tests/AbstractDataBrokerTestTest.java

index 6181c4ce43be630b8314c880d351917fdf14419e..098af85df5b1a367659aed8572bcede9193ae342 100644 (file)
@@ -15,12 +15,13 @@ import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.p
 import static org.opendaylight.mdsal.binding.test.model.util.ListsBindingUtils.topLevelList;
 
 import java.util.concurrent.ExecutionException;
+import org.junit.Before;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runners.MethodSorters;
 import org.opendaylight.mdsal.binding.api.ReadTransaction;
 import org.opendaylight.mdsal.binding.api.WriteTransaction;
-import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractDataBrokerTest;
+import org.opendaylight.mdsal.binding.dom.adapter.test.AbstractConcurrentDataBrokerTest;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugment;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.mdsal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
@@ -35,9 +36,14 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * @author Michael Vorburger
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class AbstractDataBrokerTestTest extends AbstractDataBrokerTest {
+public class AbstractDataBrokerTestTest extends AbstractConcurrentDataBrokerTest {
     private static final InstanceIdentifier<Top> TOP_PATH = InstanceIdentifier.create(Top.class);
 
+    @Before
+    public void before() {
+        assertNotNull(getDataBroker());
+    }
+
     @Test
     public void aEnsureDataBrokerIsNotNull() {
         assertNotNull(getDataBroker());