qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject qpid-broker-j git commit: QPID-7942 : [Java Broker] AppenderUtilsTest does not work on Windows assumeThat does not work on old-style (JUnit 3) test cases
Date Mon, 02 Oct 2017 15:19:59 GMT
Repository: qpid-broker-j
Updated Branches:
  refs/heads/master b9409b6c6 -> 556fa10dc


QPID-7942 : [Java Broker] AppenderUtilsTest does not work on Windows
assumeThat does not work on old-style (JUnit 3) test cases


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/556fa10d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/556fa10d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/556fa10d

Branch: refs/heads/master
Commit: 556fa10dc7279c2d60d14362da90163d20fcdefa
Parents: b9409b6
Author: Rob Godfrey <rgodfrey@apache.org>
Authored: Mon Oct 2 17:16:43 2017 +0200
Committer: Rob Godfrey <rgodfrey@apache.org>
Committed: Mon Oct 2 17:19:47 2017 +0200

----------------------------------------------------------------------
 .../server/logging/logback/AppenderUtilsTest.java | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/556fa10d/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/AppenderUtilsTest.java
----------------------------------------------------------------------
diff --git a/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/AppenderUtilsTest.java
b/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/AppenderUtilsTest.java
index aee727d..2ad1ef5 100644
--- a/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/AppenderUtilsTest.java
+++ b/broker-plugins/logging-logback/src/test/java/org/apache/qpid/server/logging/logback/AppenderUtilsTest.java
@@ -38,12 +38,17 @@ import ch.qos.logback.core.rolling.RollingPolicy;
 import ch.qos.logback.core.rolling.TimeBasedRollingPolicy;
 import ch.qos.logback.core.rolling.TriggeringPolicy;
 import ch.qos.logback.core.rolling.helper.CompressionMode;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.qpid.server.configuration.IllegalConfigurationException;
 import org.apache.qpid.test.utils.QpidTestCase;
 
 public class AppenderUtilsTest extends QpidTestCase
 {
+    private static final Logger _logger = LoggerFactory.getLogger(AppenderUtilsTest.class);
+
     public static final String LAYOUT = "%d %-5p [%t] \\(%c{2}\\) # %m%n";
     public static final int MAX_FILE_SIZE = 101;
     public static final int MAX_HISTORY = 13;
@@ -143,14 +148,21 @@ public class AppenderUtilsTest extends QpidTestCase
         }
     }
 
-    public void testUnwritableLogFileTarget() throws Exception
+\    public void testUnwritableLogFileTarget() throws Exception
     {
         File unwriteableFile = File.createTempFile(getTestName(), null);
 
         try
         {
-            assertTrue("could not set log target permissions for test", unwriteableFile.setWritable(false));
-            doValidateLogTarget(unwriteableFile);
+            if(unwriteableFile.setWritable(false))
+            {
+                doValidateLogTarget(unwriteableFile);
+            }
+            else
+            {
+                _logger.warn("could not set permissions on temporary directory - test skipped");
+
+            }
         }
         finally
         {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message