test/java/io/File/Basic.java

Print this page

        

*** 73,83 **** if (!f.isFile()) fail(f, "is not a file"); if (f.isDirectory()) fail(f, "is a directory"); if (!f.canRead()) fail(f, "is not readable"); if (f.canWrite() != writeable) fail(f, writeable ? "is not writeable" : "is writeable"); ! int rwLen = (File.separatorChar == '/' ? 6 : 7); if (f.length() != length) fail(f, "has wrong length"); } static void fail(File f, String why) throws Exception { throw new Exception(f + " " + why); --- 73,83 ---- if (!f.isFile()) fail(f, "is not a file"); if (f.isDirectory()) fail(f, "is a directory"); if (!f.canRead()) fail(f, "is not readable"); if (f.canWrite() != writeable) fail(f, writeable ? "is not writeable" : "is writeable"); ! int rwLen = 6; if (f.length() != length) fail(f, "has wrong length"); } static void fail(File f, String why) throws Exception { throw new Exception(f + " " + why);
*** 87,97 **** show(nonExistantFile); if (nonExistantFile.exists()) fail(nonExistantFile, "exists"); show(rwFile); ! testFile(rwFile, true, File.separatorChar == '/' ? 6 : 7); rwFile.delete(); if (rwFile.exists()) fail(rwFile, "could not delete"); show(roFile); --- 87,97 ---- show(nonExistantFile); if (nonExistantFile.exists()) fail(nonExistantFile, "exists"); show(rwFile); ! testFile(rwFile, true, 6); rwFile.delete(); if (rwFile.exists()) fail(rwFile, "could not delete"); show(roFile);