X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=benchmark%2Fntfbenchmark%2Fsrc%2Fmain%2Fjava%2Fntfbenchmark%2Fimpl%2FNtfbenchmarkProvider.java;h=39e8273bdb8833e119cfe25f5963208025b5dd97;hb=refs%2Fchanges%2F64%2F84164%2F1;hp=cb5925f68a4ac9e2c6bcf130aa59d334487d5890;hpb=12fcdfe39aa26dcba7fd3bb4d4c68e3d02e65c51;p=controller.git diff --git a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java index cb5925f68a..39e8273bdb 100644 --- a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java +++ b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java @@ -7,6 +7,8 @@ */ package ntfbenchmark.impl; +import static com.google.common.base.Verify.verifyNotNull; + import com.google.common.util.concurrent.ListenableFuture; import java.util.ArrayList; import java.util.List; @@ -14,8 +16,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.binding.api.NotificationService; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.NtfbenchmarkService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput.ProducerType; @@ -30,11 +32,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService { - private static final Logger LOG = LoggerFactory.getLogger(NtfbenchmarkProvider.class); + private static final int TEST_TIMEOUT = 5; + private final NotificationService listenService; private final NotificationPublishService publishService; - private static final int testTimeout = 5; public NtfbenchmarkProvider(final NotificationService listenServiceDependency, final NotificationPublishService publishServiceDependency) { @@ -83,16 +85,17 @@ public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService final long startTime = System.nanoTime(); for (int i = 0; i < input.getProducers().intValue(); i++) { - executor.submit(producers.get(i)); + // FIXME: fools RV_RETURN_VALUE_IGNORED_BAD_PRACTICE for now, but we should check some more + verifyNotNull(executor.submit(producers.get(i))); } executor.shutdown(); try { - executor.awaitTermination(testTimeout, TimeUnit.MINUTES); + executor.awaitTermination(TEST_TIMEOUT, TimeUnit.MINUTES); for (ListenerRegistration listenerRegistration : listeners) { listenerRegistration.getInstance().getAllDone().get(); } } catch (final InterruptedException | ExecutionException e) { - LOG.error("Out of time: test did not finish within the {} min deadline ", testTimeout); + LOG.error("Out of time: test did not finish within the {} min deadline ", TEST_TIMEOUT); } final long producerEndTime = System.nanoTime(); @@ -106,7 +109,6 @@ public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService allListeners += listenerRegistration.getInstance().getReceived(); } - final long listenerEndTime = System.nanoTime(); final long listenerElapsedTime = producerEndTime - startTime; LOG.info("Test Done");