Merge branch '1.5.x'

pull/6437/merge
Andy Wilkinson 8 years ago
commit 1ad7a66f03

@ -50,9 +50,21 @@ public class SampleIntegrationApplicationTests {
private ConfigurableApplicationContext context; private ConfigurableApplicationContext context;
@Before @Before
public void deleteOutput() { public void deleteInputAndOutput() throws InterruptedException {
FileSystemUtils.deleteRecursively(new File("target/input")); deleteIfExists(new File("target/input"));
FileSystemUtils.deleteRecursively(new File("target/output")); deleteIfExists(new File("target/output"));
}
private void deleteIfExists(File directory) throws InterruptedException {
if (directory.exists()) {
for (int i = 0; i < 10; i++) {
if (FileSystemUtils.deleteRecursively(directory)) {
return;
}
Thread.sleep(100);
}
throw new IllegalStateException("Failed to delete '" + directory + "'");
}
} }
@After @After

Loading…
Cancel
Save