commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r784346 - /commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java
Date Sat, 13 Jun 2009 07:48:08 GMT
Author: mturk
Date: Sat Jun 13 07:48:08 2009
New Revision: 784346

URL: http://svn.apache.org/viewvc?rev=784346&view=rev
Log:
Add setFileAttributes test

Modified:
    commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java

Modified: commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java?rev=784346&r1=784345&r2=784346&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java (original)
+++ commons/sandbox/runtime/trunk/src/test/org/apache/commons/runtime/TestFile.java Sat Jun
13 07:48:08 2009
@@ -215,5 +215,18 @@
         f.delete();
     }
 
+    public void testSetAttributes()
+        throws Exception
+    {
+        File f = new File("ffoo");
+        f.createNewFile();
+        EnumSet <FileProtection> fp = f.getFileProtection();
+        System.out.println("Org Attr Protection " + fp);
+        f.setFileAttributes(EnumSet.of(FileAttributes.READ), EnumSet.allOf(FileAttributes.class));
+        EnumSet <FileProtection> np = f.getFileProtection();
+        System.out.println("Set Attr Protection " + np);
+        assertFalse("GWRITE", np.contains(FileProtection.GWRITE));
+        f.delete();
+    }
 
 }



Mime
View raw message