Search in sources :

Example 1 with InstallSourceProperty

use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.

the class CustomToolsTest method configure_custom_tools.

@Test
@Issue("#97")
@Ignore
@ConfiguredWithCode(value = "CustomToolsTest.yml")
public void configure_custom_tools() {
    DescriptorImpl descriptor = (DescriptorImpl) j.jenkins.getDescriptorOrDie(CustomTool.class);
    assertEquals(1, descriptor.getInstallations().length);
    final CustomTool customTool = descriptor.getInstallations()[0];
    final InstallSourceProperty source = customTool.getProperties().get(InstallSourceProperty.class);
    assertNotNull(source);
    final CommandInstaller installer = source.installers.get(CommandInstaller.class);
    assertNotNull(installer);
    assertEquals("/bin/my-tool", installer.getToolHome());
}
Also used : CustomTool(com.cloudbees.jenkins.plugins.customtools.CustomTool) DescriptorImpl(com.cloudbees.jenkins.plugins.customtools.CustomTool.DescriptorImpl) CommandInstaller(hudson.tools.CommandInstaller) InstallSourceProperty(hudson.tools.InstallSourceProperty) Ignore(org.junit.Ignore) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test) ConfiguredWithCode(io.jenkins.plugins.casc.misc.ConfiguredWithCode)

Example 2 with InstallSourceProperty

use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.

the class MavenConfiguratorTest method configure_maven_tool.

@Test
@ConfiguredWithReadme("maven/README.md#0")
public void configure_maven_tool() {
    final Maven.DescriptorImpl descriptor = ExtensionList.lookupSingleton(Maven.DescriptorImpl.class);
    assertEquals(1, descriptor.getInstallations().length);
    Maven.MavenInstallation maven = descriptor.getInstallations()[0];
    assertEquals("maven3", maven.getName());
    assertEquals("/maven3", maven.getHome());
    InstallSourceProperty installSourceProperty = maven.getProperties().get(InstallSourceProperty.class);
    assertEquals(1, installSourceProperty.installers.size());
    MavenInstaller installer = installSourceProperty.installers.get(MavenInstaller.class);
    assertEquals("3.8.4", installer.id);
}
Also used : Maven(hudson.tasks.Maven) InstallSourceProperty(hudson.tools.InstallSourceProperty) MavenInstaller(hudson.tasks.Maven.MavenInstaller) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Example 3 with InstallSourceProperty

use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.

the class SbtTest method configure_sbt_tool.

@Test
public void configure_sbt_tool() {
    final SbtPluginBuilder.DescriptorImpl descriptor = ExtensionList.lookupSingleton(SbtPluginBuilder.DescriptorImpl.class);
    assertEquals(1, descriptor.getInstallations().length);
    SbtInstallation sbt = descriptor.getInstallations()[0];
    assertEquals("sbt", sbt.getName());
    assertEquals("/usr/bin/sbt", sbt.getHome());
    InstallSourceProperty installSourceProperty = sbt.getProperties().get(InstallSourceProperty.class);
    assertEquals(1, installSourceProperty.installers.size());
    SbtInstaller installer = installSourceProperty.installers.get(SbtInstaller.class);
    assertEquals("1.2.8", installer.id);
}
Also used : InstallSourceProperty(hudson.tools.InstallSourceProperty) SbtInstaller(org.jvnet.hudson.plugins.SbtPluginBuilder.SbtInstaller) SbtPluginBuilder(org.jvnet.hudson.plugins.SbtPluginBuilder) SbtInstallation(org.jvnet.hudson.plugins.SbtPluginBuilder.SbtInstallation) Test(org.junit.Test)

Example 4 with InstallSourceProperty

use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.

the class NodeJSTest method configure_nodejs.

@Test
@ConfiguredWithReadme("nodejs/README.md")
public void configure_nodejs() {
    final NodeJSInstallation.DescriptorImpl descriptor = ExtensionList.lookupSingleton(NodeJSInstallation.DescriptorImpl.class);
    assertEquals(1, descriptor.getInstallations().length);
    final NodeJSInstallation nodejs = descriptor.getInstallations()[0];
    final InstallSourceProperty installSourceProperty = nodejs.getProperties().get(InstallSourceProperty.class);
    final NodeJSInstaller nodeJSInstaller = installSourceProperty.installers.get(NodeJSInstaller.class);
    assertEquals("12.11.1", nodeJSInstaller.id);
    assertEquals(48, nodeJSInstaller.getNpmPackagesRefreshHours().longValue());
}
Also used : NodeJSInstallation(jenkins.plugins.nodejs.tools.NodeJSInstallation) InstallSourceProperty(hudson.tools.InstallSourceProperty) NodeJSInstaller(jenkins.plugins.nodejs.tools.NodeJSInstaller) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Example 5 with InstallSourceProperty

use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.

the class TerraformTest method configure_terraform_tool.

@Test
public void configure_terraform_tool() {
    final TerraformInstallation.DescriptorImpl descriptor = ExtensionList.lookupSingleton(TerraformInstallation.DescriptorImpl.class);
    assertEquals(1, descriptor.getInstallations().length);
    TerraformInstallation terraform = descriptor.getInstallations()[0];
    assertEquals("terraform", terraform.getName());
    assertEquals("/terraform-0.11", terraform.getHome());
    InstallSourceProperty installSourceProperty = terraform.getProperties().get(InstallSourceProperty.class);
    assertEquals(1, installSourceProperty.installers.size());
    TerraformInstaller installer = installSourceProperty.installers.get(TerraformInstaller.class);
    assertEquals("0.11.9-linux-amd64", installer.id);
}
Also used : InstallSourceProperty(hudson.tools.InstallSourceProperty) TerraformInstallation(org.jenkinsci.plugins.terraform.TerraformInstallation) TerraformInstaller(org.jenkinsci.plugins.terraform.TerraformInstaller) Test(org.junit.Test)

Aggregations

InstallSourceProperty (hudson.tools.InstallSourceProperty)9 Test (org.junit.Test)8 ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)3 Maven (hudson.tasks.Maven)2 CommandInstaller (hudson.tools.CommandInstaller)2 ConfiguredWithCode (io.jenkins.plugins.casc.misc.ConfiguredWithCode)2 CustomTool (com.cloudbees.jenkins.plugins.customtools.CustomTool)1 DescriptorImpl (com.cloudbees.jenkins.plugins.customtools.CustomTool.DescriptorImpl)1 JDK (hudson.model.JDK)1 MercurialInstallation (hudson.plugins.mercurial.MercurialInstallation)1 MavenInstaller (hudson.tasks.Maven.MavenInstaller)1 ToolProperty (hudson.tools.ToolProperty)1 ToolPropertyDescriptor (hudson.tools.ToolPropertyDescriptor)1 AdoptOpenJDKInstaller (io.jenkins.plugins.adoptopenjdk.AdoptOpenJDKInstaller)1 FilePathSettingsProvider (jenkins.mvn.FilePathSettingsProvider)1 SettingsProvider (jenkins.mvn.SettingsProvider)1 NodeJSInstallation (jenkins.plugins.nodejs.tools.NodeJSInstallation)1 DescriptorImpl (jenkins.plugins.nodejs.tools.NodeJSInstallation.DescriptorImpl)1 NodeJSInstaller (jenkins.plugins.nodejs.tools.NodeJSInstaller)1 TerraformInstallation (org.jenkinsci.plugins.terraform.TerraformInstallation)1