Search in sources :

Example 6 with MavenModuleSet

use of hudson.maven.MavenModuleSet in project blueocean-plugin by jenkinsci.

the class PipelineApiTest method mavenModulesNoteListed.

@Test
public void mavenModulesNoteListed() throws Exception {
    ToolInstallations.configureDefaultMaven("apache-maven-2.2.1", Maven.MavenInstallation.MAVEN_21);
    MavenModuleSet m = j.jenkins.createProject(MavenModuleSet.class, "p");
    m.setScm(new ExtractResourceSCM(getClass().getResource("maven-multimod.zip")));
    assertFalse("MavenModuleSet.isNonRecursive() should be false", m.isNonRecursive());
    j.buildAndAssertSuccess(m);
    List responses = get("/organizations/jenkins/pipelines/", List.class);
    assertEquals(1, responses.size());
    assertEquals("p", ((Map) responses.get(0)).get("name"));
}
Also used : List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) ExtractResourceSCM(org.jvnet.hudson.test.ExtractResourceSCM) MavenModuleSet(hudson.maven.MavenModuleSet) Test(org.junit.Test)

Example 7 with MavenModuleSet

use of hudson.maven.MavenModuleSet in project sonar-scanner-jenkins by SonarSource.

the class SonarPublisherAdditionalPropertiesSlicerTest method availableMavenProjectsWithSonarPublisher.

@Test
public void availableMavenProjectsWithSonarPublisher() throws IOException {
    final MavenModuleSet project = j.jenkins.createProject(MavenModuleSet.class, "random-name");
    assertThat(new SonarPublisherAdditionalPropertiesSlicer().getWorkDomain().size()).isZero();
    project.getPublishersList().add(new SonarPublisher("MySonar", null, null, "-Dsonar.verbose", null, null, null, null, null, null, false));
    assertThat(new SonarPublisherAdditionalPropertiesSlicer().getWorkDomain().size()).isEqualTo(1);
}
Also used : SonarPublisher(hudson.plugins.sonar.SonarPublisher) MavenModuleSet(hudson.maven.MavenModuleSet) Test(org.junit.Test)

Example 8 with MavenModuleSet

use of hudson.maven.MavenModuleSet in project sonar-scanner-jenkins by SonarSource.

the class SonarPublisherAdditionalPropertiesSlicerTest method changeJobAdditionalProperties.

@Test
public void changeJobAdditionalProperties() throws IOException {
    final MavenModuleSet project = j.jenkins.createProject(MavenModuleSet.class, "random-name");
    project.getPublishersList().add(new SonarPublisher("MySonar", null, null, "-Dsonar.verbose", null, null, null, null, null, null, false));
    final SonarPublisherAdditionalPropertiesSlicer.SonarPublisherAdditionalPropertiesSlicerSpec propertiesSpec = new SonarPublisherAdditionalPropertiesSlicer.SonarPublisherAdditionalPropertiesSlicerSpec();
    final List<String> values = propertiesSpec.getValues(project);
    assertThat(values.get(0)).isEqualTo("-Dsonar.verbose");
    final List<String> newValues = new ArrayList<String>();
    newValues.add("-Dsonar.showSql");
    propertiesSpec.setValues(project, newValues);
    final SonarPublisher publisher = project.getPublishersList().get(SonarPublisher.class);
    assertThat(publisher.getJobAdditionalProperties()).isEqualTo("-Dsonar.showSql");
}
Also used : SonarPublisher(hudson.plugins.sonar.SonarPublisher) ArrayList(java.util.ArrayList) MavenModuleSet(hudson.maven.MavenModuleSet) Test(org.junit.Test)

Example 9 with MavenModuleSet

use of hudson.maven.MavenModuleSet in project sonar-scanner-jenkins by SonarSource.

the class SonarPublisherBranchSlicerTest method availableMavenProjectsWithSonarPublisher.

@Test
public void availableMavenProjectsWithSonarPublisher() throws IOException {
    final MavenModuleSet project = j.jenkins.createProject(MavenModuleSet.class, "random-name");
    assertThat(new SonarPublisherBranchSlicer().getWorkDomain().size()).isZero();
    project.getPublishersList().add(new SonarPublisher("MySonar", null, null, null, null, null, null, null, null, null, false));
    assertThat(new SonarPublisherBranchSlicer().getWorkDomain().size()).isEqualTo(1);
}
Also used : SonarPublisher(hudson.plugins.sonar.SonarPublisher) MavenModuleSet(hudson.maven.MavenModuleSet) Test(org.junit.Test)

Example 10 with MavenModuleSet

use of hudson.maven.MavenModuleSet in project sonar-scanner-jenkins by SonarSource.

the class SonarPublisherJdkSlicerTest method availableMavenProjectsWithSonarPublisher.

@Test
public void availableMavenProjectsWithSonarPublisher() throws IOException {
    final MavenModuleSet project = j.jenkins.createProject(MavenModuleSet.class, "random-name");
    assertThat(new SonarPublisherJdkSlicer().getWorkDomain().size()).isZero();
    project.getPublishersList().add(new SonarPublisher("MySonar", null, null, null, null, null, null, null, null, null, false));
    assertThat(new SonarPublisherJdkSlicer().getWorkDomain().size()).isEqualTo(1);
}
Also used : SonarPublisher(hudson.plugins.sonar.SonarPublisher) MavenModuleSet(hudson.maven.MavenModuleSet) Test(org.junit.Test)

Aggregations

MavenModuleSet (hudson.maven.MavenModuleSet)17 Test (org.junit.Test)10 SonarPublisher (hudson.plugins.sonar.SonarPublisher)8 EnvVars (hudson.EnvVars)4 ArrayList (java.util.ArrayList)4 MavenModule (hudson.maven.MavenModule)3 IOException (java.io.IOException)3 FilePath (hudson.FilePath)2 PerJobLocalRepositoryLocator (hudson.maven.local_repo.PerJobLocalRepositoryLocator)2 ImmutableList (com.google.common.collect.ImmutableList)1 DefaultLocalRepositoryLocator (hudson.maven.local_repo.DefaultLocalRepositoryLocator)1 LocalRepositoryLocator (hudson.maven.local_repo.LocalRepositoryLocator)1 VirtualChannel (hudson.remoting.VirtualChannel)1 ArgumentListBuilder (hudson.util.ArgumentListBuilder)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 List (java.util.List)1 GlobalSettingsProvider (jenkins.mvn.GlobalSettingsProvider)1 SettingsProvider (jenkins.mvn.SettingsProvider)1