use of hudson.tools.InstallSourceProperty in project nodejs-plugin by jenkinsci.
the class NodeJSInstallationTest method verify.
private void verify() throws Exception {
NodeJSInstallation[] l = r.get(DescriptorImpl.class).getInstallations();
assertEquals(1, l.length);
r.assertEqualBeans(l[0], new NodeJSInstallation("myNode", "/tmp/foo", JenkinsRule.NO_PROPERTIES), "name,home");
// by default we should get the auto installer
DescribableList<ToolProperty<?>, ToolPropertyDescriptor> props = l[0].getProperties();
assertEquals(1, props.size());
InstallSourceProperty isp = props.get(InstallSourceProperty.class);
assertEquals(1, isp.installers.size());
assertNotNull(isp.installers.get(NodeJSInstaller.class));
}
use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.
the class JdkConfiguratorTest method configure_jdk_tool.
@Test
public void configure_jdk_tool() {
final JDK.DescriptorImpl descriptor = ExtensionList.lookupSingleton(JDK.DescriptorImpl.class);
assertEquals(1, descriptor.getInstallations().length);
JDK jdk = descriptor.getInstallations()[0];
assertEquals("jdk11", jdk.getName());
assertEquals("/jdk", jdk.getHome());
InstallSourceProperty installSourceProperty = jdk.getProperties().get(InstallSourceProperty.class);
assertEquals(1, installSourceProperty.installers.size());
AdoptOpenJDKInstaller installer = installSourceProperty.installers.get(AdoptOpenJDKInstaller.class);
assertEquals("jdk-11.0.14+9", installer.id);
}
use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.
the class MercurialTest method should_configure_maven_tools_and_global_config.
@Test
@ConfiguredWithReadme("mercurial/README.md")
public void should_configure_maven_tools_and_global_config() {
final Object descriptor = j.jenkins.getDescriptorOrDie(MercurialInstallation.class);
Assert.assertNotNull(descriptor);
Assert.assertEquals(1, ((MercurialInstallation.DescriptorImpl) descriptor).getInstallations().length);
MercurialInstallation mercurial = ((MercurialInstallation.DescriptorImpl) descriptor).getInstallations()[0];
Assert.assertEquals("Mercurial 3", mercurial.getName());
Assert.assertEquals("/mercurial", mercurial.getHome());
Assert.assertEquals("[defaults]\n" + "clone = --uncompressed\n" + "bundle = --type none", mercurial.getConfig());
Assert.assertEquals("INSTALLATION/bin/hg", mercurial.getExecutable());
Assert.assertTrue(mercurial.isUseCaches());
Assert.assertFalse(mercurial.getDebug());
Assert.assertFalse(mercurial.getDebug());
Assert.assertEquals("/cache/root", mercurial.getMasterCacheRoot());
Assert.assertFalse(mercurial.isUseSharing());
InstallSourceProperty installSourceProperty = mercurial.getProperties().get(InstallSourceProperty.class);
Assert.assertEquals(1, installSourceProperty.installers.size());
CommandInstaller installer = installSourceProperty.installers.get(CommandInstaller.class);
Assert.assertEquals("mercurial", installer.getToolHome());
Assert.assertEquals("SomeLabel", installer.getLabel());
Assert.assertEquals("[ -d mercurial ] || wget -q -O - http://www.archlinux.org/packages/extra/x86_64/mercurial/download/ | xzcat | tar xvf -", installer.getCommand());
}
use of hudson.tools.InstallSourceProperty in project configuration-as-code-plugin by jenkinsci.
the class MavenConfiguratorTest method should_configure_maven_tools_and_global_config.
@Test
@ConfiguredWithCode("MavenConfiguratorTest.yml")
public void should_configure_maven_tools_and_global_config() {
final Maven.DescriptorImpl descriptor = (Maven.DescriptorImpl) j.jenkins.getDescriptorOrDie(Maven.class);
Assert.assertEquals(1, descriptor.getInstallations().length);
Assert.assertEquals("/usr/share/maven", descriptor.getInstallations()[0].getHome());
InstallSourceProperty installSourceProperty = descriptor.getInstallations()[0].getProperties().get(InstallSourceProperty.class);
Assert.assertEquals("3.5.0", installSourceProperty.installers.get(Maven.MavenInstaller.class).id);
final SettingsProvider provider = GlobalMavenConfig.get().getSettingsProvider();
Assert.assertTrue(provider instanceof FilePathSettingsProvider);
Assert.assertEquals("/usr/share/maven-settings.xml", ((FilePathSettingsProvider) provider).getPath());
}
Aggregations