Search in sources :

Example 1 with AnalysisConfigurator

use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisConfigurator in project acceptance-test-harness by jenkinsci.

the class AnalysisCollectorPluginTest method addAndConfigureTasksPublisher.

private void addAndConfigureTasksPublisher(final FreeStyleJob job) {
    TasksFreestyleSettings taskScannerSettings = job.addPublisher(TasksFreestyleSettings.class);
    AnalysisConfigurator<TasksFreestyleSettings> configurator = settings -> {
        settings.setHighPriorityTags("PRIO1");
        settings.setNormalPriorityTags("PRIO2,TODO");
        settings.setLowPriorityTags("PRIO3");
    };
    configurator.accept(taskScannerSettings);
}
Also used : DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) WorkflowMultiBranchJob(org.jenkinsci.test.acceptance.po.WorkflowMultiBranchJob) CoreMatchers(org.hamcrest.CoreMatchers) Arrays(java.util.Arrays) Since(org.jenkinsci.test.acceptance.junit.Since) Issue(org.jvnet.hudson.test.Issue) FindBugsFreestyleSettings(org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsFreestyleSettings) AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) WebElement(org.openqa.selenium.WebElement) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) DockerContainerHolder(org.jenkinsci.test.acceptance.docker.DockerContainerHolder) AnalysisGraphConfigurationView(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisGraphConfigurationView) NestedView(org.jenkinsci.test.acceptance.plugins.nested_view.NestedView) Inject(javax.inject.Inject) GitRepo(org.jenkinsci.test.acceptance.plugins.git.GitRepo) Folder(org.jenkinsci.test.acceptance.po.Folder) WarningsPerProjectPortlet(org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet) Build(org.jenkinsci.test.acceptance.po.Build) AnalysisConfigurator(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisConfigurator) Map(java.util.Map) AnalysisPlugin(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisPlugin) ListView(org.jenkinsci.test.acceptance.po.ListView) WithDocker(org.jenkinsci.test.acceptance.junit.WithDocker) AnalysisCollectorColumn(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorColumn) Description(org.hamcrest.Description) Job(org.jenkinsci.test.acceptance.po.Job) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) WarningsBuildSettings(org.jenkinsci.test.acceptance.plugins.warnings.WarningsBuildSettings) GitBranchSource(org.jenkinsci.test.acceptance.plugins.workflow_multibranch.GitBranchSource) By(org.openqa.selenium.By) Test(org.junit.Test) AnalysisCollectorSettings(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorSettings) TasksFreestyleSettings(org.jenkinsci.test.acceptance.plugins.tasks.TasksFreestyleSettings) WithCredentials(org.jenkinsci.test.acceptance.junit.WithCredentials) CheckStyleFreestyleSettings(org.jenkinsci.test.acceptance.plugins.checkstyle.CheckStyleFreestyleSettings) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AnalysisCollectorAction(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction) NoSuchElementException(org.openqa.selenium.NoSuchElementException) List(java.util.List) MatcherAssert(org.hamcrest.MatcherAssert) Matcher(org.jenkinsci.test.acceptance.Matcher) GitContainer(org.jenkinsci.test.acceptance.docker.fixtures.GitContainer) Matchers(org.jenkinsci.test.acceptance.Matchers) Container(org.jenkinsci.test.acceptance.po.Container) Collections(java.util.Collections) PmdFreestyleSettings(org.jenkinsci.test.acceptance.plugins.pmd.PmdFreestyleSettings) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins) TasksFreestyleSettings(org.jenkinsci.test.acceptance.plugins.tasks.TasksFreestyleSettings)

Example 2 with AnalysisConfigurator

use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisConfigurator in project acceptance-test-harness by jenkinsci.

the class AnalysisCollectorPluginTest method addAndConfigureWarningsPublisher.

