Merge "Remove use of deprecated Guava methods from testtool"
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / ScaleUtil.java
index f67c96e2f4399de2c4fffaccd43b76a1f5d9f849..4d262808d159a07aa1b2dd1885295e9a31ff380a 100644 (file)
@@ -36,7 +36,7 @@ import org.opendaylight.netconf.test.tool.config.ConfigurationBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@SuppressFBWarnings({"DM_EXIT", "DM_DEFAULT_ENCODING"})
+@SuppressFBWarnings({"DM_EXIT", "DM_DEFAULT_ENCODING", "SLF4J_LOGGER_SHOULD_BE_FINAL"})
 public final class ScaleUtil {
     private static final ScheduledExecutorService EXECUTOR = new LoggingWrapperExecutor(4);
     private static final Semaphore SEMAPHORE = new Semaphore(0);
@@ -64,7 +64,8 @@ public final class ScaleUtil {
 
         while (true) {
             root.warn("Starting scale test with {} devices", params.deviceCount);
-            final ScheduledFuture timeoutGuardFuture = EXECUTOR.schedule(new TimeoutGuard(), TIMEOUT, TimeUnit.MINUTES);
+            final ScheduledFuture<?> timeoutGuardFuture = EXECUTOR.schedule(new TimeoutGuard(), TIMEOUT,
+                TimeUnit.MINUTES);
             final Configuration configuration = new ConfigurationBuilder().from(params).build();
             final NetconfDeviceSimulator netconfDeviceSimulator = new NetconfDeviceSimulator(configuration);
             try {
@@ -178,7 +179,7 @@ public final class ScaleUtil {
         deleteFolder(new File(params.distroFolder.getAbsoluteFile() + "/data"));
     }
 
-    private static void deleteFolder(File folder) {
+    private static void deleteFolder(final File folder) {
         File[] files = folder.listFiles();
         if (files != null) { //some JVMs return null for empty dirs
             for (File f : files) {
@@ -199,8 +200,8 @@ public final class ScaleUtil {
     private static class ScaleVerifyCallable implements Callable<Void> {
         private static final Logger LOG = LoggerFactory.getLogger(ScaleVerifyCallable.class);
 
-        private static final String RESTCONF_URL
-                = "http://127.0.0.1:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/";
+        private static final String RESTCONF_URL = "http://127.0.0.1:8181/restconf/operational/"
+                + "network-topology:network-topology/topology/topology-netconf/";
         private static final Pattern PATTERN = Pattern.compile("connected");
 
         private final AsyncHttpClient asyncHttpClient = new AsyncHttpClient(new Builder()
@@ -269,19 +270,19 @@ public final class ScaleUtil {
 
     @SuppressWarnings("checkstyle:illegalCatch")
     public static class LoggingWrapperExecutor extends ScheduledThreadPoolExecutor {
-        public LoggingWrapperExecutor(int corePoolSize) {
+        public LoggingWrapperExecutor(final int corePoolSize) {
             super(corePoolSize);
         }
 
         @Override
-        public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
+        public <V> ScheduledFuture<V> schedule(final Callable<V> callable, final long delay, final TimeUnit unit) {
             return super.schedule(new LogOnExceptionCallable<>(callable), delay, unit);
         }
 
         private static class LogOnExceptionCallable<T> implements Callable<T> {
             private final Callable<T> theCallable;
 
-            LogOnExceptionCallable(Callable<T> theCallable) {
+            LogOnExceptionCallable(final Callable<T> theCallable) {
                 this.theCallable = theCallable;
             }