You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2019/12/16 19:50:04 UTC

[lucene-solr] branch branch_8_4 updated: SOLR-14099: work around @LogLevel bug in LoggingHandlerTest

This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch branch_8_4
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8_4 by this push:
     new ede8755  SOLR-14099: work around @LogLevel bug in LoggingHandlerTest
ede8755 is described below

commit ede8755d444131174976d5983205623df42fff93
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Mon Dec 16 12:12:55 2019 -0700

    SOLR-14099: work around @LogLevel bug in LoggingHandlerTest
    
    (cherry picked from commit e6b5da5c12c37dce6f3d767bbafb75b28795ab2f)
---
 .../test/org/apache/solr/handler/admin/LoggingHandlerTest.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/solr/core/src/test/org/apache/solr/handler/admin/LoggingHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/LoggingHandlerTest.java
index 7b22010..933b126 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/LoggingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/LoggingHandlerTest.java
@@ -51,11 +51,18 @@ public class LoggingHandlerTest extends SolrTestCaseJ4 {
     LoggerConfig loggerConfig = ctx.getConfiguration().getLoggerConfig(tst.getName());
     loggerConfig.setLevel(Level.INFO);
     ctx.updateLoggers();
+
+    // HACK: work around for SOLR-14099...
+    Logger apache = LogManager.getLogger("org.apache");
+    final String apache_level = null == apache.getLevel()
+      ? "null[@name='level']"
+      : "str[@name='level'][.='"+apache.getLevel()+"']";
+
     
     assertQ("Show Log Levels OK",
             req(CommonParams.QT,"/admin/logging")
             ,"//arr[@name='loggers']/lst/str[.='"+tst.getName()+"']/../str[@name='level'][.='"+tst.getLevel()+"']"
-            ,"//arr[@name='loggers']/lst/str[.='org.apache']/../null[@name='level']"
+            ,"//arr[@name='loggers']/lst/str[.='org.apache']/../" + apache_level
             );
 
     assertQ("Set a level",