Package hudson.tasks.test

Examples of hudson.tasks.test.AggregatedTestResultAction$Child


    }

    @Test
    public void testGetJUnitTestResult_whenMavenProjectUseMavenPluginsSurefireAggregatedReport()
    {
        final AggregatedTestResultAction surefireAggregatedReport = mock( AggregatedTestResultAction.class );
        final ChildReport childReport1 = mockChildReport();
        final ChildReport childReport2 = mockChildReport();
        when( surefireAggregatedReport.getChildReports() ).thenReturn(
            new LinkedList<AggregatedTestResultAction.ChildReport>()
            {{
                    add( childReport1 );
                    add( childReport2 );
                }} );
View Full Code Here


     */
    protected int getNumFailures(AbstractBuild<?, ?> build) {
        AbstractTestResultAction a = build.getAction(AbstractTestResultAction.class);
        if (a instanceof AggregatedTestResultAction) {
            int result = 0;
            AggregatedTestResultAction action = (AggregatedTestResultAction) a;
            for (ChildReport cr : action.getChildReports()) {
                if (cr == null || cr.child == null || cr.child.getParent() == null) {
                    continue;
                }
                if (cr.child.getParent().equals(build.getParent())) {
                    if (cr.result instanceof TestResult) {
                        TestResult tr = (TestResult) cr.result;
                        result += tr.getFailCount();
                    }
                }
            }

            if (result == 0 && action.getFailCount() > 0) {
                result = action.getFailCount();
            }
            return result;
        }
        return a.getFailCount();
    }
View Full Code Here

  @Test
  public void testCircularDependencyPojos() {
    Parent parent = factory.manufacturePojo(Parent.class);
    Assert.assertNotNull("The parent pojo cannot be null!", parent);

    Child child = parent.getChild();
    Assert.assertNotNull("The child pojo cannot be null!", child);
  }
View Full Code Here

TOP

Related Classes of hudson.tasks.test.AggregatedTestResultAction$Child

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.