use of hudson.tools.CommandInstaller 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());
}
use of hudson.tools.CommandInstaller 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());
}
Aggregations