private void addAndConfigureWarningsPublisher(final FreeStyleJob job) {
    WarningsBuildSettings warningsSettings = job.addPublisher(WarningsBuildSettings.class);
    AnalysisConfigurator<WarningsBuildSettings> warningsConfigurator = settings -> {
        settings.addWorkspaceScanner("Java Compiler (javac)", "**/*");
        settings.addWorkspaceScanner("JavaDoc Tool", "**/*");
        settings.addWorkspaceScanner("MSBuild", "**/*");
    };
    warningsConfigurator.accept(warningsSettings);
}
Also used : DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) WorkflowMultiBranchJob(org.jenkinsci.test.acceptance.po.WorkflowMultiBranchJob) CoreMatchers(org.hamcrest.CoreMatchers) Arrays(java.util.Arrays) Since(org.jenkinsci.test.acceptance.junit.Since) Issue(org.jvnet.hudson.test.Issue) FindBugsFreestyleSettings(org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsFreestyleSettings) AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) WebElement(org.openqa.selenium.WebElement) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) DockerContainerHolder(org.jenkinsci.test.acceptance.docker.DockerContainerHolder) AnalysisGraphConfigurationView(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisGraphConfigurationView) NestedView(org.jenkinsci.test.acceptance.plugins.nested_view.NestedView) Inject(javax.inject.Inject) GitRepo(org.jenkinsci.test.acceptance.plugins.git.GitRepo) Folder(org.jenkinsci.test.acceptance.po.Folder) WarningsPerProjectPortlet(org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet) Build(org.jenkinsci.test.acceptance.po.Build) AnalysisConfigurator(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisConfigurator) Map(java.util.Map) AnalysisPlugin(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisPlugin) ListView(org.jenkinsci.test.acceptance.po.ListView) WithDocker(org.jenkinsci.test.acceptance.junit.WithDocker) AnalysisCollectorColumn(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorColumn) Description(org.hamcrest.Description) Job(org.jenkinsci.test.acceptance.po.Job) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) WarningsBuildSettings(org.jenkinsci.test.acceptance.plugins.warnings.WarningsBuildSettings) GitBranchSource(org.jenkinsci.test.acceptance.plugins.workflow_multibranch.GitBranchSource) By(org.openqa.selenium.By) Test(org.junit.Test) AnalysisCollectorSettings(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorSettings) TasksFreestyleSettings(org.jenkinsci.test.acceptance.plugins.tasks.TasksFreestyleSettings) WithCredentials(org.jenkinsci.test.acceptance.junit.WithCredentials) CheckStyleFreestyleSettings(org.jenkinsci.test.acceptance.plugins.checkstyle.CheckStyleFreestyleSettings) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AnalysisCollectorAction(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction) NoSuchElementException(org.openqa.selenium.NoSuchElementException) List(java.util.List) MatcherAssert(org.hamcrest.MatcherAssert) Matcher(org.jenkinsci.test.acceptance.Matcher) GitContainer(org.jenkinsci.test.acceptance.docker.fixtures.GitContainer) Matchers(org.jenkinsci.test.acceptance.Matchers) Container(org.jenkinsci.test.acceptance.po.Container) Collections(java.util.Collections) PmdFreestyleSettings(org.jenkinsci.test.acceptance.plugins.pmd.PmdFreestyleSettings) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins) WarningsBuildSettings(org.jenkinsci.test.acceptance.plugins.warnings.WarningsBuildSettings)

Example 3 with AnalysisConfigurator

use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisConfigurator in project acceptance-test-harness by jenkinsci.

the class AnalysisCollectorPluginTest method should_set_build_result_to_unstable.

/**
 * Verifies that a build should become status unstable when a warning threshold is exceeded.
 */
