aboutsummaryrefslogtreecommitdiffstats
path: root/feature-eelf/src/test
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-07-18 01:06:39 -0500
committerJorge Hernandez <jh1730@att.com>2017-07-18 09:18:43 -0500
commitae4a935b835c0dc588c7a53aef846dd6506b732f (patch)
treece2371f6dde3ed453fc0db0affa00038b51ae242 /feature-eelf/src/test
parent8ce73e2fca0fdadd23e3557108742514af1205c3 (diff)
[POLICY-66] self-contained features support
installation/enable/disable of self contained package features: Feature 3rd party dependencies, configuration files, and custom installation scripts do not need to be packaged within the policy core base to be used. Change-Id: I35a472e63bd0f9f7aa6cd0c112d41d2b4604a892 Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'feature-eelf/src/test')
-rw-r--r--feature-eelf/src/test/java/org/openecomp/policy/drools/eelf/test/EElfTest.java32
1 files changed, 20 insertions, 12 deletions
diff --git a/feature-eelf/src/test/java/org/openecomp/policy/drools/eelf/test/EElfTest.java b/feature-eelf/src/test/java/org/openecomp/policy/drools/eelf/test/EElfTest.java
index 2ded0d0d..6023622d 100644
--- a/feature-eelf/src/test/java/org/openecomp/policy/drools/eelf/test/EElfTest.java
+++ b/feature-eelf/src/test/java/org/openecomp/policy/drools/eelf/test/EElfTest.java
@@ -48,7 +48,7 @@ public class EElfTest {
/**
* logback configuration location
*/
- public final static String LOGBACK_CONFIGURATION_FILE_DEFAULT = "src/main/install/config/logback.xml";
+ public final static String LOGBACK_CONFIGURATION_FILE_DEFAULT = "src/main/feature/config/logback-eelf.xml";
/**
* SLF4J Logger
@@ -73,15 +73,15 @@ public class EElfTest {
/**
* Assert Log Levels are the same between an EELF Logger and an SLF4J Logger
*
- * @param eelfAuditLogger
- * @param slf4jAuditLogger
+ * @param eelfLogger EELF Logger
+ * @param slf4jLogger SLF4J Logger
*/
- protected void assertLogLevels(EELFLogger eelfAuditLogger, Logger slf4jAuditLogger) {
- assertTrue(slf4jAuditLogger.isDebugEnabled() == eelfAuditLogger.isDebugEnabled());
- assertTrue(slf4jAuditLogger.isInfoEnabled() == eelfAuditLogger.isInfoEnabled());
- assertTrue(slf4jAuditLogger.isErrorEnabled() == eelfAuditLogger.isErrorEnabled());
- assertTrue(slf4jAuditLogger.isWarnEnabled() == eelfAuditLogger.isWarnEnabled());
- assertTrue(slf4jAuditLogger.isTraceEnabled() == eelfAuditLogger.isTraceEnabled());
+ protected void assertLogLevels(EELFLogger eelfLogger, Logger slf4jLogger) {
+ assertTrue(slf4jLogger.isDebugEnabled() == eelfLogger.isDebugEnabled());
+ assertTrue(slf4jLogger.isInfoEnabled() == eelfLogger.isInfoEnabled());
+ assertTrue(slf4jLogger.isErrorEnabled() == eelfLogger.isErrorEnabled());
+ assertTrue(slf4jLogger.isWarnEnabled() == eelfLogger.isWarnEnabled());
+ assertTrue(slf4jLogger.isTraceEnabled() == eelfLogger.isTraceEnabled());
}
@Test
@@ -117,14 +117,22 @@ public class EElfTest {
EELFLogger eelfAuditLogger = EELFManager.getInstance().getAuditLogger();
Logger slf4jAuditLogger = org.slf4j.LoggerFactory.getLogger(Configuration.AUDIT_LOGGER_NAME);
org.openecomp.policy.common.logging.flexlogger.Logger flexLogger =
- FlexLogger.getLogger(EElfTest.class);
+ FlexLogger.getLogger(EElfTest.class, true);
- /* generate an audit entry through both logs */
+ /* generate an error entry */
+
+ Exception testException = new IllegalStateException("exception test");
+ flexLogger.error("flex-logger exception", testException);
+ EELFManager.getInstance().getErrorLogger().error("eelf-logger exception", testException);
+ org.slf4j.LoggerFactory.getLogger(Configuration.ERROR_LOGGER_NAME).error("slf4j-logger", testException);
+
+
+ /* generate an audit entry through all logs */
flexLogger.audit("flexlogger audit");
eelfAuditLogger.info("eelf audit");
slf4jAuditLogger.info("slf4j audit");
-
+
/* check log levels in eelf and standard slf4j change in both directions */
/* eelf initiated */