hudson.tasks.junit.JUnitResultArchiver Java Examples
The following examples show how to use
hudson.tasks.junit.JUnitResultArchiver.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PipelineApiTest.java From blueocean-plugin with MIT License | 6 votes |
@Test public void getPipelineRunWithTestResult() throws Exception { FreeStyleProject p = j.createFreeStyleProject("pipeline4"); p.getBuildersList().add(new Shell("echo '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<testsuite xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd\" name=\"io.jenkins.blueocean.jsextensions.JenkinsJSExtensionsTest\" time=\"35.7\" tests=\"1\" errors=\"0\" skipped=\"0\" failures=\"0\">\n" + " <properties>\n" + " </properties>\n" + " <testcase name=\"test\" classname=\"io.jenkins.blueocean.jsextensions.JenkinsJSExtensionsTest\" time=\"34.09\"/>\n" + "</testsuite>' > test-result.xml")); p.getPublishersList().add(new JUnitResultArchiver("*.xml")); FreeStyleBuild b = p.scheduleBuild2(0).get(); TestResultAction resultAction = b.getAction(TestResultAction.class); assertEquals("io.jenkins.blueocean.jsextensions.JenkinsJSExtensionsTest",resultAction.getResult().getSuites().iterator().next().getName()); j.assertBuildStatusSuccess(b); Map resp = get("/organizations/jenkins/pipelines/pipeline4/runs/"+b.getId()); //discover TestResultAction super classes get("/classes/hudson.tasks.junit.TestResultAction/"); // get junit rest report get("/organizations/jenkins/pipelines/pipeline4/runs/"+b.getId()+"/testReport/result/"); }
Example #2
Source File: TestReportUiTest.java From junit-plugin with MIT License | 5 votes |
/** * Creates a freestyle project & build with UNSTABLE status * containing a test report from: /hudson/tasks/junit/junit-report-20090516.xml */ private FreeStyleBuild configureTestBuild(String projectName) throws Exception { FreeStyleProject p = j.createFreeStyleProject(projectName); p.getBuildersList().add(new TestBuilder() { @Override @SuppressWarnings("null") public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { build.getWorkspace().child("junit.xml").copyFrom( getClass().getResource("/hudson/tasks/junit/junit-report-20090516.xml")); return true; } }); p.getPublishersList().add(new JUnitResultArchiver("*.xml")); return j.assertBuildStatus(Result.UNSTABLE, p.scheduleBuild2(0).get()); }
Example #3
Source File: TestUtils.java From phabricator-jenkins-plugin with MIT License | 4 votes |
public static Publisher getDefaultXUnitPublisher() { return new JUnitResultArchiver( JUNIT_XML ); }
Example #4
Source File: AggregatedTestResultPublisherTest.java From junit-plugin with MIT License | 4 votes |
private void addJUnitResultArchiver(FreeStyleProject project) { JUnitResultArchiver archiver = new JUnitResultArchiver("*.xml"); project.getPublishersList().add(archiver); project.getBuildersList().add(new TouchBuilder()); }