Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E46A6200D11 for ; Mon, 2 Oct 2017 12:08:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E30AE1609EF; Mon, 2 Oct 2017 10:08:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 35ED11609DE for ; Mon, 2 Oct 2017 12:08:53 +0200 (CEST) Received: (qmail 50881 invoked by uid 500); 2 Oct 2017 10:08:52 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 50872 invoked by uid 99); 2 Oct 2017 10:08:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2017 10:08:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2E1BFE2F42; Mon, 2 Oct 2017 10:08:52 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rgodfrey@apache.org To: commits@qpid.apache.org Message-Id: <596b11db34f34c5f896b4416b63a4b73@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-broker-j git commit: QPID-7942 : [Java Broker] AppenderUtilsTest does not work on Windows Address comments from [~gemmellr] Date: Mon, 2 Oct 2017 10:08:52 +0000 (UTC) archived-at: Mon, 02 Oct 2017 10:08:54 -0000 Repository: qpid-broker-j Updated Branches: refs/heads/master 97647160d -> af10b7e4b QPID-7942 : [Java Broker] AppenderUtilsTest does not work on Windows Address comments from [~gemmellr] 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/af10b7e4 Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/af10b7e4 Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/af10b7e4 Branch: refs/heads/master Commit: af10b7e4b57f058ab94a439e0a899fe7f1f6a3b2 Parents: 9764716 Author: Robert Godfrey Authored: Mon Oct 2 12:08:10 2017 +0200 Committer: Robert Godfrey Committed: Mon Oct 2 12:08:10 2017 +0200 ---------------------------------------------------------------------- .../server/logging/logback/AppenderUtilsTest.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/af10b7e4/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 e73fafd..aee727d 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 @@ -20,6 +20,7 @@ */ package org.apache.qpid.server.logging.logback; +import static org.junit.Assume.assumeTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -162,16 +163,14 @@ public class AppenderUtilsTest extends QpidTestCase Path unwriteableLogTargetPath = Files.createTempDirectory(getTestName()); File unwriteableLogTarget = unwriteableLogTargetPath.toFile(); - if(unwriteableLogTarget.setWritable(false)) + try { - try - { - doValidateLogTarget(new File(unwriteableLogTarget.getAbsolutePath(), "nonExistingFile.log")); - } - finally - { - unwriteableLogTarget.delete(); - } + assumeTrue(unwriteableLogTarget.setWritable(false)); + doValidateLogTarget(new File(unwriteableLogTarget.getAbsolutePath(), "nonExistingFile.log")); + } + finally + { + unwriteableLogTarget.delete(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org