I have created a simple program that wil create the dat file through buffered writer and will write some data into that file , now please advise what junit test cases I can have through which I can check whether the file is created or not in c: drive , I am using junit 3 , please advise.
Asked
Active
Viewed 3.4k times
12
-
Have you tried something? Maybe check if you can read that file. – Pavlo Aug 23 '13 at 07:30
1 Answers
41
File file = new File("c:/pathOfTheCreatedFile");
assertTrue(file.exists());
// TODO: read the file. Check that it contains what it's supposed to contain

JB Nizet
- 678,734
- 91
- 1,224
- 1,255