use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme 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 io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class ProxyTest method configure_proxy.
@Test
@ConfiguredWithReadme("proxy/README.md")
public void configure_proxy() {
final ProxyConfiguration proxy = Jenkins.get().proxy;
assertNotNull(proxy);
assertThat(proxy.getSecretPassword(), hasPlainText("password"));
assertThat(proxy.getTestUrl(), is("http://google.com"));
assertThat(proxy.getUserName(), is("login"));
assertThat(proxy.name, is("proxyhost"));
assertThat(proxy.noProxyHost, is("externalhost"));
assertThat(proxy.port, is(80));
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class StatisticsGathererTest method configure_statistics.
@Test
@ConfiguredWithReadme("statistics-gatherer/README.md")
public void configure_statistics() {
StatisticsConfiguration config = StatisticsConfiguration.get();
assertNotNull(config);
assertThat(config.getBuildUrl(), containsString("http://elasticsearch:9200/jenkins-stats/builds"));
assertTrue(config.getShouldSendApiHttpRequests());
assertTrue(config.getBuildInfo());
assertFalse(config.getQueueInfo());
assertFalse(config.getProjectInfo());
assertFalse(config.getBuildStepInfo());
assertTrue(config.getScmCheckoutInfo());
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class TopReadmeTest method configure_demo_third_code_block.
@Test
@ConfiguredWithReadme("README.md#2")
public void configure_demo_third_code_block() {
final Jenkins jenkins = Jenkins.get();
assertEquals(2, jenkins.getNodes().size());
assertEquals("static-agent1", jenkins.getNode("static-agent1").getNodeName());
assertEquals("static-agent2", jenkins.getNode("static-agent2").getNodeName());
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class TopReadmeTest method configure_demo_second_code_block.
@Test
@ConfiguredWithReadme("README.md#1")
public void configure_demo_second_code_block() {
final Jenkins jenkins = Jenkins.get();
final LDAPSecurityRealm securityRealm = (LDAPSecurityRealm) jenkins.getSecurityRealm();
assertEquals(1, securityRealm.getConfigurations().size());
}
Aggregations