Small change to please sonar 33/10833/6
authorMagnusen, Drew (dm741q) <dm741q@att.com>
Thu, 7 Sep 2017 13:55:17 +0000 (08:55 -0500)
committerMagnusen, Drew (dm741q) <dm741q@att.com>
Thu, 7 Sep 2017 17:02:31 +0000 (12:02 -0500)
Added a 'Thread.currentThread().interrupt()' in a catch of the run method of TTControllerTask
at the direction of sonar.

Added dump of exception to logger.

Issue-ID: POLICY-213
Change-Id: I2bdd74eacedb6d1950c5c730430d7f723ce494bc
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
feature-test-transaction/src/main/java/org/onap/policy/drools/testtransaction/TestTransaction.java

index 4da6b6e..e5cff24 100644 (file)
@@ -89,6 +89,7 @@ class TTImpl implements TestTransaction {
  *
  */
 class TTControllerTask implements Runnable {
+
   // get an instance of logger
   private static final Logger logger = LoggerFactory.getLogger(TTControllerTask.class);
 
@@ -184,9 +185,10 @@ class TTControllerTask implements Runnable {
       }
     } catch (final InterruptedException e) {
       logger.info("{}: stopping ...", this, e);
+      Thread.currentThread().interrupt();
     } catch (final IllegalArgumentException e) {
       logger.error("{}: controller {} has not been enabled for testing: ", this,
-          this.controller.getName(), e.getMessage());
+          this.controller.getName(), e.getMessage(), e);
     } catch (final Exception e) {
       logger.error("Controller: {} is not testable - TestTransaction caught exception: {} ",
           this.controller.getName(), e.getMessage());
@@ -209,5 +211,4 @@ class TTControllerTask implements Runnable {
     builder.append("]");
     return builder.toString();
   }
-
 }