### Question:
Cobertura { public CoverageReport executeCobertura() { boolean succeeded; try { Main.printLine("[Info] [" + Thread.currentThread().getName() + "] Start execution of Cobertura"); succeeded = executeCoberturaTask(); if (succeeded) { Main.printLine("[Info] [" + Thread.currentThread().getName() + "] Parsing Cobertura report"); CoverageReport coberturaReport = constructReport(); Main.printLine("[Info] [" + Thread.currentThread().getName() + "] Cleaning up after Cobertura"); cleanUp(); Main.printLine("[Info] [" + Thread.currentThread().getName() + "] Cobertura report finished"); return coberturaReport; } } catch (IOException e) { Main.printLine("[Error] [" + Thread.currentThread().getName() + "] Error during the execution sequence of Cobertura"); System.exit(OperiasStatus.ERROR_COBERTURA_TASK_CREATION.ordinal()); } catch (InterruptedException e) { Main.printLine("[Error] [" + Thread.currentThread().getName() + "] Error during the execution sequence of Cobertura"); System.exit(OperiasStatus.ERROR_COBERTURA_TASK_CREATION.ordinal()); } return null; } Cobertura(String directory); void setOutputDirectory(String outputDirectory); CoverageReport executeCobertura();  }### Answer:
@Test public void testFailedCoberturaExecution() { cobertura = new Cobertura("src/test/resources/noMavenProject"); assertNull("Executing cobertura failed", cobertura.executeCobertura()); }
@Test public void testInvalidDirectory() { System.setSecurityManager(new NoExitSecurityManager()); boolean exceptionThrown = false; cobertura = new Cobertura(null); try { cobertura.executeCobertura(); } catch (ExitException e) { exceptionThrown = true; assertEquals("Exit status invalid", OperiasStatus.ERROR_COBERTURA_TASK_CREATION.ordinal(), e.status); } exceptionThrown = false; cobertura = new Cobertura("src/../"); try { cobertura.executeCobertura(); } catch (ExitException e) { exceptionThrown = true; assertEquals("Exit status invalid", OperiasStatus.ERROR_COBERTURA_TASK_OPERIAS_EXECUTION.ordinal(), e.status); } assertTrue("No exception was thrown", exceptionThrown); System.setSecurityManager(null); }