Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9EEF10961 for ; Thu, 14 May 2015 13:59:48 +0000 (UTC) Received: (qmail 47639 invoked by uid 500); 14 May 2015 13:59:48 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 47594 invoked by uid 500); 14 May 2015 13:59:48 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 47571 invoked by uid 99); 14 May 2015 13:59:48 -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; Thu, 14 May 2015 13:59:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A3E41DFDDF; Thu, 14 May 2015 13:59:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Date: Thu, 14 May 2015 13:59:48 -0000 Message-Id: <2e8d690c8a2f402fa73f576cf324e852@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] activemq-artemis git commit: Fix FileConfigurationTest for Windows Repository: activemq-artemis Updated Branches: refs/heads/master efb9edbc6 -> 1eb52ce1f Fix FileConfigurationTest for Windows The test wrongly assumes that Class.getResource(..) needs to specify the System line-separator. The contract for the method dictates: "If the name begins with a '/' ('\u002f'), then the absolute name of the resource is the portion of the name following the '/'." Also, it manipulates File.getAbsolutePath() in a way that generates wrong URL for Windows. Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/031220b1 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/031220b1 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/031220b1 Branch: refs/heads/master Commit: 031220b1856c7d88648a2ff3ffdd4bd79406bbb8 Parents: efb9edb Author: Thiago Kronig Authored: Thu May 14 00:26:45 2015 -0300 Committer: Thiago Kronig Committed: Thu May 14 00:39:01 2015 -0300 ---------------------------------------------------------------------- .../artemis/core/config/impl/FileConfigurationTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/031220b1/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java ---------------------------------------------------------------------- diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java index 4a9ed43..07f8bd2 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/FileConfigurationTest.java @@ -372,13 +372,13 @@ public class FileConfigurationTest extends ConfigurationImplTest { // copy working configuration to a location where the standard classloader cannot find it - final Path workingConfiguration = new File(getClass().getResource(File.separator + fullConfigurationName).toURI()).toPath(); + final Path workingConfiguration = new File(getClass().getResource("/" + fullConfigurationName).toURI()).toPath(); final Path targetFile = customConfiguration.toPath(); Files.copy(workingConfiguration, targetFile, StandardCopyOption.REPLACE_EXISTING); // build a custom classloader knowing the location of the config created above (used as context class loader) - final URL customConfigurationDirUrl = new URL("file://" + customConfiguration.getParentFile().getAbsolutePath() + File.separator); + final URL customConfigurationDirUrl = customConfiguration.getParentFile().toURI().toURL(); final ClassLoader testWebappClassLoader = new URLClassLoader(new URL[]{customConfigurationDirUrl}); /* @@ -388,7 +388,7 @@ public class FileConfigurationTest extends ConfigurationImplTest final class ThrowableHolder { - public Exception t = null; + volatile Exception t; } final ThrowableHolder holder = new ThrowableHolder();