[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-6-g38d48fc

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Jun 24 14:09:46 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  38d48fc3abfb16ca5a72668780ed5501ad3e422b (commit)
      from  690ac09e30d017edea2681395b1fa33095f5f269 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=38d48fc3abfb16ca5a72668780ed5501ad3e422b
http://github.com/ceki/logback/commit/38d48fc3abfb16ca5a72668780ed5501ad3e422b

commit 38d48fc3abfb16ca5a72668780ed5501ad3e422b
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Jun 24 14:01:54 2011 +0200

    configuration recovery works with included files as well. Fixes LBCLASSIC-265

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
index 6615f51..9ffa390 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeFilter.java
@@ -19,9 +19,11 @@ import java.util.List;
 
 import ch.qos.logback.classic.gaffer.GafferUtil;
 import ch.qos.logback.classic.util.EnvUtil;
+import ch.qos.logback.core.CoreConstants;
 import ch.qos.logback.core.joran.event.SaxEvent;
 import ch.qos.logback.core.joran.spi.ConfigurationWatchList;
 import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
+import ch.qos.logback.core.status.Status;
 import ch.qos.logback.core.status.StatusChecker;
 import ch.qos.logback.core.status.WarnStatus;
 import org.slf4j.Marker;
@@ -175,34 +177,35 @@ public class ReconfigureOnChangeFilter extends TurboFilter {
       jc.setContext(context);
       StatusChecker statusChecker = new StatusChecker(context);
       List<SaxEvent> eventList = jc.recallSafeConfiguration();
-      lc.getStatusManager().add(
-              new InfoStatus("Resetting the logging ", this));
+      URL mainURL = ConfigurationWatchListUtil.getMainWatchURL(context);
       lc.reset();
-
+      long threshold = System.currentTimeMillis();
       try {
         jc.doConfigure(mainConfigurationURL);
+        if (statusChecker.hasXMLParsingErrors(threshold)) {
+          fallbackConfiguration(lc, eventList, mainURL);
+        }
       } catch (JoranException e) {
-        fallbackConfiguration(lc, eventList);
+        fallbackConfiguration(lc, eventList, mainURL);
       }
     }
 
-    private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList) {
-      JoranConfigurator jc = new JoranConfigurator();
-      jc.setContext(context);
+    private void fallbackConfiguration(LoggerContext lc, List<SaxEvent> eventList, URL mainURL) {
+      JoranConfigurator joranConfigurator = new JoranConfigurator();
+      joranConfigurator.setContext(context);
       if (eventList != null) {
-        lc.getStatusManager().add(
-                new WarnStatus("Falling back to previously registered safe configuration.", this));
+        addWarn("Falling back to previously registered safe configuration.");
         try {
-          jc.doConfigure(eventList);
-          addInfo("Re-registering previous fallback configuration as a fallback point");
-          jc.registerSafeConfiguration();
+          lc.reset();
+          joranConfigurator.informContextOfURLUsedForConfiguration(context, mainURL);
+          joranConfigurator.doConfigure(eventList);
+          addInfo("Re-registering previous fallback configuration once more as a fallback configuration point");
+          joranConfigurator.registerSafeConfiguration();
         } catch (JoranException e) {
-          addError("Unexpected exception thrown by configuration considered as safes", e);
+          addError("Unexpected exception thrown by a configuration considered safe.", e);
         }
       } else {
-        lc.getStatusManager().add(
-                new WarnStatus("No previous configuration to fall back to.", this));
-
+        addWarn("No previous configuration to fall back to.");
       }
     }
   }
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
index 6def1ae..6004966 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/turbo/ReconfigureOnChangeTest.java
@@ -44,13 +44,14 @@ import ch.qos.logback.core.status.InfoStatus;
 import ch.qos.logback.core.status.StatusChecker;
 import ch.qos.logback.core.testUtil.Env;
 import ch.qos.logback.core.util.StatusPrinter;