@Test
public void should_set_build_result_to_unstable() {
    FreeStyleJob job = jenkins.jobs.create();
    job.configure();
    job.copyResource(ANALYSIS_COLLECTOR_PLUGIN_RESOURCES + "/findbugs.xml");
    job.addPublisher(FindBugsFreestyleSettings.class);
    AnalysisCollectorSettings analysis = job.addPublisher(AnalysisCollectorSettings.class);
    AnalysisConfigurator<AnalysisCollectorSettings> configurator = settings -> settings.setBuildUnstableTotalAll("5");
    configurator.accept(analysis);
    job.save();
    buildUnstableJob(job);
}
Also used : DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) WorkflowMultiBranchJob(org.jenkinsci.test.acceptance.po.WorkflowMultiBranchJob) CoreMatchers(org.hamcrest.CoreMatchers) Arrays(java.util.Arrays) Since(org.jenkinsci.test.acceptance.junit.Since) Issue(org.jvnet.hudson.test.Issue) FindBugsFreestyleSettings(org.jenkinsci.test.acceptance.plugins.findbugs.FindBugsFreestyleSettings) AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) WebElement(org.openqa.selenium.WebElement) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) DockerContainerHolder(org.jenkinsci.test.acceptance.docker.DockerContainerHolder) AnalysisGraphConfigurationView(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisGraphConfigurationView) NestedView(org.jenkinsci.test.acceptance.plugins.nested_view.NestedView) Inject(javax.inject.Inject) GitRepo(org.jenkinsci.test.acceptance.plugins.git.GitRepo) Folder(org.jenkinsci.test.acceptance.po.Folder) WarningsPerProjectPortlet(org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet) Build(org.jenkinsci.test.acceptance.po.Build) AnalysisConfigurator(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisConfigurator) Map(java.util.Map) AnalysisPlugin(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisPlugin) ListView(org.jenkinsci.test.acceptance.po.ListView) WithDocker(org.jenkinsci.test.acceptance.junit.WithDocker) AnalysisCollectorColumn(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorColumn) Description(org.hamcrest.Description) Job(org.jenkinsci.test.acceptance.po.Job) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) WarningsBuildSettings(org.jenkinsci.test.acceptance.plugins.warnings.WarningsBuildSettings) GitBranchSource(org.jenkinsci.test.acceptance.plugins.workflow_multibranch.GitBranchSource) By(org.openqa.selenium.By) Test(org.junit.Test) AnalysisCollectorSettings(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorSettings) TasksFreestyleSettings(org.jenkinsci.test.acceptance.plugins.tasks.TasksFreestyleSettings) WithCredentials(org.jenkinsci.test.acceptance.junit.WithCredentials) CheckStyleFreestyleSettings(org.jenkinsci.test.acceptance.plugins.checkstyle.CheckStyleFreestyleSettings) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AnalysisCollectorAction(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction) NoSuchElementException(org.openqa.selenium.NoSuchElementException) List(java.util.List) MatcherAssert(org.hamcrest.MatcherAssert) Matcher(org.jenkinsci.test.acceptance.Matcher) GitContainer(org.jenkinsci.test.acceptance.docker.fixtures.GitContainer) Matchers(org.jenkinsci.test.acceptance.Matchers) Container(org.jenkinsci.test.acceptance.po.Container) Collections(java.util.Collections) PmdFreestyleSettings(org.jenkinsci.test.acceptance.plugins.pmd.PmdFreestyleSettings) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AnalysisCollectorSettings(org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorSettings) Test(org.junit.Test)

Aggregations

Arrays (java.util.Arrays)3 Collections (java.util.Collections)3 List (java.util.List)3 Map (java.util.Map)3 Inject (javax.inject.Inject)3 CoreMatchers (org.hamcrest.CoreMatchers)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)3 Description (org.hamcrest.Description)3 MatcherAssert (org.hamcrest.MatcherAssert)3 Matcher (org.jenkinsci.test.acceptance.Matcher)3 Matchers (org.jenkinsci.test.acceptance.Matchers)3 DockerContainerHolder (org.jenkinsci.test.acceptance.docker.DockerContainerHolder)3 GitContainer (org.jenkinsci.test.acceptance.docker.fixtures.GitContainer)3 Since (org.jenkinsci.test.acceptance.junit.Since)3 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)3 WithDocker (org.jenkinsci.test.acceptance.junit.WithDocker)3 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)3 AnalysisCollectorAction (org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorAction)3 AnalysisCollectorColumn (org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorColumn)3 AnalysisCollectorSettings (org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorSettings)3