Search in sources :

Example 1 with MercurialInstallation

use of hudson.plugins.mercurial.MercurialInstallation 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());
}
Also used : CommandInstaller(hudson.tools.CommandInstaller) InstallSourceProperty(hudson.tools.InstallSourceProperty) MercurialInstallation(hudson.plugins.mercurial.MercurialInstallation) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Aggregations

MercurialInstallation (hudson.plugins.mercurial.MercurialInstallation)1 CommandInstaller (hudson.tools.CommandInstaller)1 InstallSourceProperty (hudson.tools.InstallSourceProperty)1 ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)1 Test (org.junit.Test)1