Package com.puppetlabs.geppetto.junitresult

Examples of com.puppetlabs.geppetto.junitresult.Testsuites


  public void test_aggregatorSampleTest() throws IOException, TransformerException, ParserConfigurationException {
    JunitresultAggregator aggregator = new JunitresultAggregator();
    File root = TestDataProvider.getTestFile(new Path("testData/allresults/"));
    JunitResult result = aggregator.aggregate(root, root);
    assertTrue(result instanceof Testsuites);
    Testsuites testsuite = (Testsuites) result;
    assertEquals("allresults", testsuite.getName());
    assertEquals(1, testsuite.getErrors());
    assertEquals(13, testsuite.getTests());
    assertEquals(7, testsuite.getFailures());

    JunitresultDomSerializer serializer = new JunitresultDomSerializer();
    File outputDir = TestDataProvider.getTestFile(new Path("output/"));
    File output = new File(outputDir, "sample_result.xml");
    if(!output.exists())
View Full Code Here


      FileUtils.unzip(TestDataProvider.getTestFile(new Path("testData/test_results.zip")), root);

      JunitResult result = aggregator.aggregate(root, root);
      assertTrue(result instanceof Testsuites);
      Testsuites testsuite = (Testsuites) result;
      assertEquals("test_results", testsuite.getName());
      assertEquals(3, testsuite.getErrors());
      assertEquals(1360, testsuite.getTests());
      assertEquals(28, testsuite.getFailures());

      for(Testsuite ts : testsuite.getTestsuites()) {
        String correctTimestamp = correctTimestamps.get(ts.getName());
        if(correctTimestamp != null)
          assertEquals(formatDate(ts.getTimestamp()), correctTimestamp);
      }
View Full Code Here

        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case JunitresultPackage.TESTSUITES: {
        Testsuites testsuites = (Testsuites) theEObject;
        T result = caseTestsuites(testsuites);
        if(result == null)
          result = caseAbstractAggregatedTest(testsuites);
        if(result == null)
          result = caseJunitResult(testsuites);
View Full Code Here

   *
   * @param element
   * @return
   */
  private Testsuites loadTestSuites(Element element) {
    Testsuites o = JunitresultFactory.eINSTANCE.createTestsuites();
    loadAbstractAggregatedPart(o, element);
    o.setTime(getTime(element, "time"));
    o.setDisabled(getIntAttributeWith0Default(element, "disabled"));

    NodeList children = element.getChildNodes();
    for(int i = 0; i < children.getLength(); i++) {
      Node n = children.item(i);
      if(n.getNodeType() == Node.ELEMENT_NODE && "testsuite".equalsIgnoreCase(n.getNodeName()))
        o.getTestsuites().add(loadTestSuite((Element) n, true));
    }
    return o;
  }
View Full Code Here

  }

  private Testsuites createRootSuite(File reportDir) {
    IPath p = new Path(reportDir.getAbsolutePath());
    IPath relative = p.makeRelativeTo(rootPath);
    Testsuites testsuites = JunitresultFactory.eINSTANCE.createTestsuites();
    testsuites.setName(relative.toString());
    return testsuites;
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.junitresult.Testsuites

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.