[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch master updated. v_0.9.30-51-gf643e92

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Wed Oct 26 14:17:39 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  f643e9250ee389fd8b3e29672392534e2e822a26 (commit)
      from  8f6d5349ae6d3286726a74188512f249ea352866 (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=f643e9250ee389fd8b3e29672392534e2e822a26
http://github.com/ceki/logback/commit/f643e9250ee389fd8b3e29672392534e2e822a26

commit f643e9250ee389fd8b3e29672392534e2e822a26
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Oct 26 14:17:20 2011 +0200

    minor changes to make the build always successful

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java b/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java
index 765a107..1696123 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java
@@ -48,8 +48,6 @@ public final class Logger implements org.slf4j.Logger, LocationAwareLogger,
   public static final String FQCN = ch.qos.logback.classic.Logger.class
       .getName();
 
-  static int instanceCount = 0;
-
   /**
    * The name of this logger
    */
@@ -114,7 +112,6 @@ public final class Logger implements org.slf4j.Logger, LocationAwareLogger,
     this.parent = parent;
     this.loggerContext = loggerContext;
     buildRemoteView();
-    instanceCount++;
   }
 
   public final Level getEffectiveLevel() {
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/LoggerContextTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/LoggerContextTest.java
index a305ac3..5ded56a 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/LoggerContextTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/LoggerContextTest.java
@@ -32,7 +32,6 @@ public class LoggerContextTest {
 
   @Before
   public void setUp() throws Exception {
-    Logger.instanceCount = 0;
     lc = new LoggerContext();
     lc.setName("x");
   }
@@ -76,42 +75,47 @@ public class LoggerContextTest {
     // assertNull(dot.parent.parent.parent);
     LoggerTestHelper.assertLevels(null, dot, Level.DEBUG);
 
-    assertEquals(3, Logger.instanceCount);
+
+    assertEquals(3, lc.getLoggerList().size());
   }
 
   @Test
   public void testDotDot() {
     Logger dotdot = lc.getLogger("..");
-    assertEquals(4, Logger.instanceCount);
+    assertEquals(4, lc.getLoggerList().size());
     LoggerTestHelper.assertNameEquals(dotdot, "..");
     // LoggerTestHelper.assertNameEquals(dotdot.parent, ".");
     // LoggerTestHelper.assertNameEquals(dotdot.parent.parent, "");
     // LoggerTestHelper.assertNameEquals(dotdot.parent.parent.parent, "root");
   }
 
+  int instanceCount() {
+    return lc.getLoggerList().size();
+  }
+
   @Test
   public void testLoggerXY() {
-    assertEquals(1, Logger.instanceCount);
+    assertEquals(1, lc.getLoggerList().size());
 
     Logger xy = lc.getLogger("x.y");
-    assertEquals(3, Logger.instanceCount);
+    assertEquals(3, instanceCount());
     LoggerTestHelper.assertNameEquals(xy, "x.y");
     LoggerTestHelper.assertLevels(null, xy, Level.DEBUG);
 
     Logger x = lc.getLogger("x");
-    assertEquals(3, Logger.instanceCount);
+    assertEquals(3, instanceCount());
 
     Logger xy2 = lc.getLogger("x.y");
     assertEquals(xy, xy2);
 
     Logger x2 = lc.getLogger("x");
     assertEquals(x, x2);
-    assertEquals(3, Logger.instanceCount);
+    assertEquals(3, instanceCount());
   }
 
   @Test
   public void testLoggerMultipleChildren() {
-    assertEquals(1, Logger.instanceCount);
+    assertEquals(1, instanceCount());
     Logger xy0 = lc.getLogger("x.y0");
     LoggerTestHelper.assertNameEquals(xy0, "x.y0");
 
@@ -120,14 +124,14 @@ public class LoggerContextTest {
 
     LoggerTestHelper.assertLevels(null, xy0, Level.DEBUG);
     LoggerTestHelper.assertLevels(null, xy1, Level.DEBUG);
-    assertEquals(4, Logger.instanceCount);
+    assertEquals(4, instanceCount());
 
     for (int i = 0; i < 100; i++) {
       Logger xy_i = lc.getLogger("x.y" + i);
       LoggerTestHelper.assertNameEquals(xy_i, "x.y" + i);
       LoggerTestHelper.assertLevels(null, xy_i, Level.DEBUG);
     }
-    assertEquals(102, Logger.instanceCount);
+    assertEquals(102, instanceCount());
   }
 
   @Test
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 df3ecd6..3884672 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
@@ -26,12 +26,10 @@ import ch.qos.logback.core.contention.AbstractMultiThreadedHarness;
 import ch.qos.logback.core.contention.MultiThreadedHarness;
 import ch.qos.logback.core.contention.WaitOnExecutionMultiThreadedHarness;
 import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
+import ch.qos.logback.core.testUtil.FileTestUtil;
 import ch.qos.logback.core.testUtil.RandomUtil;
 import ch.qos.logback.core.util.CoreTestConstants;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.*;
 import org.slf4j.helpers.BogoPerf;
 
 import ch.qos.logback.classic.ClassicTestConstants;
@@ -107,6 +105,11 @@ public class ReconfigureOnChangeTest {
 
   int expectedResets = 2;
 
+  @BeforeClass
+  static public void classSetup() {
+    FileTestUtil.makeTestOutputDir();
+  }
+
   @Before
   public void setUp() {
     harness = new WaitOnExecutionMultiThreadedHarness(executor, expectedResets);
diff --git a/logback-core/src/test/java/ch/qos/logback/core/testUtil/FileTestUtil.java b/logback-core/src/test/java/ch/qos/logback/core/testUtil/FileTestUtil.java
new file mode 100644
index 0000000..79c971e
--- /dev/null
+++ b/logback-core/src/test/java/ch/qos/logback/core/testUtil/FileTestUtil.java
@@ -0,0 +1,25 @@
+package ch.qos.logback.core.testUtil;
+
+import ch.qos.logback.core.CoreConstants;
+import ch.qos.logback.core.util.CoreTestConstants;
+
+import java.io.File;
+
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * @author Ceki Gücü
+ */
+public class FileTestUtil {
+
+  public static void makeTestOutputDir() {
+    File target = new File(CoreTestConstants.TARGET_DIR);
+    if(target.exists() && target.isDirectory()) {
+      File testoutput = new File(CoreTestConstants.OUTPUT_DIR_PREFIX);
+      if(!testoutput.exists())
+        assertTrue(testoutput.mkdir());
+    } else {
+      throw new IllegalStateException(CoreTestConstants.TARGET_DIR + " does not exist");
+    }
+  }
+}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/util/CoreTestConstants.java b/logback-core/src/test/java/ch/qos/logback/core/util/CoreTestConstants.java
index 93d3ad1..7066157 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/util/CoreTestConstants.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/util/CoreTestConstants.java
@@ -18,7 +18,9 @@ public class CoreTestConstants {
   public static final String TEST_DIR_PREFIX = "src/test/";
   public static final String JORAN_INPUT_PREFIX = TEST_DIR_PREFIX
       + "input/joran/";
-  public static final String OUTPUT_DIR_PREFIX = "target/test-output/";
+
+  public static final String TARGET_DIR = "target/";
+  public static final String OUTPUT_DIR_PREFIX = TARGET_DIR+"test-output/";
 
   public static final int SUCCESSFUL_EXIT_CODE = 8;
   public static final int FAILURE_EXIT_CODE = 1;

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

Summary of changes:
 .../main/java/ch/qos/logback/classic/Logger.java   |    3 --
 .../ch/qos/logback/classic/LoggerContextTest.java  |   24 +++++++++++--------
 .../classic/turbo/ReconfigureOnChangeTest.java     |   11 +++++---
 .../ch/qos/logback/core/testUtil/FileTestUtil.java |   25 ++++++++++++++++++++
 .../qos/logback/core/util/CoreTestConstants.java   |    4 ++-
 5 files changed, 49 insertions(+), 18 deletions(-)
 create mode 100644 logback-core/src/test/java/ch/qos/logback/core/testUtil/FileTestUtil.java


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


More information about the logback-dev mailing list