X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Futil%2Ftest%2FTestKill.java;h=754d476f6d602c557cebfa5b265b9b48fa4de2c0;hb=6dd9704640eb8cc8d6b4ccd266e40a3f6f589e75;hp=c6ddc79f947c2bf404995f7093b1f8179794de91;hpb=e36daf12cf4c5aa4b22fa3cec66a79ff2e2b8b94;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/util/test/TestKill.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/util/test/TestKill.java index c6ddc79f..754d476f 100644 --- a/auth/auth-core/src/test/java/org/onap/aaf/auth/util/test/TestKill.java +++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/util/test/TestKill.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,14 +27,14 @@ import java.util.concurrent.Future; public class TestKill implements Runnable { - public static void main(String[] args) { - ExecutorService es = Executors.newSingleThreadExecutor(); - TestKill tk = new TestKill(); - Future app = es.submit(tk); + public static void main(String[] args) { + ExecutorService es = Executors.newSingleThreadExecutor(); + TestKill tk = new TestKill(); + Future app = es.submit(tk); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { - System.out.println("Shutdown Hook, thread: setting interrupt"); + System.out.println("Shutdown Hook, thread: setting interrupt"); app.cancel(true); tk.longProcess(); es.shutdown(); @@ -43,23 +43,23 @@ public class TestKill implements Runnable { System.out.println("Service Start"); System.out.print("Hit to end:"); try { - System.in.read(); - System.exit(0); - } catch (IOException e) { - } - } + System.in.read(); + System.exit(0); + } catch (IOException e) { + } + } @Override - public void run() { - } - + public void run() { + } + private void longProcess() { - System.out.println("Starting long cleanup process"); - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - System.out.println("Ending long cleanup process"); + System.out.println("Starting long cleanup process"); + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("Ending long cleanup process"); } }