ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r696031 - /ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java
Date Tue, 16 Sep 2008 19:56:48 GMT
Author: maartenc
Date: Tue Sep 16 12:56:48 2008
New Revision: 696031

URL: http://svn.apache.org/viewvc?rev=696031&view=rev
Log:
FIX: Cannot configure items with java.io.File attributes (IVY-905)

Modified:
    ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java?rev=696031&r1=696030&r2=696031&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/util/ConfiguratorTest.java Tue Sep 16 12:56:48
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