Lines Matching refs:testFile
52 File testFile = null;
58 testFile = FileUtil.createTempFile("testChmodRW", ".txt");
59 assertTrue(FileUtil.chmodGroupRW(testFile));
60 assertTrue(testFile.canRead());
61 assertTrue(testFile.canWrite());
62 assertFalse(testFile.canExecute());
64 FileUtil.deleteFile(testFile);
74 File testFile = null;
77 testFile = FileUtil.createTempFile("testChmodRW", ".txt");
78 assertTrue(FileUtil.chmodGroupRW(testFile));
79 assertTrue(testFile.canRead());
80 assertTrue(testFile.canWrite());
81 assertFalse(testFile.canExecute());
83 FileUtil.deleteFile(testFile);
90 File testFile = null;
96 testFile = FileUtil.createTempFile("testChmodRWX", ".txt");
97 assertTrue(FileUtil.chmodGroupRWX(testFile));
98 assertTrue(testFile.canRead());
99 assertTrue(testFile.canWrite());
100 assertTrue(testFile.canExecute());
102 FileUtil.deleteFile(testFile);
112 File testFile = null;
115 testFile = FileUtil.createTempFile("testChmodRWX", ".txt");
116 assertTrue(FileUtil.chmodGroupRWX(testFile));
117 assertTrue(testFile.canRead());
118 assertTrue(testFile.canWrite());
119 assertTrue(testFile.canExecute());
121 FileUtil.deleteFile(testFile);
131 File testFile = null;
138 testFile = FileUtil.createTempFile(prefix, ".gz");
139 assertTrue(testFile.getName().length() <= FileUtil.FILESYSTEM_FILENAME_MAX_LENGTH);
141 FileUtil.deleteFile(testFile);
152 File testFile = null;
162 testFile = FileUtil.createTempFile(prefix, suffix);
163 assertTrue(testFile.getName().length() <= FileUtil.FILESYSTEM_FILENAME_MAX_LENGTH);
165 FileUtil.deleteFile(testFile);
175 File testFile = null;
177 testFile = File.createTempFile("doesnotmatter", ".txt");
178 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, false);
179 assertEquals(FileUtil.readStringFromFile(testFile), "write1");
180 FileUtil.writeToFile(new ByteArrayInputStream("write2".getBytes()), testFile, false);
181 assertEquals(FileUtil.readStringFromFile(testFile), "write2");
183 FileUtil.deleteFile(testFile);
193 File testFile = null;
195 testFile = File.createTempFile("doesnotmatter", ".txt");
196 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, true);
197 FileUtil.writeToFile(new ByteArrayInputStream("write2".getBytes()), testFile, true);
198 assertEquals(FileUtil.readStringFromFile(testFile), "write1write2");
200 FileUtil.deleteFile(testFile);
210 File testFile = null;
212 testFile = FileUtil.createTempFile("fileutiltest", ".test");
213 FileUtil.deleteFile(testFile);
214 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, false);
215 assertEquals("write1", FileUtil.readStringFromFile(testFile));
217 FileUtil.deleteFile(testFile);
227 File testFile = null;
229 testFile = FileUtil.createTempFile("fileutiltest", ".test");
230 FileUtil.deleteFile(testFile);
231 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile, true);
232 assertEquals("write1", FileUtil.readStringFromFile(testFile));
234 FileUtil.deleteFile(testFile);
241 File testFile = null;
243 testFile = File.createTempFile("doesnotmatter", ".txt");
244 FileUtil.writeToFile(new ByteArrayInputStream("write1".getBytes()), testFile);
245 assertEquals(FileUtil.readStringFromFile(testFile), "write1");
246 FileUtil.writeToFile(new ByteArrayInputStream("write2".getBytes()), testFile);
247 assertEquals(FileUtil.readStringFromFile(testFile), "write2");
249 FileUtil.deleteFile(testFile);
256 File testFile = null;
258 testFile = File.createTempFile("doesnotmatter", ".txt");
259 FileUtil.writeToFile("write1", testFile, false);
260 assertEquals(FileUtil.readStringFromFile(testFile), "write1");
261 FileUtil.writeToFile("write2", testFile, false);
262 assertEquals(FileUtil.readStringFromFile(testFile), "write2");
264 FileUtil.deleteFile(testFile);
271 File testFile = null;
273 testFile = File.createTempFile("doesnotmatter", ".txt");
274 FileUtil.writeToFile("write1", testFile, true);
275 FileUtil.writeToFile("write2", testFile, true);
276 assertEquals(FileUtil.readStringFromFile(testFile), "write1write2");
278 FileUtil.deleteFile(testFile);
285 File testFile = null;
287 testFile = File.createTempFile("doesnotmatter", ".txt");
288 FileUtil.writeToFile("write1", testFile);
289 assertEquals(FileUtil.readStringFromFile(testFile), "write1");
290 FileUtil.writeToFile("write2", testFile);
291 assertEquals(FileUtil.readStringFromFile(testFile), "write2");
293 FileUtil.deleteFile(testFile);