Package com.puppetlabs.geppetto.junitresult

Examples of com.puppetlabs.geppetto.junitresult.Testrun


  public void testLoad_Bougie_testrun() throws IOException {
    File f = TestDataProvider.getTestFile(new Path("testData/BougieTest_testrun.xml"));
    JunitResult result = JunitresultLoader.loadFromXML(f);

    assertTrue("should be a Testrun instance", result instanceof Testrun);
    Testrun testrun = (Testrun) result;
    assertEquals("net.cars.engine.BougieTest", testrun.getName());
    assertEquals(2, testrun.getTests());
    assertEquals(2, testrun.getStarted());
    assertEquals(0, testrun.getFailures());
    assertEquals(1, testrun.getErrors());
    assertEquals(0, testrun.getIgnored());

    assertEquals("There should be one testsuite", 1, testrun.getTestsuites().size());
    Testsuite testsuite = testrun.getTestsuites().get(0);
    assertEquals("net.cars.engine.BougieTest", testsuite.getName());
    assertEquals(0.017, testsuite.getTime());

    assertEquals("There should be two testcases", 2, testsuite.getTestcases().size());
    Testcase tc1 = testsuite.getTestcases().get(0);
View Full Code Here


        if(result == null)
          result = defaultCase(theEObject);
        return result;
      }
      case JunitresultPackage.TESTRUN: {
        Testrun testrun = (Testrun) theEObject;
        T result = caseTestrun(testrun);
        if(result == null)
          result = caseAbstractAggregatedTest(testrun);
        if(result == null)
          result = caseJunitResult(testrun);
View Full Code Here

   */
  private Testrun loadTestrun(Element element) {
    if(!"testrun".equalsIgnoreCase(element.getNodeName())) {
      throw new IllegalArgumentException("Non 'testrun' element passed to #loadTestrun");
    }
    Testrun o = JunitresultFactory.eINSTANCE.createTestrun();
    loadAbstractAggregatedPart(o, element);
    o.setProject(element.getAttribute("project"));
    o.setStarted(getIntAttributeWith0Default(element, "started"));
    o.setIgnored(getIntAttributeWith0Default(element, "ignored"));

    // nested test suite(s)
    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, false));
    }

    return o;
  }
View Full Code Here

TOP

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

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.