use of org.jenkinsci.test.acceptance.plugins.config_file_provider.ConfigFileProvider in project acceptance-test-harness by jenkinsci.
the class JobDslPluginTest method should_ignore_removed_config_files.
/**
* Verifies whether a previously generated config file will be ignored if it
* is not referenced anymore.
*/
@Test
@WithPlugins("config-file-provider")
public void should_ignore_removed_config_files() {
FreeStyleJob seedJob = executeRemovedConfigFilesAction(JobDslRemovedConfigFilesAction.IGNORE);
Build build = seedJob.scheduleBuild().shouldSucceed();
Pattern expected = Pattern.compile("Unreferenced config files:(\\s*)GeneratedConfigFile[{]name='Old_Config_File', id='123456789'}");
assertThat(build.getConsole(), containsRegexp(expected));
ConfigFileProvider configFileProvider = new ConfigFileProvider(jenkins);
configFileProvider.open();
assertThat(driver, hasElement(by.xpath("//a[@href='editConfig?id=123456789']")));
}
use of org.jenkinsci.test.acceptance.plugins.config_file_provider.ConfigFileProvider in project acceptance-test-harness by jenkinsci.
the class JobDslPluginTest method should_delete_removed_config_files.
/**
* Verifies whether a previously generated config file will be deleted if it
* is not referenced anymore.
*/
@Test
@WithPlugins("config-file-provider")
public void should_delete_removed_config_files() {
FreeStyleJob seedJob = executeRemovedConfigFilesAction(JobDslRemovedConfigFilesAction.DELETE);
Build build = seedJob.scheduleBuild().shouldSucceed();
Pattern expected = Pattern.compile("Unreferenced config files:(\\s*)GeneratedConfigFile[{]name='Old_Config_File', id='123456789'}");
assertThat(build.getConsole(), containsRegexp(expected));
ConfigFileProvider configFileProvider = new ConfigFileProvider(jenkins);
configFileProvider.open();
assertThat(driver, not(hasElement(by.xpath("//a[@href='editConfig?id=123456789']"))));
}
use of org.jenkinsci.test.acceptance.plugins.config_file_provider.ConfigFileProvider in project acceptance-test-harness by jenkinsci.
the class ConfigFileProviderTest method createCustomConfig.
private CustomConfig createCustomConfig() {
final CustomConfig customConfig = new ConfigFileProvider(jenkins).addFile(CustomConfig.class);
customConfig.content(CUSTOM_CONF_CONTENT);
customConfig.save();
return customConfig;
}
use of org.jenkinsci.test.acceptance.plugins.config_file_provider.ConfigFileProvider in project acceptance-test-harness by jenkinsci.
the class ConfigFileProviderTest method createMavenSettingsConfig.
private MavenSettingsConfig createMavenSettingsConfig(final String serverId, final String credId) {
final MavenSettingsConfig mvnConfig = new ConfigFileProvider(jenkins).addFile(MavenSettingsConfig.class);
mvnConfig.content(String.format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" \n" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" + " xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd\">\n" + " \n" + " <servers>\n" + " <server>\n" + " <id>%s</id>\n" + " </server>\n" + " </servers>\n" + "\n" + "</settings>", serverId));
final ServerCredentialMapping serverCred = mvnConfig.addServerCredentialMapping();
serverCred.serverId(serverId);
serverCred.credentialsId(credId);
mvnConfig.save();
return mvnConfig;
}
use of org.jenkinsci.test.acceptance.plugins.config_file_provider.ConfigFileProvider in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method configureCloudInit.
private void configureCloudInit(String cloudInitName) {
ConfigFileProvider fileProvider = new ConfigFileProvider(jenkins);
UserDataConfig cloudInit = fileProvider.addFile(UserDataConfig.class);
cloudInit.name(CLOUD_INIT_NAME);
cloudInit.content(resource("/openstack_plugin/" + cloudInitName).asText());
cloudInit.save();
}
Aggregations