Prevent test failure if target directory does not exist (e.g. in Eclipse)

This commit is contained in:
dsyer
2008-07-23 06:44:33 +00:00
parent 3f9ce6500d
commit d74aaf3cdb

View File

@@ -299,6 +299,7 @@ public class FlatFileItemWriterTests extends TestCase {
writer.setFieldSetCreator(new PassThroughFieldSetMapper());
FileSystemResource file = new FileSystemResource("target/no-such-file.foo");
writer.setResource(file);
new File(file.getFile().getParent()).mkdirs();
file.getFile().createNewFile();
file.getFile().setReadOnly();
writer.afterPropertiesSet();