Make AbstractTest as static class 96/93696/1
authorGilles Thouenon <gilles.thouenon@orange.com>
Tue, 20 Oct 2020 16:01:54 +0000 (18:01 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Mon, 9 Nov 2020 16:05:39 +0000 (17:05 +0100)
Adapt AbstractTest to allow use of @BeforeClass for TAPI UT improvements

Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Co-authored-by: Christophe Betoule <christophe.betoule@orange.com>
Co-authored-by: manuedelf <emmanuelle.delfour@orange.com>
Change-Id: I5f25e7ccf2d781f18822a6a7884030ed97abe9f3

test-common/src/main/java/org/opendaylight/transportpce/test/AbstractTest.java

index 864533b99cecd8a6adfcc81b3ac107f7775048c6..983bae6a1632972e4bb0a759c2284fb79bd4c495 100644 (file)
@@ -14,13 +14,9 @@ import org.opendaylight.mdsal.dom.api.DOMDataBroker;
 
 public abstract class AbstractTest {
 
-    private final DataStoreContext dataStoreContextUtil;
+    private static DataStoreContext dataStoreContextUtil = new DataStoreContextImpl();
 
-    protected AbstractTest() {
-        dataStoreContextUtil = new DataStoreContextImpl();
-    }
-
-    public DataBroker getDataBroker() {
+    public static DataBroker getDataBroker() {
         return dataStoreContextUtil.getDataBroker();
     }
 
@@ -33,7 +29,7 @@ public abstract class AbstractTest {
         return dataStoreContextUtil.getDOMDataBroker();
     }
 
-    public DataStoreContext getDataStoreContextUtil() {
+    public static DataStoreContext getDataStoreContextUtil() {
         return dataStoreContextUtil;
     }