summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src/test
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-01-31 14:49:24 -0600
committerInstrumental <jonathan.gathman@att.com>2019-01-31 14:55:13 -0600
commit3505a52ac853c134ecaf40f2977667de8770ec59 (patch)
tree8c165da9aa66f205fc2c1117b4c2217efb680a26 /auth/auth-core/src/test
parent168005a073b1ae83cb3415bcc74db925915e9b3d (diff)
Implement public private locator
Issue-ID: AAF-723 Change-Id: Ib5507ccaab0b7e565c98a16733d1b42dfb608095 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-core/src/test')
-rw-r--r--auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsService.java2
-rw-r--r--auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsServiceStarter.java2
-rw-r--r--auth/auth-core/src/test/java/org/onap/aaf/auth/util/test/TestKill.java65
3 files changed, 67 insertions, 2 deletions
diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsService.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsService.java
index 65f019f0..b89e2e5d 100644
--- a/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsService.java
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsService.java
@@ -103,7 +103,7 @@ public class JU_AbsService {
BasicEnv bEnv = new BasicEnv();
PropAccess prop = new PropAccess();
- prop.setProperty(Config.AAF_LOCATOR_NAMES, "te.st");
+ prop.setProperty(Config.AAF_LOCATOR_ENTRIES, "te.st");
prop.setProperty(Config.AAF_LOCATOR_VERSION, "te.st");
prop.setLogLevel(Level.DEBUG);
AbsServiceStub absServiceStub = new AbsServiceStub(prop, bEnv); //Testing other branches requires "fails" due to exception handling, will leave that off for now.
diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsServiceStarter.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsServiceStarter.java
index 1fe98d84..2fa9e123 100644
--- a/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsServiceStarter.java
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/server/test/JU_AbsServiceStarter.java
@@ -131,7 +131,7 @@ public class JU_AbsServiceStarter {
BasicEnv bEnv = new BasicEnv();
PropAccess prop = new PropAccess();
- prop.setProperty(Config.AAF_LOCATOR_NAMES, "te.st");
+ prop.setProperty(Config.AAF_LOCATOR_ENTRIES, "te.st");
prop.setProperty(Config.AAF_LOCATOR_VERSION, "te.st");
prop.setLogLevel(Level.DEBUG);
absServiceStub = new AbsServiceStub(prop, bEnv);
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
new file mode 100644
index 00000000..c6ddc79f
--- /dev/null
+++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/util/test/TestKill.java
@@ -0,0 +1,65 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ */
+
+package org.onap.aaf.auth.util.test;
+
+import java.io.IOException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+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);
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run() {
+ System.out.println("Shutdown Hook, thread: setting interrupt");
+ app.cancel(true);
+ tk.longProcess();
+ es.shutdown();
+ }
+ });
+ System.out.println("Service Start");
+ System.out.print("Hit <enter> to end:");
+ try {
+ System.in.read();
+ System.exit(0);
+ } catch (IOException e) {
+ }
+ }
+
+ @Override
+ 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");
+ }
+}