ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r696178 - in /ant/ivy/core/branches/2.0.x: ./ src/java/org/apache/ivy/util/FileResolver.java test/java/org/apache/ivy/util/ConfiguratorTest.java
Date Wed, 17 Sep 2008 07:07:47 GMT
Author: xavier
Date: Wed Sep 17 00:07:47 2008
New Revision: 696178

URL: http://svn.apache.org/viewvc?rev=696178&view=rev
Log:
merge IVY-905 fix from trunk (696013:696031)

Modified:
    ant/ivy/core/branches/2.0.x/   (props changed)
    ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/FileResolver.java
    ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/ConfiguratorTest.java

Propchange: ant/ivy/core/branches/2.0.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 17 00:07:47 2008
@@ -1 +1 @@
-/ant/ivy/core/trunk:695737
+/ant/ivy/core/trunk:695737,696014-696031

Modified: ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/FileResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/FileResolver.java?rev=696178&r1=696177&r2=696178&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/FileResolver.java (original)
+++ ant/ivy/core/branches/2.0.x/src/java/org/apache/ivy/util/FileResolver.java Wed Sep 17
00:07:47 2008
@@ -22,7 +22,7 @@
 public interface FileResolver {
     public static final FileResolver DEFAULT = new FileResolver() {
         public File resolveFile(String path, String filename) {
-            return new File(filename);
+            return new File(path);
         }
     };
     

Modified: ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/ConfiguratorTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/ConfiguratorTest.java?rev=696178&r1=696177&r2=696178&view=diff
==============================================================================
--- ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/ConfiguratorTest.java (original)
+++ ant/ivy/core/branches/2.0.x/test/java/org/apache/ivy/util/ConfiguratorTest.java Wed Sep
17 00:07:47 2008
@@ -17,6 +17,7 @@
  */
 package org.apache.ivy.util;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -27,6 +28,19 @@
  *
  */
 public class ConfiguratorTest extends TestCase {
+    
+    public static class FileTester {
+        private File file;
+        
+        public void setFile(File file) {
+            this.file = file;
+        }
+        
+        public File getFile() {
+            return file;
+        }
+    }
+    
     public static class City {
         private List _housings = new ArrayList();
 
@@ -357,4 +371,15 @@
         assertEquals(20, ((Room) ((Housing) city.getHousings().get(1)).getRooms().get(2))
                 .getSurface());
     }
+    
+    public void testFileAttribute() {
+        FileTester root = new FileTester();
+        _conf.setRoot(root);
+        _conf.setAttribute("file", "path/to/file.txt");
+        
+        String filePath = root.getFile().getPath();
+        filePath = filePath.replace('\\', '/');
+        
+        assertEquals("path/to/file.txt", filePath);
+    }
 }



Mime
View raw message