Repository: logging-log4j2 Updated Branches: refs/heads/master 1542ec121 -> 039dc6297
[LOG4J2-1123] Core Configurator.initialize(String, ClassLoader, String) fails to work when config location is a file path. Test Windows paths on Windows only. They fail on Linux (Jenkins). Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/039dc629 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/039dc629 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/039dc629 Branch: refs/heads/master Commit: 039dc629741c041e724eac399deb796856f16e9c Parents: 1542ec1 Author: ggregory <[email protected]> Authored: Fri Sep 18 09:10:45 2015 -0700 Committer: ggregory <[email protected]> Committed: Fri Sep 18 09:10:45 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/core/util/NetUtilsTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/039dc629/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java index 8702d1f..3dd1dc2 100644 --- a/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java +++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/util/NetUtilsTest.java @@ -23,10 +23,13 @@ import static org.junit.Assert.assertNotNull; import java.net.URI; import java.net.URISyntaxException; +import org.junit.Assume; import org.junit.Test; public class NetUtilsTest { + private static final boolean IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); + @Test public void testToUriWithoutBackslashes() throws URISyntaxException { final String config = "file:///path/to/something/on/unix"; @@ -37,7 +40,8 @@ public class NetUtilsTest { } @Test - public void testToUriWithBackslashes() throws URISyntaxException { + public void testToUriWindowsWithBackslashes() throws URISyntaxException { + Assume.assumeTrue(IS_WINDOWS); final String config = "file:///D:\\path\\to\\something/on/windows"; final URI uri = NetUtils.toURI(config); @@ -47,6 +51,7 @@ public class NetUtilsTest { @Test public void testToUriWindowsAbsolutePath() throws URISyntaxException { + Assume.assumeTrue(IS_WINDOWS); final String config = "D:\\path\\to\\something\\on\\windows"; final URI uri = NetUtils.toURI(config);
