ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r411724 - /ant/core/trunk/src/testcases/org/apache/tools/ant/filters/
Date Mon, 05 Jun 2006 09:26:13 GMT
Author: kevj
Date: Mon Jun  5 02:26:12 2006
New Revision: 411724

URL: http://svn.apache.org/viewvc?rev=411724&view=rev
Log:
use fileutils.resolveFile

Modified:
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/EscapeUnicodeTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/HeadTailTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/LineContainsTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ReplaceTokensTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/StripJavaCommentsTest.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ConcatFilterTest.java Mon Jun
 5 02:26:12 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2003-2005 The Apache Software Foundation
+ * Copyright  2003-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -80,8 +80,8 @@
 
     public void testFilterReaderNoArgs() throws IOException {
         executeTarget("testFilterReaderNoArgs");
-        File expected = getProject().resolveFile("input/concatfilter.test");
-        File result = getProject().resolveFile("result/concat.FilterReaderNoArgs.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"input/concatfilter.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(), "result/concat.FilterReaderNoArgs.test");
         assertTrue("testFilterReaderNoArgs: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
@@ -140,7 +140,7 @@
     protected String read(String filename) {
         String content = null;
         try {
-            File file = getProject().resolveFile(filename);
+            File file = FILE_UTILS.resolveFile(getProject().getBaseDir(), filename);
             java.io.FileReader rdr = new java.io.FileReader(file);
             content = FileUtils.readFully(rdr);
             rdr.close();

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/DynamicFilterTest.java Mon Jun
 5 02:26:12 2006
@@ -28,6 +28,8 @@
  */
 public class DynamicFilterTest extends BuildFileTest {
 
+    private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+    
     public DynamicFilterTest(String name) {
         super(name);
     }
@@ -54,7 +56,7 @@
     {
         Reader r = null;
         try {
-            r = new FileReader(getProject().resolveFile(filename));
+            r = new FileReader(FILE_UTILS.resolveFile(getProject().getBaseDir(), filename));
             return  FileUtils.readFully(r);
         }
         finally {

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/EscapeUnicodeTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/EscapeUnicodeTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/EscapeUnicodeTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/EscapeUnicodeTest.java Mon Jun
 5 02:26:12 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2003-2005 The Apache Software Foundation
+ * Copyright  2003-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@
 
     public void testEscapeUnicode() throws IOException {
         executeTarget("testEscapeUnicode");
-        File expected = getProject().resolveFile("expected/escapeunicode.test");
-        File result = getProject().resolveFile("result/escapeunicode.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(), "expected/escapeunicode.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(), "result/escapeunicode.test");
         assertTrue(FILE_UTILS.contentEquals(expected, result));
     }
 

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/HeadTailTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/HeadTailTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/HeadTailTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/HeadTailTest.java Mon Jun  5
02:26:12 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2003-2005 The Apache Software Foundation
+ * Copyright  2003-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -46,37 +46,37 @@
 
     public void testHead() throws IOException {
         executeTarget("testHead");
-        File expected = getProject().resolveFile("expected/head-tail.head.test");
-        File result = getProject().resolveFile("result/head-tail.head.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(), "expected/head-tail.head.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(), "result/head-tail.head.test");
         assertTrue("testHead: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testHeadLines() throws IOException {
         executeTarget("testHeadLines");
-        File expected = getProject().resolveFile("expected/head-tail.headLines.test");
-        File result = getProject().resolveFile("result/head-tail.headLines.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(), "expected/head-tail.headLines.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(), "result/head-tail.headLines.test");
         assertTrue("testHeadLines: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testHeadSkip() throws IOException {
         executeTarget("testHeadSkip");
-        File expected = getProject().resolveFile("expected/head-tail.headSkip.test");
-        File result = getProject().resolveFile("result/head-tail.headSkip.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.headSkip.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.headSkip.test");
         assertTrue("testHeadSkip: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testHeadLinesSkip() throws IOException {
         executeTarget("testHeadLinesSkip");
-        File expected = getProject().resolveFile("expected/head-tail.headLinesSkip.test");
-        File result = getProject().resolveFile("result/head-tail.headLinesSkip.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.headLinesSkip.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.headLinesSkip.test");
         assertTrue("testHeadLinesSkip: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testFilterReaderHeadLinesSkip() throws IOException {
         executeTarget("testFilterReaderHeadLinesSkip");
-        File expected = getProject().resolveFile(
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),
             "expected/head-tail.headLinesSkip.test");
-        File result = getProject().resolveFile(
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),
             "result/head-tail.filterReaderHeadLinesSkip.test");
         assertTrue("testFilterReaderHeadLinesSkip: Result not like expected",
                    FILE_UTILS.contentEquals(expected, result));
@@ -84,37 +84,37 @@
 
     public void testTail() throws IOException {
         executeTarget("testTail");
-        File expected = getProject().resolveFile("expected/head-tail.tail.test");
-        File result = getProject().resolveFile("result/head-tail.tail.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tail.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tail.test");
         assertTrue("testTail: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testTailLines() throws IOException {
         executeTarget("testTailLines");
-        File expected = getProject().resolveFile("expected/head-tail.tailLines.test");
-        File result = getProject().resolveFile("result/head-tail.tailLines.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tailLines.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tailLines.test");
         assertTrue("testTailLines: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testTailSkip() throws IOException {
         executeTarget("testTailSkip");
-        File expected = getProject().resolveFile("expected/head-tail.tailSkip.test");
-        File result = getProject().resolveFile("result/head-tail.tailSkip.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tailSkip.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tailSkip.test");
         assertTrue("testTailSkip: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testTailLinesSkip() throws IOException {
         executeTarget("testTailLinesSkip");
-        File expected = getProject().resolveFile("expected/head-tail.tailLinesSkip.test");
-        File result = getProject().resolveFile("result/head-tail.tailLinesSkip.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.tailLinesSkip.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.tailLinesSkip.test");
         assertTrue("testTailLinesSkip: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 
     public void testFilterReaderTailLinesSkip() throws IOException {
         executeTarget("testFilterReaderTailLinesSkip");
-        File expected = getProject().resolveFile(
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),
             "expected/head-tail.tailLinesSkip.test");
-        File result = getProject().resolveFile(
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),
             "result/head-tail.filterReaderTailLinesSkip.test");
         assertTrue("testFilterReaderTailLinesSkip: Result not like expected",
                    FILE_UTILS.contentEquals(expected, result));
@@ -122,8 +122,8 @@
 
     public void testHeadTail() throws IOException {
         executeTarget("testHeadTail");
-        File expected = getProject().resolveFile("expected/head-tail.headtail.test");
-        File result = getProject().resolveFile("result/head-tail.headtail.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/head-tail.headtail.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/head-tail.headtail.test");
         assertTrue("testHeadTail: Result not like expected", FILE_UTILS.contentEquals(expected,
result));
     }
 

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/LineContainsTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/LineContainsTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/LineContainsTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/LineContainsTest.java Mon Jun
 5 02:26:12 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2002-2005 The Apache Software Foundation
+ * Copyright  2002-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@
 
     public void testLineContains() throws IOException {
         executeTarget("testLineContains");
-        File expected = getProject().resolveFile("expected/linecontains.test");
-        File result = getProject().resolveFile("result/linecontains.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/linecontains.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/linecontains.test");
         assertTrue(FILE_UTILS.contentEquals(expected, result));
     }
 

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ReplaceTokensTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ReplaceTokensTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ReplaceTokensTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/ReplaceTokensTest.java Mon Jun
 5 02:26:12 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2003-2005 The Apache Software Foundation
+ * Copyright  2003-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@
 
     public void testReplaceTokens() throws IOException {
         executeTarget("testReplaceTokens");
-        File expected = getProject().resolveFile("expected/replacetokens.test");
-        File result = getProject().resolveFile("result/replacetokens.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/replacetokens.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/replacetokens.test");
         assertTrue(FILE_UTILS.contentEquals(expected, result));
     }
 

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/StripJavaCommentsTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/StripJavaCommentsTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/StripJavaCommentsTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/StripJavaCommentsTest.java Mon
Jun  5 02:26:12 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2003-2005 The Apache Software Foundation
+ * Copyright  2003-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -43,8 +43,8 @@
 
     public void testStripJavaComments() throws IOException {
         executeTarget("testStripJavaComments");
-        File expected = getProject().resolveFile("expected/stripjavacomments.test");
-        File result = getProject().resolveFile("result/stripjavacomments.test");
+        File expected = FILE_UTILS.resolveFile(getProject().getBaseDir(),"expected/stripjavacomments.test");
+        File result = FILE_UTILS.resolveFile(getProject().getBaseDir(),"result/stripjavacomments.test");
         assertTrue(FILE_UTILS.contentEquals(expected, result));
     }
 

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java?rev=411724&r1=411723&r2=411724&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/filters/TokenFilterTest.java Mon Jun
 5 02:26:12 2006
@@ -28,6 +28,8 @@
  */
 public class TokenFilterTest extends BuildFileTest {
 
+    private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();
+    
     public TokenFilterTest(String name) {
         super(name);
     }
@@ -246,7 +248,7 @@
     {
         Reader r = null;
         try {
-            r = new FileReader(getProject().resolveFile(filename));
+            r = new FileReader(FILE_UTILS.resolveFile(getProject().getBaseDir(),filename));
             return  FileUtils.readFully(r);
         }
         finally {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message