use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class MavenConfiguratorTest method export_maven_tool.
@Test
@ConfiguredWithReadme("maven/README.md#0")
public void export_maven_tool() throws Exception {
ConfiguratorRegistry registry = ConfiguratorRegistry.get();
ConfigurationContext context = new ConfigurationContext(registry);
CNode yourAttribute = getToolRoot(context).get("maven");
String exported = toYamlString(yourAttribute);
String expected = toStringFromYamlFile(this, "MavenConfiguratorTestExpected.yml");
assertThat(exported, is(expected));
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class MavenConfiguratorTest method configure_maven_global_config.
@Test
@ConfiguredWithReadme("maven/README.md#1")
public void configure_maven_global_config() {
final GlobalMavenConfig descriptor = ExtensionList.lookupSingleton(GlobalMavenConfig.class);
assertThat(descriptor.getGlobalSettingsProvider(), instanceOf(DefaultGlobalSettingsProvider.class));
assertThat(descriptor.getSettingsProvider(), instanceOf(DefaultSettingsProvider.class));
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class MavenConfiguratorTest method export_maven_global_config.
@Test
@ConfiguredWithReadme("maven/README.md#1")
public void export_maven_global_config() throws Exception {
ConfiguratorRegistry registry = ConfiguratorRegistry.get();
ConfigurationContext context = new ConfigurationContext(registry);
CNode yourAttribute = getToolRoot(context).get("mavenGlobalConfig");
String exported = toYamlString(yourAttribute);
String expected = toStringFromYamlFile(this, "MavenConfiguratorTestGlobalConfigExpected.yml");
assertThat(exported, is(expected));
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class KubernetesCloudTest method configure_kubernetes_cloud.
@Test
@ConfiguredWithReadme("kubernetes/README.md")
public void configure_kubernetes_cloud() {
final KubernetesCloud cloud = j.jenkins.clouds.get(KubernetesCloud.class);
assertNotNull(cloud);
assertEquals("advanced-k8s-config", cloud.name);
assertEquals("https://avanced-k8s-config:443", cloud.getServerUrl());
assertEquals("serverCertificate", cloud.getServerCertificate());
assertTrue(cloud.isSkipTlsVerify());
assertEquals("default", cloud.getNamespace());
assertEquals("http://jenkins/", cloud.getJenkinsUrl());
assertEquals("advanced-k8s-credentials", cloud.getCredentialsId());
assertEquals("jenkinsTunnel", cloud.getJenkinsTunnel());
assertEquals(42, cloud.getContainerCap());
assertEquals(5, cloud.getRetentionTimeout());
assertEquals(10, cloud.getConnectTimeout());
assertEquals(20, cloud.getReadTimeout());
assertEquals("64", cloud.getMaxRequestsPerHostStr());
final List<PodTemplate> templates = cloud.getTemplates();
assertEquals(2, templates.size());
final PodTemplate template = templates.get(0);
assertEquals("test", template.getName());
assertEquals("serviceAccount", template.getServiceAccount());
assertEquals(1234, template.getInstanceCap());
assertEquals("label", template.getLabel());
final List<PodVolume> volumes = template.getVolumes();
assertEquals(1, volumes.size());
final PodVolume volume = volumes.get(0);
assertTrue(volume instanceof HostPathVolume);
assertEquals("mountPath", volume.getMountPath());
assertEquals("hostPath", ((HostPathVolume) volume).getHostPath());
final List<TemplateEnvVar> envVars = template.getEnvVars();
assertEquals(1, envVars.size());
final KeyValueEnvVar envVar = (KeyValueEnvVar) envVars.get(0);
assertEquals("FOO", envVar.getKey());
assertEquals("BAR", envVar.getValue());
final PodTemplate template1 = templates.get(1);
assertEquals("k8s-agent", template1.getName());
assertEquals("default", template1.getNamespace());
assertEquals(Mode.EXCLUSIVE, template1.getNodeUsageMode());
}
use of io.jenkins.plugins.casc.misc.ConfiguredWithReadme in project configuration-as-code-plugin by jenkinsci.
the class MSTestRunnerTest method configure_mstestrunner.
@Test
@ConfiguredWithReadme("mstestrunner/README.md")
public void configure_mstestrunner() {
final DescriptorImpl msTestRunnerDescriptor = ExtensionList.lookupSingleton(DescriptorImpl.class);
assertNotNull(msTestRunnerDescriptor);
assertEquals(1, msTestRunnerDescriptor.getInstallations().length);
final MsTestInstallation msTestRunnerInstallation = msTestRunnerDescriptor.getInstallations()[0];
assertEquals("MSTest test", msTestRunnerInstallation.getName());
assertEquals("C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\MSTest.exe", msTestRunnerInstallation.getHome());
assertEquals("/category:SmokeTests", msTestRunnerInstallation.getDefaultArgs());
assertTrue(msTestRunnerInstallation.getOmitNoIsolation());
}
Aggregations