harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r607202 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
Date Fri, 28 Dec 2007 10:18:31 GMT
Author: pyang
Date: Fri Dec 28 02:18:30 2007
New Revision: 607202

URL: http://svn.apache.org/viewvc?rev=607202&view=rev
Log:
A trivial refactory in the WinFileTest, and also verify my new workstation's SVN client setup

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java?rev=607202&r1=607201&r2=607202&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/windows/org/apache/harmony/luni/tests/java/io/WinFileTest.java
Fri Dec 28 02:18:30 2007
@@ -111,19 +111,16 @@
 
         f = new File(folder, FILENAME);        
         assertEquals("Invalid file name", FILENAME, f.getName()); 
-        if (f.exists()) {
-            byte tmp[] = new byte[256];
-            String wasRed;
-            int n;
+        assertTrue("File does not exist", f.exists());
+        byte tmp[] = new byte[256];
+        String wasRed;
+        int n;
 
-            fis = new FileInputStream(f);
-            n = fis.read(tmp);
-            fis.close();
-            wasRed = new String(tmp, 0, n, CNTNT_CHARSET);
-            assertEquals("Invalid content was red", CONTENT, wasRed);
-        } else {
-            fail("File does not exist");
-        }
+        fis = new FileInputStream(f);
+        n = fis.read(tmp);
+        fis.close();
+        wasRed = new String(tmp, 0, n, CNTNT_CHARSET);
+        assertEquals("Invalid content was red", CONTENT, wasRed);
     }
 
 }



Mime
View raw message