Package hudson.tasks.junit

Examples of hudson.tasks.junit.TestResult


    }

    private ChildReport mockChildReport()
    {
        final AbstractTestResultAction testResultAction1 = mock( AbstractTestResultAction.class );
        when( testResultAction1.getResult() ).thenReturn( new TestResult() );
        return new ChildReport( mockBuild, testResultAction1 );
    }
View Full Code Here


    }

    @Test
    public void testGetJUnitTestResult_whenFreestyleProjectShouldGetTest()
    {
        final TestResult testResult = new TestResult();
        final TestResultAction testResultAction = mock( TestResultAction.class );

        when( testResultAction.getResult() ).thenReturn( testResult );
        when( mockBuild.getAction( TestResultAction.class ) ).thenReturn( testResultAction );
View Full Code Here

                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) {
View Full Code Here

                    return true;
               
                String[] reportFiles = ds.getIncludedFiles();
                rememberCheckedFiles(reportsDir, reportFiles);
   
                if(result==null)    result = new TestResult();
                result.parse(System.currentTimeMillis() - build.getMilliSecsSinceBuildStart(), reportsDir, reportFiles);
               
                // final reference in order to serialize it:
                final TestResult r = result;
   
                int failCount = build.execute(new BuildCallable<Integer, IOException>() {
                        private static final long serialVersionUID = -1023888330720922136L;

                        public Integer call(MavenBuild build) throws IOException, InterruptedException {
                            SurefireReport sr = build.getAction(SurefireReport.class);
                            if(sr==null)
                                build.getActions().add(new SurefireReport(build, r, listener));
                            else
                                sr.setResult(r,listener);
                            if(r.getFailCount()>0)
                                build.setResult(Result.UNSTABLE);
                            build.registerAsProjectAction(new FactoryImpl());
                            return r.getFailCount();
                        }
                    });
               
                // if surefire plugin is going to kill maven because of a test failure,
                // intercept that (or otherwise build will be marked as failure)
View Full Code Here

       
        this.archiver.postExecute(buildProxy, null, this.mojoInfo, new NullBuildListener(), null);
       
        SurefireReport action = this.build.getAction(SurefireReport.class);
        Assert.assertNotNull(action);
        TestResult result = action.getResult();
        Assert.assertNotNull(result);
        Assert.assertEquals(2658, result.getTotalCount());
       
       
        resource = SurefireArchiverUnitTest.class.getResource("/surefire-archiver-test3");
        reportsDir = new File(resource.toURI().getPath());
        doReturn(reportsDir).when(this.mojoInfo).getConfigurationValue("reportsDirectory", File.class);
        touchReportFiles(reportsDir);
       
        this.archiver.postExecute(buildProxy, null, this.mojoInfo, new NullBuildListener(), null);
       
        action = this.build.getAction(SurefireReport.class);
        Assert.assertNotNull(action);
        result = action.getResult();
        Assert.assertNotNull(result);
        Assert.assertEquals(2670, result.getTotalCount());
    }
View Full Code Here

            Assert.fail(t2.exception.toString());
        }
       
        SurefireReport action = this.build.getAction(SurefireReport.class);
        Assert.assertNotNull(action);
        TestResult result = action.getResult();
        Assert.assertNotNull(result);
        Assert.assertEquals(2658, result.getTotalCount());
    }
View Full Code Here

      {
        return true;
      }

      if (result == null) {
        result = new TestResult();
      }
      result.parse(System.currentTimeMillis() - build.getMilliSecsSinceBuildStart(), ds);

      int failCount = build.execute(new BuildCallable<Integer, IOException>() { // NOSONAR this is ok for hudson
        public Integer call(MavenBuild build) throws IOException, InterruptedException {
View Full Code Here

    String buildUrl = getBuildURL(result.getOwner());
    @SuppressWarnings("rawtypes")
        AbstractTestResultAction action = result.getTestResultAction();
   
    TestObject parent = result.getParent();
    TestResult testResultRoot = null;
    while(parent != null) {
      if (parent instanceof TestResult) {
        testResultRoot = (TestResult) parent;
        break;
      }
      parent = parent.getParent();
    }
   
    String testUrl = action.getUrlName()
      + (testResultRoot != null ? testResultRoot.getUrl() : "")
      + result.getUrl();
   
    String[] pathComponents = testUrl.split("/");
    StringBuilder buf = new StringBuilder();
    for (String c : pathComponents) {
View Full Code Here

TOP

Related Classes of hudson.tasks.junit.TestResult

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.