Suvrat1629 commented on code in PR #3394:
URL: https://github.com/apache/logging-log4j2/pull/3394#discussion_r1938298218


##########
log4j-core-test/src/test/java/org/apache/logging/log4j/core/config/AbstractConfigurationTest.java:
##########
@@ -79,17 +79,30 @@ public void setup() {
             rootLogger.getAttributes().put("level", "INFO");
             loggers.getChildren().add(rootLogger);
 
-            if (map != null) {
+            // Add Properties Node only if the map is not null and has entries
+            if (map != null && !map.isEmpty()) {
                 final Node properties = newNode(rootNode, "Properties");
                 rootNode.getChildren().add(properties);
 
                 for (final Entry<String, String> entry : map.entrySet()) {
+                    // Create Property node with "name" and "value" attributes
                     final Node property = newNode(properties, "Property");
                     property.getAttributes().put("name", entry.getKey());
                     property.getAttributes().put("value", entry.getValue());
                     properties.getChildren().add(property);
                 }
             }
+
+            // Add a Scripts Node if required (Example for flexibility in 
testing)
+            final Node scripts = newNode(rootNode, "Scripts");
+            rootNode.getChildren().add(scripts);
+
+            // Add sample script node for testing purposes
+            final Node script = newNode(scripts, "Script");
+            script.getAttributes().put("name", "TestScript");
+            script.getAttributes().put("language", "JavaScript");
+            script.getAttributes().put("scriptText", "print('Hello, 
Log4j!');");
+            scripts.getChildren().add(script);

Review Comment:
   I also just restored the AbstractConfigurationTest.java file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to