summaryrefslogtreecommitdiffstats
path: root/appc-common/src/test
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-03 16:33:46 +0530
committerTakamune Cho <tc012c@att.com>2018-08-03 20:55:18 +0000
commitec023c04e725afde0ae880e46dd8c682b8591239 (patch)
tree034a852b12ef0fc371bf647ec7af5e2f35567ad5 /appc-common/src/test
parentf835229fe69a79fdfa08c64615733007f826d37b (diff)
added test case to TestSignal.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: Iba603fd695d9f5e2a70fa08f07272e407d0db00c Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-common/src/test')
-rw-r--r--appc-common/src/test/java/org/onap/appc/concurrent/TestSignal.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/appc-common/src/test/java/org/onap/appc/concurrent/TestSignal.java b/appc-common/src/test/java/org/onap/appc/concurrent/TestSignal.java
index 68ab02e38..a5cd5539e 100644
--- a/appc-common/src/test/java/org/onap/appc/concurrent/TestSignal.java
+++ b/appc-common/src/test/java/org/onap/appc/concurrent/TestSignal.java
@@ -6,6 +6,8 @@
* ================================================================================
* Copyright (C) 2017 Amdocs
* =============================================================================
+ * Modification Copyright (C) 2018 IBM
+ * =============================================================================
* 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
@@ -25,7 +27,7 @@ package org.onap.appc.concurrent;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-
+import static org.junit.Assert.assertEquals;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -34,6 +36,8 @@ import java.util.concurrent.TimeoutException;
import org.junit.Test;
import org.onap.appc.concurrent.Signal;
+
+
public class TestSignal {
private static final DateFormat formatter = new SimpleDateFormat("HH:mm:ss.SSS");
@@ -119,7 +123,7 @@ public class TestSignal {
System.out.println(formatter.format(new Date()) + " FRED: Received shutdown");
completed = true;
} catch (TimeoutException e) {
- e.printStackTrace();
+
}
}
@@ -131,4 +135,13 @@ public class TestSignal {
return signal;
}
}
+
+ @Test
+ public void testWaitForAny() throws Exception
+ {
+ Signal mySignal = new Signal(Thread.currentThread());
+ mySignal.setTimeout(50L);
+ String receivedSignal= mySignal.waitForAny(SIGNAL_READY);
+ assertEquals("READY", receivedSignal);
+ }
}