Add log4j2 agent tests
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 14 Jan 2022 19:53:33 +0000 (19:53 +0000)
committerMichael Jeanson <mjeanson@efficios.com>
Mon, 24 Jan 2022 22:29:30 +0000 (22:29 +0000)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
36 files changed:
README.md
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/context/AppContextITBase.java
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/events/EnabledEventsITBase.java
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/events/MultiSessionITBase.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/context/JulAppContextIT.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulEnabledEventsIT.java
lttng-ust-java-tests-jul/src/test/java/org/lttng/ust/agent/integration/events/JulMultiSessionIT.java
lttng-ust-java-tests-log4j/pom.xml
lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/context/Log4jAppContextIT.java
lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jEnabledEventsIT.java
lttng-ust-java-tests-log4j/src/test/java/org/lttng/ust/agent/integration/events/Log4jMultiSessionIT.java
lttng-ust-java-tests-log4j2/.classpath [new file with mode: 0644]
lttng-ust-java-tests-log4j2/.project [new file with mode: 0644]
lttng-ust-java-tests-log4j2/.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
lttng-ust-java-tests-log4j2/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
lttng-ust-java-tests-log4j2/.settings/org.eclipse.jdt.ui.prefs [new file with mode: 0644]
lttng-ust-java-tests-log4j2/.settings/org.eclipse.m2e.core.prefs [new file with mode: 0644]
lttng-ust-java-tests-log4j2/pom.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/context/Log4j2AppContextIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/context/Log4j2AppContextOrderingIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2EnabledEventsIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2ListEventsIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2MultiSessionIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerOrderingIT.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/utils/Log4j2TestContext.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/utils/Log4j2TestUtils.java [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2AppContextIT.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2AppContextOrderingIT.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2EnabledEventsIT.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2FilterListenerOrderingIT.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2MultiSessionIT.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersAllAttached.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersNoneAttached.xml [new file with mode: 0644]
lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersSomeAttached.xml [new file with mode: 0644]
pom.xml

index cfe2c0b5a8730c82558d823453ba46838bf8fa82..6d1f5fa785918628757e2c4f1e19c7ff6b411c8b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -68,10 +68,11 @@ If for example, you installed into the `/usr` prefix instead of `/usr/local`,
 you can use the following properties to specify different locations for the
 lttng-ust-agent-java jars:
 
-    mvn clean verify
-    -Dcommon-jar-location=/usr/share/java/lttng-ust-agent-common.jar
-    -Djul-jar-location=/usr/share/java/lttng-ust-agent-jul.jar
-    -Dlog4j-jar-location=/usr/share/java/lttng-ust-agent-log4j.jar
+    mvn clean verify \
+    -Dcommon-jar-location=/usr/share/java/lttng-ust-agent-common.jar \
+    -Djul-jar-location=/usr/share/java/lttng-ust-agent-jul.jar \
+    -Dlog4j-jar-location=/usr/share/java/lttng-ust-agent-log4j.jar \
+    -Dlog4j2-jar-location=/usr/share/java/lttng-ust-agent-log4j2.jar
 
 To specify a different locations for the JNI .so libraries, you can set the
 `-Djava.library.path` property on the JVM:
index 99ba6fb5adb89edf93ed97263603f02256b9bd7c..f7b32936ad2b2cb4fab6db6d581d58850ae289ef 100644 (file)
@@ -58,6 +58,8 @@ public abstract class AppContextITBase {
 
     protected abstract Domain getDomain();
 
+    protected abstract boolean closeHandlers();
+
     protected abstract void sendEventsToLoggers();
 
     /**
@@ -81,7 +83,9 @@ public abstract class AppContextITBase {
     public void testTeardown() {
         session.close();
 
-        logHandler.close();
+        if (closeHandlers()) {
+            logHandler.close();
+        }
         logHandler = null;
 
         /* In case some tests fail or forget to unregister their retrievers */
index 99ce2a3ccf3fc7023b183b8dcf0b2987e77b0737..7a7ce36183712f394749f95dcf3638106b779e96 100644 (file)
@@ -55,6 +55,8 @@ public abstract class EnabledEventsITBase {
 
     protected abstract Domain getDomain();
 
+    protected abstract boolean closeHandlers();
+
     protected abstract void sendEventsToLoggers();
 
     /**
@@ -77,9 +79,11 @@ public abstract class EnabledEventsITBase {
     public void testTeardown() {
         session.close();
 
-        handlerA.close();
-        handlerB.close();
-        handlerC.close();
+        if (closeHandlers()) {
+            handlerA.close();
+            handlerB.close();
+            handlerC.close();
+        }
 
         handlerA = null;
         handlerB = null;
index bfaa3fc4ac7923655c8994633d7499cd6d02e180..bc75961da6f995337041aeb30c24790512bd8a6d 100644 (file)
@@ -56,6 +56,8 @@ public abstract class MultiSessionITBase {
 
     protected abstract Domain getDomain();
 
+    protected abstract boolean closeHandlers();
+
     protected abstract void sendEventsToLoggers();
 
     /**
@@ -77,10 +79,12 @@ public abstract class MultiSessionITBase {
         session2.close();
         session3.close();
 
-        handlerA.close();
-        handlerB.close();
-        handlerC.close();
-        handlerD.close();
+        if (closeHandlers()) {
+            handlerA.close();
+            handlerB.close();
+            handlerC.close();
+            handlerD.close();
+        }
 
         handlerA = null;
         handlerB = null;
index 844acef936dac65458f47e2b684233b883bb3c95..56e8d56abb480b1678d37bfd7f48bdd551f4a346 100644 (file)
@@ -85,6 +85,12 @@ public class JulAppContextIT extends AppContextITBase {
         return DOMAIN;
     }
 
+    @Override
+    protected boolean closeHandlers()
+    {
+        return true;
+    }
+
     @Override
     protected void sendEventsToLoggers() {
         JulTestUtils.send10EventsTo(logger);
index 0226f7d55eb193cf4536866e5b132cee4f32c9f8..0cfe8607629e7fbad0cb8de1611bcc91410e8b72 100644 (file)
@@ -106,6 +106,12 @@ public class JulEnabledEventsIT extends EnabledEventsITBase {
         return DOMAIN;
     }
 
+    @Override
+    protected boolean closeHandlers()
+    {
+        return true;
+    }
+
     @Override
     protected void sendEventsToLoggers() {
         JulTestUtils.send10EventsTo(loggerA);
index 0c860bbd8ace4f2e9e48b8588235d4194345c2a4..5ab9bf0cf0f95a4acf72d7ffede1d32c1182c951 100644 (file)
@@ -109,6 +109,12 @@ public class JulMultiSessionIT extends MultiSessionITBase {
         return DOMAIN;
     }
 
+    @Override
+    protected boolean closeHandlers()
+    {
+        return true;
+    }
+
     @Override
     protected void sendEventsToLoggers() {
         JulTestUtils.send10EventsTo(loggerA);
index e8254436a2362df21806981cd7ecd0189e74ba2e..016befad8fd7b6dbb340c2125dfe6036395facbc 100644 (file)
@@ -31,7 +31,7 @@
   <artifactId>lttng-ust-java-tests-log4j</artifactId>
   <packaging>jar</packaging>
 
-  <name>LTTng-UST Java Agent Log4j API Integration Tests</name>
+  <name>LTTng-UST Java Agent Log4j 1.x API Integration Tests</name>
 
   <dependencies>
     <dependency>
index 1eea96dedf267b9302b1ce4511bc54a7d9769aec..162d13e429d5ff67b173e58c5bdfa293a3da33b9 100644 (file)
@@ -85,6 +85,12 @@ public class Log4jAppContextIT extends AppContextITBase {
         return DOMAIN;
     }
 
+    @Override
+    protected boolean closeHandlers()
+    {
+        return true;
+    }
+
     @Override
     protected void sendEventsToLoggers() {
         Log4jTestUtils.send10Events(logger);
index 2d73217ce7a8764cac057b5965fb6fb7a05a2e8b..34bfdf7257249944e3cd3179ddc16b42474e7b2e 100644 (file)
@@ -107,6 +107,12 @@ public class Log4jEnabledEventsIT extends EnabledEventsITBase {
         return DOMAIN;
     }
 
+    @Override
+    protected boolean closeHandlers()
+    {
+        return true;
+    }
+
     @Override
     protected void sendEventsToLoggers() {
         Log4jTestUtils.send10Events(loggerA);
index 150260a8681711ec0257a772608ef8ccf4a5b22d..dc654b0df696010334a85ac306d608b9e98621b6 100644 (file)
@@ -111,6 +111,12 @@ public class Log4jMultiSessionIT extends MultiSessionITBase {
         return DOMAIN;
     }
 
+    @Override
+    protected boolean closeHandlers()
+    {
+        return true;
+    }
+
     @Override
     protected void sendEventsToLoggers() {
         Log4jTestUtils.send10Events(loggerA);
diff --git a/lttng-ust-java-tests-log4j2/.classpath b/lttng-ust-java-tests-log4j2/.classpath
new file mode 100644 (file)
index 0000000..e6f72a7
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" output="target/classes" path="src/main/java">
+               <attributes>
+                       <attribute name="optional" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+               <attributes>
+                       <attribute name="optional" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry combineaccessrules="false" exported="true" kind="src" path="/lttng-ust-java-tests-common"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+               <attributes>
+                       <attribute name="module" value="true"/>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+               <attributes>
+                       <attribute name="maven.pomderived" value="true"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/lttng-ust-java-tests-log4j2/.project b/lttng-ust-java-tests-log4j2/.project
new file mode 100644 (file)
index 0000000..881022c
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>lttng-ust-java-tests-log4j2</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
diff --git a/lttng-ust-java-tests-log4j2/.settings/org.eclipse.core.resources.prefs b/lttng-ust-java-tests-log4j2/.settings/org.eclipse.core.resources.prefs
new file mode 100644 (file)
index 0000000..8dd9b1d
--- /dev/null
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding//src/test/java=UTF-8
+encoding/<project>=UTF-8
diff --git a/lttng-ust-java-tests-log4j2/.settings/org.eclipse.jdt.core.prefs b/lttng-ust-java-tests-log4j2/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..f1acd28
--- /dev/null
@@ -0,0 +1,392 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=warning
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
+org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
diff --git a/lttng-ust-java-tests-log4j2/.settings/org.eclipse.jdt.ui.prefs b/lttng-ust-java-tests-log4j2/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644 (file)
index 0000000..b883c15
--- /dev/null
@@ -0,0 +1,62 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_Spaces
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/lttng-ust-java-tests-log4j2/.settings/org.eclipse.m2e.core.prefs b/lttng-ust-java-tests-log4j2/.settings/org.eclipse.m2e.core.prefs
new file mode 100644 (file)
index 0000000..f897a7f
--- /dev/null
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/lttng-ust-java-tests-log4j2/pom.xml b/lttng-ust-java-tests-log4j2/pom.xml
new file mode 100644 (file)
index 0000000..422ba8c
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (C) 2022, EfficiOS Inc.
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.lttng.ust</groupId>
+    <artifactId>lttng-ust-java-parent</artifactId>
+    <version>1.1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>lttng-ust-java-tests-log4j2</artifactId>
+  <packaging>jar</packaging>
+
+  <name>LTTng-UST Java Agent Log4j 2.x API Integration Tests</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.lttng.ust.agent</groupId>
+      <artifactId>lttng-ust-agent-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.lttng.ust.agent</groupId>
+      <artifactId>lttng-ust-agent-log4j2</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.lttng.tools</groupId>
+      <artifactId>lttng-tools-java</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.lttng.ust</groupId>
+      <artifactId>lttng-ust-java-tests-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/context/Log4j2AppContextIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/context/Log4j2AppContextIT.java
new file mode 100644 (file)
index 0000000..f285b89
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.context;
+
+import java.io.IOException;
+
+import org.apache.logging.log4j.core.Logger;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.lttng.tools.ILttngSession.Domain;
+import org.lttng.ust.agent.ILttngHandler;
+import org.lttng.ust.agent.utils.Log4j2TestContext;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Enabled app contexts test for the LTTng-UST Log4j 2.x log handler.
+ */
+public class Log4j2AppContextIT extends AppContextITBase {
+
+    private static final Domain DOMAIN = Domain.LOG4J;
+
+    private Log4j2TestContext testContext;
+    private Logger logger;
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+    /**
+     * Test setup
+     *
+     * @throws SecurityException
+     * @throws IOException
+     */
+    @Before
+    public void log4j2Setup() throws SecurityException, IOException {
+        testContext = new Log4j2TestContext("log4j2.Log4j2AppContextIT.xml");
+
+        testContext.beforeTest();
+
+        logger = testContext.getLoggerContext().getLogger(EVENT_NAME);
+
+        logHandler = (ILttngHandler) logger.getAppenders().get("Lttng");
+    }
+
+    /**
+     * Test teardown
+     */
+    @After
+    public void log4j2Teardown() {
+        testContext.afterTest();
+        logger = null;
+    }
+
+    @Override
+    protected Domain getDomain() {
+        return DOMAIN;
+    }
+
+    @Override
+    protected boolean closeHandlers()
+    {
+        return false;
+    }
+
+    @Override
+    protected void sendEventsToLoggers() {
+        Log4j2TestUtils.send10Events(logger);
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/context/Log4j2AppContextOrderingIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/context/Log4j2AppContextOrderingIT.java
new file mode 100644 (file)
index 0000000..9189f82
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.context;
+
+
+import org.apache.logging.log4j.core.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.lttng.tools.ILttngSession.Domain;
+import org.lttng.ust.agent.ILttngHandler;
+import org.lttng.ust.agent.utils.Log4j2TestContext;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Implementation of {@link AppContextOrderingITBase} for the log4j API.
+ */
+public class Log4j2AppContextOrderingIT extends AppContextOrderingITBase {
+
+    private Log4j2TestContext testContext;
+    private Logger logger;
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+    /**
+     * Test teardown
+     */
+    @After
+    public void log4j2Teardown() {
+        logger = null;
+        logHandler = null;
+
+        testContext.afterTest();
+    }
+
+    @Override
+    protected Domain getDomain() {
+        return Domain.LOG4J;
+    }
+
+    @Override
+    protected void registerAgent() {
+        testContext = new Log4j2TestContext("log4j2.Log4j2AppContextOrderingIT.xml");
+
+        testContext.beforeTest();
+
+        logger = testContext.getLoggerContext().getLogger(EVENT_NAME);
+
+        logHandler = (ILttngHandler) logger.getAppenders().get("Lttng");
+    }
+
+    @Override
+    protected void sendEventsToLoggers() {
+        Log4j2TestUtils.send10Events(logger);
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2EnabledEventsIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2EnabledEventsIT.java
new file mode 100644 (file)
index 0000000..bd5ad3e
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.events;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.apache.logging.log4j.core.Appender;
+import org.apache.logging.log4j.core.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.lttng.tools.ILttngSession.Domain;
+import org.lttng.ust.agent.ILttngHandler;
+import org.lttng.ust.agent.log4j2.LttngLogAppender;
+import org.lttng.ust.agent.utils.Log4j2TestContext;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Enabled events test for the LTTng-UST Log4j log handler.
+ */
+public class Log4j2EnabledEventsIT extends EnabledEventsITBase {
+
+    private static final String APPENDER_NAME_A = "LttngA";
+    private static final String APPENDER_NAME_B = "LttngB";
+    private static final String APPENDER_NAME_C = "LttngC";
+
+    private static final Domain DOMAIN = Domain.LOG4J;
+
+    private Log4j2TestContext testContext;
+
+    private Logger loggerA;
+    private Logger loggerB;
+    private Logger loggerC;
+    private Logger loggerD;
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+    /**
+     * Test setup
+     *
+     * @throws SecurityException
+     * @throws IOException
+     */
+    @SuppressWarnings("resource")
+    @Before
+    public void log4j2Setup() throws SecurityException, IOException {
+
+        testContext = new Log4j2TestContext("log4j2.Log4j2EnabledEventsIT.xml");
+
+        testContext.beforeTest();
+
+        loggerA = testContext.getLoggerContext().getLogger(EVENT_NAME_A);
+        loggerB = testContext.getLoggerContext().getLogger(EVENT_NAME_B);
+        loggerC = testContext.getLoggerContext().getLogger(EVENT_NAME_C);
+        loggerD = testContext.getLoggerContext().getLogger(EVENT_NAME_D);
+
+        handlerA = (ILttngHandler) loggerA.getAppenders().get(APPENDER_NAME_A);
+        handlerB = (ILttngHandler) loggerB.getAppenders().get(APPENDER_NAME_B);
+        handlerC = (ILttngHandler) loggerC.getAppenders().get(APPENDER_NAME_C);
+    }
+
+    /**
+     * Test teardown
+     */
+    @After
+    public void log4j2Teardown() {
+        loggerA = null;
+        loggerB = null;
+        loggerC = null;
+        loggerD = null;
+
+        testContext.afterTest();
+    }
+
+    @Override
+    protected Domain getDomain() {
+        return DOMAIN;
+    }
+
+    @Override
+    protected boolean closeHandlers()
+    {
+        return false;
+    }
+
+    @Override
+    protected void sendEventsToLoggers() {
+        Log4j2TestUtils.send10Events(loggerA);
+        Log4j2TestUtils.send10Events(loggerB);
+        Log4j2TestUtils.send10Events(loggerC);
+        Log4j2TestUtils.send10Events(loggerD);
+    }
+
+    @Override
+    protected void sendLocalizedEvent(String rawString, Object[] params) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @Test
+    public void testLocalizedMessage() {
+        /* Does not apply to log4j 1.2.x */
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2ListEventsIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2ListEventsIT.java
new file mode 100644 (file)
index 0000000..92eedec
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.events;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.logging.log4j.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.lttng.tools.ILttngSession;
+import org.lttng.ust.agent.utils.Log4j2TestContext;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Test suite for the list events command for the log4j domain
+ */
+public class Log4j2ListEventsIT {
+
+    protected static final String LOGGER_NAME_1 = "org.lttng.somecomponent";
+    protected static final String LOGGER_NAME_2 = "org.lttng.mycomponent";
+    protected static final String LOGGER_NAME_3 = "org.lttng.myothercomponent-àéç";
+
+    private Logger logger1;
+    private Logger logger2;
+    private Logger logger3;
+
+    private ILttngSession session;
+    private Log4j2TestContext testContext;
+
+    @Rule
+    public TestName testName = new TestName();
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+    /**
+     * Create a new session before each test.
+     */
+    @Before
+    public void testSetup() {
+        session = ILttngSession.createSession("Log4j2ListEventsIT", ILttngSession.Domain.LOG4J);
+
+        testContext = new Log4j2TestContext("log4j2." + testName.getMethodName() + ".xml");
+
+        testContext.beforeTest();
+
+        logger1 = testContext.getLoggerContext().getLogger(LOGGER_NAME_1);
+        logger2 = testContext.getLoggerContext().getLogger(LOGGER_NAME_2);
+        logger3 = testContext.getLoggerContext().getLogger(LOGGER_NAME_3);
+    }
+
+    /**
+     * Close the current session after each test.
+     */
+    @After
+    public void testTeardown() {
+        session.close();
+        testContext.afterTest();
+    }
+
+    /**
+     * Test with many loggers existing, but none of them having a LTTng handler
+     * attached.
+     */
+    @Test
+    public void testManyLoggersNoneAttached() {
+
+        /* Don't attach anything */
+        List<String> actualEvents = session.listEvents();
+        assertTrue(actualEvents.isEmpty());
+    }
+
+    /**
+     * Test with many loggers existing, but only a subset of them has a LTTng
+     * handler attached.
+     */
+    @Test
+    public void testManyLoggersSomeAttached() {
+
+        List<String> expectedEvents = Arrays.asList(LOGGER_NAME_1);
+        List<String> actualEvents = session.listEvents();
+
+        Collections.sort(expectedEvents);
+        Collections.sort(actualEvents);
+
+        assertEquals(expectedEvents, actualEvents);
+    }
+
+    /**
+     * Test with many loggers existing, and all of them having a LTTng handler
+     * attached.
+     */
+    @Test
+    public void testManyLoggersAllAttached() {
+
+        List<String> expectedEvents = Arrays.asList(LOGGER_NAME_1, LOGGER_NAME_2, LOGGER_NAME_3);
+        List<String> actualEvents = session.listEvents();
+
+        Collections.sort(expectedEvents);
+        Collections.sort(actualEvents);
+
+        assertEquals(expectedEvents, actualEvents);
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2MultiSessionIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/events/Log4j2MultiSessionIT.java
new file mode 100644 (file)
index 0000000..e4b29c3
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.events;
+
+import java.io.IOException;
+
+import org.apache.logging.log4j.core.Logger;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.lttng.tools.ILttngSession.Domain;
+import org.lttng.ust.agent.ILttngHandler;
+import org.lttng.ust.agent.utils.Log4j2TestContext;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Log4j tests for multiple concurrent tracing sessions
+ */
+public class Log4j2MultiSessionIT extends MultiSessionITBase {
+
+    private static final String APPENDER_NAME_A = "LttngA";
+    private static final String APPENDER_NAME_B = "LttngB";
+    private static final String APPENDER_NAME_C = "LttngC";
+    private static final String APPENDER_NAME_D = "LttngD";
+
+    private static final Domain DOMAIN = Domain.LOG4J;
+
+    private Log4j2TestContext testContext;
+
+    private Logger loggerA;
+    private Logger loggerB;
+    private Logger loggerC;
+    private Logger loggerD;
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+       /**
+        * Test setup
+        *
+        * @throws SecurityException
+        * @throws IOException
+        */
+    @Before
+    public void log4j2Setup() throws SecurityException, IOException {
+
+        testContext = new Log4j2TestContext("log4j2.Log4j2MultiSessionIT.xml");
+
+        testContext.beforeTest();
+
+        loggerA = testContext.getLoggerContext().getLogger(EVENT_NAME_A);
+        loggerB = testContext.getLoggerContext().getLogger(EVENT_NAME_B);
+        loggerC = testContext.getLoggerContext().getLogger(EVENT_NAME_C);
+        loggerD = testContext.getLoggerContext().getLogger(EVENT_NAME_D);
+
+        handlerA = (ILttngHandler) loggerA.getAppenders().get(APPENDER_NAME_A);
+        handlerB = (ILttngHandler) loggerB.getAppenders().get(APPENDER_NAME_B);
+        handlerC = (ILttngHandler) loggerC.getAppenders().get(APPENDER_NAME_C);
+        handlerD = (ILttngHandler) loggerD.getAppenders().get(APPENDER_NAME_D);
+    }
+
+    /**
+     * Test teardown
+     */
+    @After
+    public void log4j2Teardown() {
+        loggerA = null;
+        loggerB = null;
+        loggerC = null;
+        loggerD = null;
+
+        testContext.afterTest();
+    }
+
+    @Override
+    protected Domain getDomain() {
+        return DOMAIN;
+    }
+
+    @Override
+    protected boolean closeHandlers()
+    {
+        return false;
+    }
+
+    @Override
+    protected void sendEventsToLoggers() {
+        Log4j2TestUtils.send10Events(loggerA);
+        Log4j2TestUtils.send10Events(loggerB);
+        Log4j2TestUtils.send10Events(loggerC);
+        Log4j2TestUtils.send10Events(loggerD);
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerIT.java
new file mode 100644 (file)
index 0000000..057e8b0
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.filter;
+
+import java.io.IOException;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.lttng.tools.ILttngSession;
+import org.lttng.ust.agent.ILttngHandler;
+import org.lttng.ust.agent.log4j2.LttngLogAppender;
+import org.lttng.ust.agent.utils.ILogLevelStrings;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Filter notifications tests using the log4j logging API.
+ *
+ * @author Alexandre Montplaisir
+ */
+public class Log4j2FilterListenerIT extends FilterListenerITBase {
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+    @Override
+    protected ILttngSession.Domain getSessionDomain() {
+        return ILttngSession.Domain.LOG4J;
+    }
+
+    @Override
+    protected ILttngHandler getLogHandler() throws SecurityException, IOException {
+        return LttngLogAppender.createAppender("Log4j2FilterListenerIT", null, null);
+    }
+
+    @Override
+    protected ILogLevelStrings getLogLevelStrings() {
+        return ILogLevelStrings.LOG4J_LOGLEVEL_STRINGS;
+    }
+
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerOrderingIT.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/integration/filter/Log4j2FilterListenerOrderingIT.java
new file mode 100644 (file)
index 0000000..dae9a6b
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.integration.filter;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.lttng.tools.ILttngSession.Domain;
+import org.lttng.ust.agent.utils.Log4j2TestContext;
+import org.lttng.ust.agent.utils.Log4j2TestUtils;
+
+/**
+ * Implementation of {@link FilterListenerOrderingITBase} for the log4j API.
+ */
+public class Log4j2FilterListenerOrderingIT extends FilterListenerOrderingITBase {
+
+    private Log4j2TestContext testContext;
+
+    /**
+     * Class setup
+     */
+    @BeforeClass
+    public static void log4j2ClassSetup() {
+        Log4j2TestUtils.testClassSetup();
+    }
+
+    /**
+     * Class cleanup
+     */
+    @AfterClass
+    public static void log4j2ClassCleanup() {
+        Log4j2TestUtils.testClassCleanup();
+    }
+
+    @Override
+    protected Domain getDomain() {
+        return Domain.LOG4J;
+    }
+
+    @Override
+    protected void registerAgent() {
+        testContext = new Log4j2TestContext("log4j2.Log4j2FilterListenerOrderingIT.xml");
+        testContext.beforeTest();
+    }
+
+    @Override
+    protected void deregisterAgent() {
+        testContext.afterTest();
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/utils/Log4j2TestContext.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/utils/Log4j2TestContext.java
new file mode 100644 (file)
index 0000000..96b2683
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.utils;
+
+import java.net.URI;
+import java.net.URL;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.core.LoggerContext;
+
+public class Log4j2TestContext {
+
+    private final URI configFileUri;
+
+    private LoggerContext loggerContext;
+
+    public Log4j2TestContext(String configFile) {
+
+        URL resource = getClass().getClassLoader().getResource(configFile);
+
+        if (resource == null) {
+            throw new IllegalArgumentException("Config file not found: " + configFile);
+        }
+
+        try {
+            this.configFileUri = resource.toURI();
+        } catch (Exception e) {
+            throw new IllegalArgumentException("Config file invalid URI: " + resource);
+        }
+    }
+
+    public synchronized LoggerContext getLoggerContext() {
+        return loggerContext;
+    }
+
+    public synchronized void beforeTest() {
+        loggerContext = (LoggerContext) LogManager.getContext(
+                ClassLoader.getSystemClassLoader(), false, configFileUri);
+    }
+
+    public synchronized void afterTest() {
+        loggerContext.stop();
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/utils/Log4j2TestUtils.java b/lttng-ust-java-tests-log4j2/src/test/java/org/lttng/ust/agent/utils/Log4j2TestUtils.java
new file mode 100644 (file)
index 0000000..948e120
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2022, EfficiOS Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.lttng.ust.agent.utils;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.Logger;
+import org.lttng.tools.ILttngSession.Domain;
+import org.lttng.tools.LttngToolsHelper;
+import org.lttng.ust.agent.log4j2.LttngLogAppender;
+
+
+/**
+ * Utility methods for log4j 2.x tests
+ */
+public final class Log4j2TestUtils {
+
+    private Log4j2TestUtils() {
+    }
+
+    /**
+     * Setup method common to most log4j tests. To be called in a @BeforeClass.
+     */
+    public static void testClassSetup() {
+        /* Make sure we can find the JNI library and lttng-tools */
+        checkForLog4jLibrary();
+        assertTrue("lttng-tools is not working properly.", LttngUtils.checkForLttngTools(Domain.LOG4J));
+
+        LttngToolsHelper.destroyAllSessions();
+    }
+
+    /**
+     * Teardown method common to most log4j tests. To be called in a @AfterClass.
+     */
+    public static void testClassCleanup() {
+        LttngToolsHelper.deleteAllTraces();
+    }
+
+    /**
+     * Check the the Log4j native library is available, effectively allowing
+     * LTTng Log4j appenders to be used.
+     */
+    private static void checkForLog4jLibrary() {
+        try {
+            LttngLogAppender testAppender = LttngLogAppender.createAppender("checkForLttngTools", null, null);
+            testAppender.close();
+        } catch (SecurityException | IOException e) {
+            fail(e.getMessage());
+        }
+    }
+
+    /**
+     * Send 10 dummy events through the provided logger
+     *
+     * @param logger
+     *            The logger to use to send events
+     */
+    public static void send10Events(Logger logger) {
+        // Levels/priorities are DEBUG, ERROR, FATAL, INFO, TRACE, WARN
+        logger.debug("Debug message. Lost among so many.");
+        logger.debug("Debug message with a throwable", new IOException());
+        logger.error("Error messsage. This might be bad.");
+        logger.error("Error message with a throwable", new IOException());
+        logger.fatal("A fatal message. You are already dead.");
+        logger.info("A info message. Lol, who cares.");
+        logger.trace("A trace message. No, no *that* trace");
+        logger.warn("A warn message. Yellow underline.");
+        logger.log(Level.DEBUG, "A debug message using .log()");
+        logger.log(Level.ERROR, "A error message using .log()");
+    }
+}
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2AppContextIT.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2AppContextIT.xml
new file mode 100644 (file)
index 0000000..11016e1
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="Log4j2AppContextIT" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="Lttng"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="EventName">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2AppContextOrderingIT.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2AppContextOrderingIT.xml
new file mode 100644 (file)
index 0000000..6c812c5
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="Log4j2AppContextOrderingIT" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="Lttng"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="EventName">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2EnabledEventsIT.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2EnabledEventsIT.xml
new file mode 100644 (file)
index 0000000..a55444c
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="Log4j2ListEventsIT" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="LttngA"/>
+        <Lttng name="LttngB"/>
+        <Lttng name="LttngC"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="EventA">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngA"/>
+        </Logger>
+        <Logger name="EventAB">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngB"/>
+        </Logger>
+        <Logger name="EventABC">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngC"/>
+        </Logger>
+        <Logger name="EventABCDÉ">
+          <AppenderRef ref="Console"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2FilterListenerOrderingIT.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2FilterListenerOrderingIT.xml
new file mode 100644 (file)
index 0000000..54f5ce0
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="Log4j2FilterListenerOrderingIT" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="Lttng"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="EventA">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng"/>
+        </Logger>
+        <Logger name="EventB">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2MultiSessionIT.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.Log4j2MultiSessionIT.xml
new file mode 100644 (file)
index 0000000..22e5be1
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="Log4j2MultiSessionIT" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="LttngA"/>
+        <Lttng name="LttngB"/>
+        <Lttng name="LttngC"/>
+        <Lttng name="LttngD"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="EventA">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngA"/>
+        </Logger>
+        <Logger name="EventAB">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngB"/>
+        </Logger>
+        <Logger name="EventABC">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngC"/>
+        </Logger>
+        <Logger name="EventABCDÉ">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="LttngD"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersAllAttached.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersAllAttached.xml
new file mode 100644 (file)
index 0000000..979a1e2
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="ManyLoggersAllAttached" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="Lttng1"/>
+        <Lttng name="Lttng2"/>
+        <Lttng name="Lttng3"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.lttng.somecomponent">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng1"/>
+        </Logger>
+        <Logger name="org.lttng.mycomponent">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng2"/>
+        </Logger>
+        <Logger name="org.lttng.myothercomponent-àéç">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng3"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersNoneAttached.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersNoneAttached.xml
new file mode 100644 (file)
index 0000000..ffbbd03
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="ManyLoggersNoneAttached" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="Lttng1"/>
+        <Lttng name="Lttng2"/>
+        <Lttng name="Lttng3"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.lttng.somecomponent">
+          <AppenderRef ref="Console"/>
+        </Logger>
+        <Logger name="org.lttng.mycomponent">
+          <AppenderRef ref="Console"/>
+        </Logger>
+        <Logger name="org.lttng.myothercomponent-àéç">
+          <AppenderRef ref="Console"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersSomeAttached.xml b/lttng-ust-java-tests-log4j2/src/test/resources/log4j2.testManyLoggersSomeAttached.xml
new file mode 100644 (file)
index 0000000..de5e9cd
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration name="ManyLoggersSomeAttached" status="debug">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+          <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+        </Console>
+        <Lttng name="Lttng1"/>
+        <Lttng name="Lttng2"/>
+        <Lttng name="Lttng3"/>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.lttng.somecomponent">
+          <AppenderRef ref="Console"/>
+          <AppenderRef ref="Lttng1"/>
+        </Logger>
+        <Logger name="org.lttng.mycomponent">
+          <AppenderRef ref="Console"/>
+        </Logger>
+        <Logger name="org.lttng.myothercomponent-àéç">
+          <AppenderRef ref="Console"/>
+        </Logger>
+        <Root level="all"/>
+    </Loggers>
+</Configuration>
diff --git a/pom.xml b/pom.xml
index c5a354a7016a96ff208c42e1b03183d4e3e1f677..f2b55cb89a8766a4aa904a444b7fc6ba48d74bd0 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -6,12 +6,12 @@
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; only
    version 2.1 of the License.
-  
+
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.
+
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    
+
     <!-- Paths that come from UST's default "make install".
          Override to specify other locations. -->
     <common-jar-location>/usr/local/share/java/lttng-ust-agent-common-1.0.0.jar</common-jar-location>
     <jul-jar-location>/usr/local/share/java/lttng-ust-agent-jul-1.0.0.jar</jul-jar-location>
     <log4j-jar-location>/usr/local/share/java/lttng-ust-agent-log4j-1.0.0.jar</log4j-jar-location>
+    <log4j2-jar-location>/usr/local/share/java/lttng-ust-agent-log4j2-1.0.0.jar</log4j2-jar-location>
     <argLine>-Djava.library.path=/usr/local/lib</argLine>
   </properties>
 
         <version>1.2.17</version>
       </dependency>
 
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <version>2.17.1</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-core</artifactId>
+        <version>2.17.1</version>
+      </dependency>
+
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <systemPath>${log4j-jar-location}</systemPath>
       </dependency>
 
+      <dependency>
+        <groupId>org.lttng.ust.agent</groupId>
+        <artifactId>lttng-ust-agent-log4j2</artifactId>
+        <version>1.0.0</version>
+        <scope>system</scope>
+        <systemPath>${log4j2-jar-location}</systemPath>
+      </dependency>
+
       <!-- Provided by this project -->
       <dependency>
         <groupId>org.lttng.tools</groupId>
     <module>lttng-ust-java-tests-common</module>
     <module>lttng-ust-java-tests-jul</module>
     <module>lttng-ust-java-tests-log4j</module>
+    <module>lttng-ust-java-tests-log4j2</module>
   </modules>
 
 </project>
This page took 0.047066 seconds and 4 git commands to generate.