Search in sources :

Example 6 with HtmlPublisherTarget

use of htmlpublisher.HtmlPublisherTarget in project htmlpublisher-plugin by jenkinsci.

the class PublishHTMLStepTest method publishReportOnBuildLevel.

@Test
public void publishReportOnBuildLevel() throws Exception {
    // Prepare the environment
    writeTestHTML("index.html");
    // Run the project
    final HtmlPublisherTarget target = new HtmlPublisherTarget("testReport", TEST_REPORT_DIR, "index.html", true, false, false);
    target.setReportTitles("index");
    setupAndRunProject(target);
    // Ensure that the report has been attached properly
    r.assertBuildStatus(Result.SUCCESS, run);
    HtmlPublisherTarget.HTMLAction jobReport = job.getAction(HtmlPublisherTarget.HTMLAction.class);
    HtmlPublisherTarget.HTMLBuildAction buildReport = run.getAction(HtmlPublisherTarget.HTMLBuildAction.class);
    assertNotNull("Report should be present at the project level", jobReport);
    assertEquals(target.getReportName(), jobReport.getHTMLTarget().getReportName());
    assertNotNull("Report should be present at the run level", buildReport);
    assertEquals(target.getReportName(), buildReport.getHTMLTarget().getReportName());
}
Also used : HtmlPublisherTarget(htmlpublisher.HtmlPublisherTarget) Test(org.junit.Test)

Example 7 with HtmlPublisherTarget

use of htmlpublisher.HtmlPublisherTarget in project htmlpublisher-plugin by jenkinsci.

the class PublishHTMLStepTest method testDeprecationWarningDisplayedWhenTryingToResolveParameters.

@Test
public void testDeprecationWarningDisplayedWhenTryingToResolveParameters() throws Exception {
    writeTestHTML("index.html");
    final HtmlPublisherTarget target = new HtmlPublisherTarget("testReport", TEST_REPORT_DIR, "${TEST}", false, false, false);
    setupAndRunProject(target);
    // Ensure that the report has been attached properly
    r.assertBuildStatus(Result.SUCCESS, run);
    r.assertLogContains("*** WARNING ***", run);
}
Also used : HtmlPublisherTarget(htmlpublisher.HtmlPublisherTarget) Test(org.junit.Test)

Example 8 with HtmlPublisherTarget

use of htmlpublisher.HtmlPublisherTarget in project htmlpublisher-plugin by jenkinsci.

the class PublishHTMLStepTest method publishReportOnProjectLevel.

@Test
public void publishReportOnProjectLevel() throws Exception {
    // Prepare the environment
    writeTestHTML("index.html");
    // Run the project
    final HtmlPublisherTarget target = new HtmlPublisherTarget("testReport", TEST_REPORT_DIR, "index.html", false, false, false);
    setupAndRunProject(target);
    // Ensure that the report has been attached properly
    r.assertBuildStatus(Result.SUCCESS, run);
    HtmlPublisherTarget.HTMLAction jobReport = job.getAction(HtmlPublisherTarget.HTMLAction.class);
    HtmlPublisherTarget.HTMLBuildAction buildReport = run.getAction(HtmlPublisherTarget.HTMLBuildAction.class);
    assertNotNull("Report should be present at the project level", jobReport);
    assertEquals(target.getReportName(), jobReport.getHTMLTarget().getReportName());
    assertNull("Report should be missing at the run level", buildReport);
}
Also used : HtmlPublisherTarget(htmlpublisher.HtmlPublisherTarget) Test(org.junit.Test)

Example 9 with HtmlPublisherTarget

use of htmlpublisher.HtmlPublisherTarget in project htmlpublisher-plugin by jenkinsci.

the class PublishHTMLStepTest method configRoundTrip.

private void configRoundTrip(String reportName, String reportDir, String reportFiles) throws Exception {
    final HtmlPublisherTarget target = new HtmlPublisherTarget(reportName, reportDir, reportFiles, false, false, false);
    target.setReportTitles("index");
    configRoundTrip(target);
}
Also used : HtmlPublisherTarget(htmlpublisher.HtmlPublisherTarget)

Aggregations

HtmlPublisherTarget (htmlpublisher.HtmlPublisherTarget)9 Test (org.junit.Test)6 AbortException (hudson.AbortException)1 FilePath (hudson.FilePath)1 Run (hudson.model.Run)1 TaskListener (hudson.model.TaskListener)1 File (java.io.File)1