+import sun.org.mozilla.javascript.internal.Context;
 
 public class ReconfigureOnChangeTest {
   final static int THREAD_COUNT = 5;
   final static int LOOP_LEN = 1000 * 1000;
 
-  static final boolean  MUST_BE_ERROR_FREE = true;
-  static final boolean  ERRORS_EXPECTED = false;
+  static final boolean MUST_BE_ERROR_FREE = true;
+  static final boolean ERRORS_EXPECTED = false;
 
 
   int diff = RandomUtil.getPositiveInt();
@@ -69,12 +70,18 @@ public class ReconfigureOnChangeTest {
   final static String INCLUSION_SCAN_TOPLEVEL0_AS_STR = ClassicTestConstants.INPUT_PREFIX
           + "turbo/inclusion/topLevel0.xml";
 
+  final static String INCLUSION_SCAN_TOPLEVEL2_AS_STR = ClassicTestConstants.INPUT_PREFIX
+          + "turbo/inclusion/topLevel2.xml";
+
   final static String INCLUSION_SCAN_TOP_BY_RESOURCE_AS_STR = ClassicTestConstants.INPUT_PREFIX
           + "turbo/inclusion/topByResource.xml";
 
 
   final static String INCLUSION_SCAN_INNER0_AS_STR = ClassicTestConstants.INPUT_PREFIX
           + "turbo/inclusion/inner0.xml";
+  final static String INCLUSION_SCAN_INNER2_AS_STR = ClassicTestConstants.INPUT_PREFIX
+          + "turbo/inclusion/inner2.xml";
+
 
   final static String INCLUSION_SCAN_INNER1_AS_STR = "target/test-classes/asResource/inner1.xml";
 
@@ -148,27 +155,32 @@ public class ReconfigureOnChangeTest {
             new InfoStatus("end of execution ", this));
 
     long expectedReconfigurations = runnableArray[0].getCounter();
-    if(forcedReconfigurationSkip)
+    if (forcedReconfigurationSkip)
       expectedReconfigurations = 0;
 
     verify(expectedReconfigurations, mustBeErrorFree);
   }
 
   // chose a test at random. These tests are rather long...
-    // check for deadlocks
+  // check for deadlocks
   @Test(timeout = 20000)
-  public void randomTest()  throws JoranException, IOException, InterruptedException {
+  public void randomTest() throws JoranException, IOException, InterruptedException {
     Random rand = new Random(System.currentTimeMillis());
-    switch(rand.nextInt(5)) {
-      case 0: scan1();
+    switch (rand.nextInt(5)) {
+      case 0:
+        scan1();
         break;
-      case 1: scanWithFileInclusion();
+      case 1:
+        scanWithFileInclusion();
         break;
-      case 2: scanWithResourceInclusion();
+      case 2:
+        scanWithResourceInclusion();
         break;
-      case 3: scan_lbclassic154();
+      case 3:
+        scan_lbclassic154();
         break;
-      case 4: gscan1();
+      case 4:
+        gscan1();
         break;
     }
   }
@@ -208,13 +220,26 @@ public class ReconfigureOnChangeTest {
 
   @Test
   public void fallbackToSafe() throws IOException, JoranException, InterruptedException {
-    String path = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig-"+diff + ".xml";
+    String path = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig_fallbackToSafe-" + diff + ".xml";
     File file = new File(path);
     writeToFile(file, "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><root level=\"ERROR\"/></configuration> ");
     configure(file);
     doScanTest(file, UpdateType.MALFORMED, false, ERRORS_EXPECTED);
   }
 
+  @Test
+  public void fallbackToSafeWithIncludedFile() throws IOException, JoranException, InterruptedException {
+    String topLevelFileAsStr = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig_top-" + diff + ".xml";
+    String innerFileAsStr = CoreTestConstants.OUTPUT_DIR_PREFIX + "reconfigureOnChangeConfig_inner-" + diff + ".xml";
+    File topLevelFile = new File(topLevelFileAsStr);
+    writeToFile(topLevelFile, "<configuration scan=\"true\" scanPeriod=\"50 millisecond\"><include file=\""+innerFileAsStr+"\"/></configuration> ");
+
+    File innerFile = new File(innerFileAsStr);
+    writeToFile(innerFile, "<included><root level=\"ERROR\"/></included> ");
+    configure(topLevelFile);
+    doScanTest(innerFile, UpdateType.MALFORMED_INNER, false, ERRORS_EXPECTED);
+  }
+
 
   @Test
   public void gscan1() throws JoranException, IOException, InterruptedException {
@@ -248,12 +273,10 @@ public class ReconfigureOnChangeTest {
   }
 
 
-
-
   void verify(long expectedReconfigurations, boolean errorFreeness) {
     StatusChecker checker = new StatusChecker(loggerContext);
     StatusPrinter.print(loggerContext);
-    if(errorFreeness == MUST_BE_ERROR_FREE) {
+    if (errorFreeness == MUST_BE_ERROR_FREE) {
       assertTrue(checker.isErrorFree(0));
     } else {
       assertFalse(checker.isErrorFree(0));
@@ -262,9 +285,9 @@ public class ReconfigureOnChangeTest {
             .matchCount("Will reset and reconfigure context");
     // the number of effective resets must be equal or less than
     // expectedReconfigurations
-    System.out.println("effectiveResets="+effectiveResets);
+    System.out.println("effectiveResets=" + effectiveResets);
 
-    System.out.println("expectedReconfigurations="+expectedReconfigurations);
+    System.out.println("expectedReconfigurations=" + expectedReconfigurations);
     assertTrue(effectiveResets <= expectedReconfigurations);
 
     // however, there should be some effective resets
@@ -351,7 +374,7 @@ public class ReconfigureOnChangeTest {
     return (end - start) / (1.0d * LOOP_LEN);
   }
 
-  enum UpdateType {TOUCH, MALFORMED}
+  enum UpdateType {TOUCH, MALFORMED, MALFORMED_INNER}
 
   void writeToFile(File file, String contents) {
     try {
@@ -387,11 +410,15 @@ public class ReconfigureOnChangeTest {
         }
         counter++;
         ReconfigureOnChangeTest.this.addInfo("***settting last modified", this);
-        switch(updateType) {
-          case TOUCH: updateFile();
+        switch (updateType) {
+          case TOUCH:
+            touchFile();
             break;
           case MALFORMED:
             malformedUpdate(counter);
+            break;
+          case MALFORMED_INNER:
+            malformedInnerUpdate(counter);
         }
       }
     }
@@ -401,11 +428,17 @@ public class ReconfigureOnChangeTest {
               "  <root level=\"ERROR\">\n" +
               "</configuration>");
     }
-    void updateFile() {
+
+    private void malformedInnerUpdate(long counter) {
+      writeToFile(configFile, "<included>\n" +
+              "  <root>\n" +
+              "</included>");
+    }
+
+    void touchFile() {
       configFile.setLastModified(System.currentTimeMillis());
     }
   }
 
 
-
 }
diff --git a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
index ef1afb8..34b2c5d 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/CoreConstants.java
@@ -115,6 +115,9 @@ public class CoreConstants {
   static public final String CONFIGURATION_WATCH_LIST_RESET = "CONFIGURATION_WATCH_LIST_RESET";
 
   static public final String SAFE_JORAN_CONFIGURATION = "SAFE_JORAN_CONFIGURATION";
+  static public final String XML_PARSING = "XML_PARSING";
+
+
 
   /**
    * The key under which the local host name is registered in the logger
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
index d52c529..75a2014 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/GenericConfigurator.java
@@ -23,7 +23,9 @@ import java.util.List;
 
 import static ch.qos.logback.core.CoreConstants.SAFE_JORAN_CONFIGURATION;
 
+import ch.qos.logback.core.Context;
 import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
+import ch.qos.logback.core.status.StatusChecker;
 import org.xml.sax.InputSource;
 
 import ch.qos.logback.core.joran.event.SaxEvent;
@@ -44,7 +46,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
 
   final public void doConfigure(URL url) throws JoranException {
     try {
-      informContextOfURLUsedForConfiguration(url);
+      informContextOfURLUsedForConfiguration(getContext(), url);
       URLConnection urlConnection = url.openConnection();
       // per http://jira.qos.ch/browse/LBCORE-105
       // per http://jira.qos.ch/browse/LBCORE-127
@@ -67,7 +69,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
   final public void doConfigure(File file) throws JoranException {
     FileInputStream fis = null;
     try {
-      informContextOfURLUsedForConfiguration(file.toURI().toURL());
+      informContextOfURLUsedForConfiguration(getContext(), file.toURI().toURL());
       fis = new FileInputStream(file);
       doConfigure(fis);
     } catch (IOException ioe) {
@@ -87,7 +89,7 @@ public abstract class GenericConfigurator extends ContextAwareBase {
     }
   }
 
-  protected void informContextOfURLUsedForConfiguration(URL url) {
+  static public void informContextOfURLUsedForConfiguration(Context context, URL url) {
     ConfigurationWatchListUtil.setMainWatchURL(context, url);
   }
 
@@ -122,16 +124,20 @@ public abstract class GenericConfigurator extends ContextAwareBase {
   final public void doConfigure(final InputSource inputSource)
           throws JoranException {
 
+    long threshold = System.currentTimeMillis();
     if (!ConfigurationWatchListUtil.wasConfigurationWatchListReset(context)) {
-      informContextOfURLUsedForConfiguration(null);
+      informContextOfURLUsedForConfiguration(getContext(), null);
     }
     SaxEventRecorder recorder = new SaxEventRecorder();
     recorder.setContext(context);
     recorder.recordEvents(inputSource);
     doConfigure(recorder.saxEventList);
     // no exceptions a this level
-    addInfo("Registering current configuration as safe fallback point");
-    registerSafeConfiguration();
+    StatusChecker statusChecker = new StatusChecker(context);
+    if(statusChecker.noXMLParsingErrorsOccurred(threshold)) {
+      addInfo("Registering current configuration as safe fallback point");
+      registerSafeConfiguration();
+    }
   }
 
   public void doConfigure(final List<SaxEvent> eventList)
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java b/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
index 286e2d2..275d981 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/action/IncludeAction.java
@@ -59,17 +59,18 @@ public class IncludeAction extends Action {
     try {
       if (in != null) {
         parseAndRecord(in, recorder);
+        // remove the <included> tag from the beginning and </included> from the end
+        trimHeadAndTail(recorder);
+
+        // offset = 2, because we need to get past this element as well as the end element
+        ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2);
       }
     } catch (JoranException e) {
       addError("Error while parsing  " + attributeInUse, e);
     } finally {
       close(in);
     }
-    // remove the <included> tag from the beginning and </included> from the end
-    trimHeadAndTail(recorder);
 
-    // offset = 2, because we need to get past this element as well as the end element
-    ec.getJoranInterpreter().getEventPlayer().addEventsDynamically(recorder.saxEventList, 2);
   }
 
   void close(InputStream in) {
@@ -197,7 +198,7 @@ public class IncludeAction extends Action {
 
   InputStream getInputStream(InterpretationContext ec, Attributes attributes) {
     URL inputURL = getInputURL(ec, attributes);
-    if(inputURL == null)
+    if (inputURL == null)
       return null;
 
     ConfigurationWatchListUtil.addToWatchList(context, inputURL);
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
index 2e815e2..45bb694 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/event/SaxEventRecorder.java
@@ -21,7 +21,7 @@ import java.util.List;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
-import ch.qos.logback.core.CoreConstants;
+import static ch.qos.logback.core.CoreConstants.XML_PARSING;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.Locator;
@@ -150,17 +150,17 @@ public class SaxEventRecorder extends DefaultHandler implements ContextAware {
   }
 
   public void error(SAXParseException spe) throws SAXException {
-    addError("Parsing error on line " + spe.getLineNumber() + " and column "
+    addError(XML_PARSING +" - Parsing error on line " + spe.getLineNumber() + " and column "
         + spe.getColumnNumber(), spe);
   }
 
   public void fatalError(SAXParseException spe) throws SAXException {
-    addError("Parsing fatal error on line " + spe.getLineNumber()
+    addError(XML_PARSING +" - Parsing fatal error on line " + spe.getLineNumber()
         + " and column " + spe.getColumnNumber(), spe);
   }
 
   public void warning(SAXParseException spe) throws SAXException {
-    addWarn("Parsing warning on line " + spe.getLineNumber() + " and column "
+    addWarn(XML_PARSING +" - Parsing warning on line " + spe.getLineNumber() + " and column "
         + spe.getColumnNumber(), spe);
   }
 
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
index 3197407..aa52afb 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/spi/EventPlayer.java
@@ -40,8 +40,8 @@ public class EventPlayer {
     return new ArrayList<SaxEvent>(eventList);
   }
 
-  public void play(List<SaxEvent> seList) {
-    eventList = seList;
+  public void play(List<SaxEvent> aSaxEventList) {
+    eventList = aSaxEventList;
     SaxEvent se;
     for(currentIndex = 0; currentIndex < eventList.size(); currentIndex++) {
       se = eventList.get(currentIndex);
diff --git a/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java b/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java
index 6e61408..f2b0c53 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/joran/util/ConfigurationWatchListUtil.java
@@ -50,6 +50,15 @@ public class ConfigurationWatchListUtil {
     cwl.setMainURL(url);
   }
 
+  public static URL getMainWatchURL(Context context) {
+    ConfigurationWatchList cwl = getConfigurationWatchList(context);
+    if (cwl == null) {
+      return null;
+    } else {
+      return cwl.getMainURL();
+    }
+  }
+
   public static void addToWatchList(Context context, URL url) {
     ConfigurationWatchList cwl = getConfigurationWatchList(context);
     if (cwl == null) {
@@ -62,12 +71,13 @@ public class ConfigurationWatchListUtil {
 
   public static boolean wasConfigurationWatchListReset(Context context) {
     Object o = context.getObject(CoreConstants.CONFIGURATION_WATCH_LIST_RESET);
-    if(o == null)
+    if (o == null)
       return false;
     else {
       return ((Boolean) o).booleanValue();
     }
   }
+
   public static void setConfigurationWatchListResetFlag(Context context, boolean val) {
     context.putObject(CoreConstants.CONFIGURATION_WATCH_LIST_RESET, new Boolean(val));
   }
diff --git a/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
index ff82f46..cf12305 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/status/StatusChecker.java
@@ -43,6 +43,13 @@ public class StatusChecker {
     return filteredList;
   }
 
+  public boolean hasXMLParsingErrors(long threshold) {
+    return containsMatch(threshold, Status.ERROR, CoreConstants.XML_PARSING);
+  }
+  public boolean noXMLParsingErrorsOccurred(long threshold) {
+    return !hasXMLParsingErrors(threshold);
+  }
+
   public int getHighestLevel(long threshold) {
     List<Status> filteredList = filterStatusListByTimeThreshold(sm.getCopyOfStatusList(), threshold);
     int maxLevel = Status.INFO;
@@ -57,10 +64,11 @@ public class StatusChecker {
     return Status.ERROR > getHighestLevel(threshold);
   }
 
-  public boolean containsMatch(int level, String regex) {
+  public boolean containsMatch(long threshold, int level, String regex) {
+    List<Status> filteredList = filterStatusListByTimeThreshold(sm.getCopyOfStatusList(), threshold);
     Pattern p = Pattern.compile(regex);
 
-    for (Status status : sm.getCopyOfStatusList()) {
+    for (Status status : filteredList) {
       if (level != status.getLevel()) {
         continue;
       }
@@ -74,6 +82,10 @@ public class StatusChecker {
 
   }
 
+  public boolean containsMatch(int level, String regex) {
+    return containsMatch(0, level, regex);
+  }
+
   public boolean containsMatch(String regex) {
     Pattern p = Pattern.compile(regex);
     for (Status status : sm.getCopyOfStatusList()) {
diff --git a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
index 236e01a..3697c58 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/joran/TrivialConfiguratorTest.java
@@ -64,7 +64,7 @@ public class TrivialConfiguratorTest {
     int oldBeginCount = IncAction.beginCount;
     int oldEndCount = IncAction.endCount;
     int oldErrorCount = IncAction.errorCount;
-    doTest(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/"+"inc.xml");
+    doTest(CoreTestConstants.TEST_DIR_PREFIX + "input/joran/" + "inc.xml");
     assertEquals(oldErrorCount, IncAction.errorCount);
     assertEquals(oldBeginCount + 1, IncAction.beginCount);
     assertEquals(oldEndCount + 1, IncAction.endCount);
@@ -85,7 +85,7 @@ public class TrivialConfiguratorTest {
             tsl.list.size() >= 1);
     Status s0 = tsl.list.get(0);
     assertTrue(s0.getMessage().startsWith("Could not open ["));
- }
+  }
 
   @Test
   public void illFormedXML() {
@@ -98,8 +98,7 @@ public class TrivialConfiguratorTest {
     }
     assertEquals(1, tsl.list.size());
     Status s0 = tsl.list.get(0);
-    assertTrue(s0.getMessage().startsWith(
-            "Parsing fatal error on line 5 and column 3"));
+    assertTrue(s0.getMessage().startsWith(CoreConstants.XML_PARSING));
   }
 
   @Test

-----------------------------------------------------------------------

Summary of changes:
 .../classic/turbo/ReconfigureOnChangeFilter.java   |   35 +++++----
 .../classic/turbo/ReconfigureOnChangeTest.java     |   77 ++++++++++++++------
 .../java/ch/qos/logback/core/CoreConstants.java    |    3 +
 .../logback/core/joran/GenericConfigurator.java    |   18 +++--
 .../logback/core/joran/action/IncludeAction.java   |   11 ++--
 .../logback/core/joran/event/SaxEventRecorder.java |    8 +-
 .../ch/qos/logback/core/joran/spi/EventPlayer.java |    4 +-
 .../joran/util/ConfigurationWatchListUtil.java     |   12 +++-
 .../ch/qos/logback/core/status/StatusChecker.java  |   16 ++++-
 .../core/joran/TrivialConfiguratorTest.java        |    7 +-
 10 files changed, 129 insertions(+), 62 deletions(-)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list