[TASK] Added Unit test

This commit is contained in:
Jeroen Ketelaar
2019-05-21 23:12:22 -05:00
parent 32ce5c0cda
commit 19bb75f09b
2 changed files with 30 additions and 2 deletions
@@ -0,0 +1,28 @@
package org.parabot;
import org.junit.Assert;
import org.junit.Test;
import org.parabot.environment.handlers.exceptions.ExceptionHandler;
import org.parabot.environment.handlers.exceptions.FileExceptionHandler;
import java.io.File;
public class FileExceptionHandlerTest {
@Test
public void test() {
FileExceptionHandler serverHandler = new FileExceptionHandler(ExceptionHandler.ExceptionType.SERVER);
serverHandler.setIgnored(true);
File[] reports = serverHandler.getReportsDirectory().listFiles();
int reportCount = 0;
if (reports != null) {
reportCount = reports.length;
}
Exception exception = new Exception("Test");
serverHandler.handle(exception);
Assert.assertTrue(serverHandler.getReportsDirectory().listFiles().length > reportCount);
}
}