summaryrefslogtreecommitdiffstats
path: root/policy-management
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-24 13:19:28 -0400
committerJim Hahn <jrh3@att.com>2019-07-24 15:45:15 -0400
commit7602a4380488d872b25cd718176b23369bf9e472 (patch)
tree4583c6bf1cee38301fd25d66cff940b09c3b8b15 /policy-management
parentb08aaddaef7e3ca4248132365859a9a0da712148 (diff)
Add coverage to feature-active-standby-management
Also removed some logger.isXxx() tests, which should reduce the number of branches that need to be tested. Removed unneeded objects and methods from feature-lifecyle. Change-Id: Ic3eb9c0b63a2ad5585846525eb0ebda81fc55d5e Issue-ID: POLICY-1772 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-management')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java42
1 files changed, 11 insertions, 31 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
index d0b98450..818cae80 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
@@ -218,9 +218,7 @@ public class MavenDroolsController implements DroolsController {
/* upgrade */
String messages = this.policyContainer.updateToVersion(newVersion);
- if (logger.isWarnEnabled()) {
- logger.warn("{} UPGRADE results: {}", this, messages);
- }
+ logger.warn("{} UPGRADE results: {}", this, messages);
/*
* If all sucessful (can load new container), now we can remove all coders from previous sessions
@@ -232,9 +230,7 @@ public class MavenDroolsController implements DroolsController {
*/
this.init(decoderConfigurations, encoderConfigurations);
- if (logger.isInfoEnabled()) {
- logger.info("UPDATE-TO-VERSION: completed " + this);
- }
+ logger.info("UPDATE-TO-VERSION: completed {}", this);
}
/**
@@ -247,9 +243,7 @@ public class MavenDroolsController implements DroolsController {
protected void initCoders(List<TopicCoderFilterConfiguration> coderConfigurations,
boolean decoder) {
- if (logger.isInfoEnabled()) {
- logger.info("INIT-CODERS: " + this);
- }
+ logger.info("INIT-CODERS: {}", this);
if (coderConfigurations == null) {
return;
@@ -337,9 +331,7 @@ public class MavenDroolsController implements DroolsController {
* remove decoders.
*/
protected void removeDecoders() {
- if (logger.isInfoEnabled()) {
- logger.info("REMOVE-DECODERS: {}", this);
- }
+ logger.info("REMOVE-DECODERS: {}", this);
if (this.decoderConfigurations == null) {
return;
@@ -357,9 +349,7 @@ public class MavenDroolsController implements DroolsController {
*/
protected void removeEncoders() {
- if (logger.isInfoEnabled()) {
- logger.info("REMOVE-ENCODERS: {}", this);
- }
+ logger.info("REMOVE-ENCODERS: {}", this);
if (this.encoderConfigurations == null) {
return;
@@ -380,18 +370,12 @@ public class MavenDroolsController implements DroolsController {
}
if (modelHash == this.modelClassLoaderHash) {
- if (logger.isInfoEnabled()) {
- logger.info(coderClass.getName()
- + this + " class loader matches original drools controller rules classloader "
- + coderClass.getClassLoader());
- }
+ logger.info("{}{} class loader matches original drools controller rules classloader {}",
+ coderClass.getName(), this, coderClass.getClassLoader());
return true;
} else {
- if (logger.isWarnEnabled()) {
- logger.warn(this + coderClass.getName() + " class loaders don't match "
- + coderClass.getClassLoader() + " vs "
- + this.policyContainer.getClassLoader());
- }
+ logger.warn("{}{} class loaders don't match {} vs {}", this, coderClass.getName(),
+ coderClass.getClassLoader(), this.policyContainer.getClassLoader());
return false;
}
}
@@ -399,9 +383,7 @@ public class MavenDroolsController implements DroolsController {
@Override
public boolean start() {
- if (logger.isInfoEnabled()) {
- logger.info("START: {}", this);
- }
+ logger.info("START: {}", this);
synchronized (this) {
if (this.alive) {
@@ -572,9 +554,7 @@ public class MavenDroolsController implements DroolsController {
@Override
public boolean deliver(TopicSink sink, Object event) {
- if (logger.isInfoEnabled()) {
- logger.info("{}DELIVER: {} FROM {} TO {}", this, event, this, sink);
- }
+ logger.info("{}DELIVER: {} FROM {} TO {}", this, event, this, sink);
for (DroolsControllerFeatureApi feature : DroolsControllerFeatureApi.providers.getList()) {
try {