Remove silly exception handling and conditional execution
@@ -53,8 +53,6 @@ public class LogFileHandlerTestCase {
h.setRotationTimes(rTimes);
assertThat(tomorrowMillis+1000).isEqualTo(h.getNextRotationTime(tomorrowMillis));
assertThat(tomorrowMillis+10000).isEqualTo(h.getNextRotationTime(tomorrowMillis+3000));
- boolean okToWrite = false; // don't want regular unit tests to create tiles....
- if (okToWrite) {
LogRecord lr = new LogRecord(Level.INFO, "test");
h.publish(lr);
h.publish(new LogRecord(Level.INFO, "another test"));
@@ -62,7 +60,6 @@ public class LogFileHandlerTestCase {
h.publish(lr);
h.flush();
}
- }
@Test
public void testSimpleLogging() throws IOException {
@@ -105,7 +102,7 @@ public class LogFileHandlerTestCase {
}
@Test
- public void testSymlink() throws IOException {
+ public void testSymlink() throws IOException, InterruptedException {
File root = temporaryFolder.newFolder("testlogforsymlinkchecking");
LogFileHandler h = new LogFileHandler();
h.setFilePattern(root.getAbsolutePath() + "/logfilehandlertest.%Y%m%d%H%M%S%s");
@@ -121,7 +118,6 @@ public class LogFileHandlerTestCase {
h.publish(lr);
String f1 = h.getFileName();
String f2 = null;
- try {
while (f1 == null) {
Thread.sleep(1);
f1 = h.getFileName();
@@ -150,9 +146,6 @@ public class LogFileHandlerTestCase {
assertThat(secondLength).isEqualTo(link);
assertThat(31).isEqualTo(first);
assertThat(secondLength).isEqualTo(second);
- } catch (InterruptedException e) {
- // just let the test pass
- }
}
@Test
