aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-27 16:39:28 +0300
committerGravatar Vitaly Takmazov2016-11-27 16:39:28 +0300
commite741ce2ec74765e49b9c279264afdddf5a1122f6 (patch)
treec03711cd697418117e46fb149f4f9b1c1f783d66
parent4b77103aa10a0b11345d8c3c6e4b77a48741d6da (diff)
cleanup
-rw-r--r--juick-api/src/test/java/com/juick/api/tests/AuthSimpleTest.java8
-rw-r--r--juick-server/src/main/java/com/juick/util/ThreadHelper.java37
2 files changed, 0 insertions, 45 deletions
diff --git a/juick-api/src/test/java/com/juick/api/tests/AuthSimpleTest.java b/juick-api/src/test/java/com/juick/api/tests/AuthSimpleTest.java
deleted file mode 100644
index d22d3cf7..00000000
--- a/juick-api/src/test/java/com/juick/api/tests/AuthSimpleTest.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.juick.api.tests;
-
-/**
- * Created by aalexeev on 11/26/16.
- */
-public class AuthSimpleTest {
- private final String HEADER = "Authorization: Basic dXNlcjE6dXNlcjFQYXNz"; // user1:user1Pass
-}
diff --git a/juick-server/src/main/java/com/juick/util/ThreadHelper.java b/juick-server/src/main/java/com/juick/util/ThreadHelper.java
deleted file mode 100644
index 64a56f7c..00000000
--- a/juick-server/src/main/java/com/juick/util/ThreadHelper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.juick.util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Created by aalexeev on 11/11/16.
- */
-public class ThreadHelper {
- private ThreadHelper() {
- throw new IllegalStateException();
- }
-
- private static Logger logger = LoggerFactory.getLogger(ThreadHelper.class);
-
- public static void shutdownAndAwaitTermination(ExecutorService pool) {
- pool.shutdown(); // Disable new tasks from being submitted
- try {
- // Wait a while for existing tasks to terminate
- if (!pool.awaitTermination(5, TimeUnit.SECONDS)) {
- logger.info("Calls shutDownNow for pool");
- pool.shutdownNow(); // Cancel currently executing tasks
- // Wait a while for tasks to respond to being cancelled
- if (!pool.awaitTermination(5, TimeUnit.SECONDS))
- logger.error("Pool did not terminate");
- }
- } catch (InterruptedException ie) {
- // (Re-)Cancel if current thread also interrupted
- pool.shutdownNow();
- // Preserve interrupt status
- Thread.currentThread().interrupt();
- }
- }
-}