X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmodification%2FAbstractModificationTest.java;h=e3bca7e16b351b2225b58f3bacb316b23135d070;hb=466078ab1dc8a8cc2981b161051f6edecd6af85a;hp=9daa3429fd32096d5d840068ece2e8089761005b;hpb=7e62b4a59f9e43bcd0585845f1aeb55c44199f27;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java index 9daa3429fd..e3bca7e16b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/modification/AbstractModificationTest.java @@ -11,7 +11,9 @@ package org.opendaylight.controller.cluster.datastore.modification; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import java.util.Optional; +import org.junit.AfterClass; import org.junit.Before; +import org.junit.BeforeClass; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction; import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; @@ -19,15 +21,27 @@ import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction; import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; +import org.opendaylight.yangtools.yang.model.api.SchemaContext; public abstract class AbstractModificationTest { + private static SchemaContext TEST_SCHEMA_CONTEXT; protected InMemoryDOMDataStore store; + @BeforeClass + public static void beforeClass() { + TEST_SCHEMA_CONTEXT = TestModel.createTestContext(); + } + + @AfterClass + public static void afterClass() { + TEST_SCHEMA_CONTEXT = null; + } + @Before public void setUp() { store = new InMemoryDOMDataStore("test", MoreExecutors.newDirectExecutorService()); - store.onGlobalContextUpdated(TestModel.createTestContext()); + store.onGlobalContextUpdated(TEST_SCHEMA_CONTEXT); } protected void commitTransaction(final DOMStoreWriteTransaction transaction) {