コード例 #1
0
ファイル: CoberturaTest.java プロジェクト: rmhartog/operias
  /**
   * Proper execution of the maven project, but the coverage file was not found, can be test by
   * giving a random non existing output directory
   */
  @Test
  public void testCoverageXMLNotFound() {
    System.setSecurityManager(new NoExitSecurityManager());
    boolean exceptionThrown = false;

    cobertura = new Cobertura("src/test/resources/simpleMavenProject");
    cobertura.setOutputDirectory("target/randomFolder");
    try {
      cobertura.executeCobertura();
    } catch (ExitException e) {
      exceptionThrown = true;
      assertEquals("Exit status invalid", OperiasStatus.COVERAGE_XML_NOT_FOUND.ordinal(), e.status);
    }
    System.setSecurityManager(null);
    assertTrue("No exception was thrown", exceptionThrown);
  }
コード例 #2
0
ファイル: CoberturaTest.java プロジェクト: rmhartog/operias
 /** Simple test which executes a mvn project, retrieves the report and cleans up afterwards */
 @Test
 public void testCoberturaExecution() {
   cobertura = new Cobertura("src/test/resources/simpleMavenProject");
   cobertura.setOutputDirectory("target/simpleMavenProject");
   assertNotNull("Executing cobertura failed", cobertura.executeCobertura());
 }