Remove TestBundleDiag constructor 09/111609/3
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 4 May 2024 05:45:18 +0000 (07:45 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 4 May 2024 10:28:00 +0000 (12:28 +0200)
We do not want to leak the default implementation around, its direct
injection.

JIRA: ODLPARENT-312
Change-Id: I44755d26f52aa5249e5302264d42557bf241bf1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bundles-test-lib/src/main/java/org/opendaylight/odlparent/bundlestest/lib/TestBundleDiag.java
features-test/pom.xml
features-test/src/main/java/org/opendaylight/odlparent/featuretest/SingleFeatureTest.java

index c440de880294f3731035ad2c3fcb5a7a5b871e8a..7917cdc7c2526ed9c9cef4d667c490cca1b8c42e 100644 (file)
@@ -11,12 +11,9 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.concurrent.TimeUnit;
 import java.util.function.BiConsumer;
-import org.apache.karaf.bundle.core.BundleService;
 import org.awaitility.Awaitility;
 import org.awaitility.core.ConditionTimeoutException;
 import org.opendaylight.odlparent.bundles.diag.DiagProvider;
-import org.opendaylight.odlparent.bundles.diag.ri.DefaultDiagProvider;
-import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -34,11 +31,6 @@ public class TestBundleDiag {
         this.diagProvider = requireNonNull(diagProvider);
     }
 
-    @Deprecated(forRemoval = true)
-    public TestBundleDiag(final BundleContext bundleContext, final BundleService bundleService) {
-        this(new DefaultDiagProvider(bundleService, bundleContext));
-    }
-
     /**
      * Does something similar to Karaf's "diag" CLI command, and throws a {@link SystemStateFailureException} if
      * anything including bundle wiring is not OK.
index f57d54ab41dc340d823846cc4f1250b2e0b6effe..2dd99177066bb4a2768ee3b484c5c9585f451d34 100644 (file)
           <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>bundles-diag</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
             <artifactId>bundles4-test</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
index 1c87b0e75e79f19197ab0fee0830ae07c880e900..e71216de29e6af4cbe3a38ea9773600228a3ad06 100644 (file)
@@ -42,6 +42,7 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.opendaylight.odlparent.bundles.diag.ri.DefaultDiagProvider;
 import org.opendaylight.odlparent.bundlestest.lib.TestBundleDiag;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
@@ -414,7 +415,8 @@ public class SingleFeatureTest {
         if (!Boolean.getBoolean(BUNDLES_DIAG_SKIP_PROP)) {
             LOG.info("new TestBundleDiag().checkBundleDiagInfos() STARTING");
             Integer timeOutInSeconds = Integer.getInteger(BUNDLES_DIAG_TIMEOUT_PROP, 5 * 60);
-            new TestBundleDiag(bundleContext, bundleService).checkBundleDiagInfos(timeOutInSeconds, SECONDS);
+            new TestBundleDiag(new DefaultDiagProvider(bundleService, bundleContext))
+                .checkBundleDiagInfos(timeOutInSeconds, SECONDS);
             LOG.info("new TestBundleDiag().checkBundleDiagInfos() ENDED");
         } else {
             LOG.warn("SKIPPING TestBundleDiag because system property {} is true: {}", BUNDLES_DIAG_SKIP_PROP,