[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v0.9.18-27-ge19c774

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Fri Feb 12 18:41:06 CET 2010


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  e19c774ef368f0412a73acbff7892f50707057ba (commit)
       via  209d9073b02eee8eb35aeb6b2b893374a93511cf (commit)
      from  1b5bc6b3190a00aa9f137b445635e9dc9ced738e (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=e19c774ef368f0412a73acbff7892f50707057ba
http://github.com/ceki/logback/commit/e19c774ef368f0412a73acbff7892f50707057ba

commit e19c774ef368f0412a73acbff7892f50707057ba
Merge: 209d907 1b5bc6b
Author: Ceki Gulcu <ceki at gimmel.(none)>
Date:   Fri Feb 12 18:31:00 2010 +0100

    Merge branch 'master' of git at git.qos.ch:/logback


http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=209d9073b02eee8eb35aeb6b2b893374a93511cf
http://github.com/ceki/logback/commit/209d9073b02eee8eb35aeb6b2b893374a93511cf

commit 209d9073b02eee8eb35aeb6b2b893374a93511cf
Author: Ceki Gulcu <ceki at gimmel.(none)>
Date:   Fri Feb 12 18:28:10 2010 +0100

    - limit running FileAppenderResilienceTest on the host named "gimmel"
      which is specifically configured for this purpose.
    
      On other machines, it might cause the os ehem.. to lock.

diff --git a/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java b/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java
index 545489b..e58a758 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/FileAppenderResilienceTest.java
@@ -1,6 +1,6 @@
 package ch.qos.logback.core;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -15,6 +15,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 import ch.qos.logback.core.layout.EchoLayout;
+import ch.qos.logback.core.testUtil.Env;
 import ch.qos.logback.core.testUtil.RandomUtil;
 import ch.qos.logback.core.util.StatusPrinter;
 
@@ -24,7 +25,7 @@ public class FileAppenderResilienceTest {
 
   static String LONG_STR = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
 
-  static String PATH_LOOPFS_SCRIPT = "/home/ceki/logback/logback-core/src/test/loopfs.sh";
+  static String PATH_LOOPFS_SCRIPT = "/home/ceki/java/logback/logback-core/src/test/loopfs.sh";
 
   
   enum LoopFSCommand {
@@ -38,8 +39,15 @@ public class FileAppenderResilienceTest {
   
   FileAppender<Object> fa = new FileAppender<Object>();
 
+  static boolean isConformingHost() {
+    return Env.isLocalHostNameInList(new String[] {"gimmel"});
+  }
+  
   @Before
   public void setUp() throws IOException, InterruptedException {
+    if(!isConformingHost()) {
+      return;
+    }
     Process p = runLoopFSScript(LoopFSCommand.setup);
     p.waitFor();
 
@@ -76,6 +84,9 @@ public class FileAppenderResilienceTest {
   
   @After
   public void tearDown() throws IOException, InterruptedException {
+    if(!isConformingHost()) {
+      return;
+    }
     StatusPrinter.print(context);
     fa.stop();
     Process p = runLoopFSScript(LoopFSCommand.teardown);
@@ -89,6 +100,9 @@ public class FileAppenderResilienceTest {
 
   @Test
   public void go() throws IOException, InterruptedException {
+    if(!isConformingHost()) {
+      return;
+    }
     Process p = runLoopFSScript(LoopFSCommand.shake);
     for (int i = 0; i < NUM_STEPS; i++) {
       fa.append(String.valueOf(i) + LONG_STR);
@@ -103,6 +117,11 @@ public class FileAppenderResilienceTest {
   // it needs to be Unix, with sudo privileges granted to the script
   Process runLoopFSScript(LoopFSCommand cmd) throws IOException,
       InterruptedException {
+    // causing a NullPointerException is better than locking the whole
+    // machine which the next operation can and will do.
+    if(!isConformingHost()) {
+      return null;
+    }
     ProcessBuilder pb = new ProcessBuilder();
     pb.command("/usr/bin/sudo", PATH_LOOPFS_SCRIPT, cmd.toString());
     Process process = pb.start();

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

Summary of changes:
 .../logback/core/FileAppenderResilienceTest.java   |   23 ++++++++++++++++++-
 1 files changed, 21 insertions(+), 2 deletions(-)


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


More information about the logback-dev mailing list