[ 
https://issues.apache.org/jira/browse/FLUME-753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashish Paliwal resolved FLUME-753.
----------------------------------
       Resolution: Won't Fix
    Fix Version/s: v0.9.5

Won't fix. 0.X branch not maintained anymore

> TestFileUtil.testCreateTempFile() fails on Mac OS X due to "+" characters in 
> tmp file path.
> -------------------------------------------------------------------------------------------
>
>                 Key: FLUME-753
>                 URL: https://issues.apache.org/jira/browse/FLUME-753
>             Project: Flume
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: v0.9.4, v0.9.5
>         Environment: Mac OS X Snow Leopard
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
> Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)
>            Reporter: Frank Grimes
>            Priority: Trivial
>             Fix For: v0.9.5
>
>
> Should be fixed by escaping path using java.util.regex.Pattern.quote():
> diff --git a/flume-core/src/test/java/com/cloudera/util/TestFileUtil.java 
> b/flume-core/src/test/java/com/cloudera/util/TestFileUtil.java
> index 74062d6..be7390f 100644
> --- a/flume-core/src/test/java/com/cloudera/util/TestFileUtil.java
> +++ b/flume-core/src/test/java/com/cloudera/util/TestFileUtil.java
> @@ -19,6 +19,7 @@ package com.cloudera.util;
>  
>  import java.io.File;
>  import java.io.IOException;
> +import java.util.regex.Pattern;
>  
>  import junit.framework.TestCase;
>  
> @@ -34,7 +35,7 @@ public class TestFileUtil extends TestCase {
>    public void testCreateTempFile() throws IOException {
>      File f = FileUtil.createTempFile("foo", ".bar");
>      f.deleteOnExit();
> -    String matchPat = FileUtil.getBaseDir() + ".*foo.*\\.bar";
> +    String matchPat = Pattern.quote(FileUtil.getBaseDir().toString()) + 
> ".*foo.*\\.bar";
>      assertTrue(f.getAbsolutePath().matches(matchPat));
>    }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to