Search in sources :

Example 1 with NPMConfigProvider

use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.

the class NodeJSBuildWrapperTest method createSetting.

private Config createSetting(String id, String content, List<NPMRegistry> registries) {
    String providerId = new NPMConfigProvider().getProviderId();
    Config config = new NPMConfig(id, null, null, content, providerId, registries);
    GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
    globalConfigFiles.save(config);
    return config;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) GlobalConfigFiles(org.jenkinsci.plugins.configfiles.GlobalConfigFiles) Config(org.jenkinsci.lib.configprovider.model.Config) NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig)

Example 2 with NPMConfigProvider

use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.

the class NodeJSCommandInterpreterTest method createSetting.

private Config createSetting(String id, String content, List<NPMRegistry> registries) {
    String providerId = new NPMConfigProvider().getProviderId();
    Config config = new NPMConfig(id, null, null, content, providerId, registries);
    GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
    globalConfigFiles.save(config);
    return config;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) GlobalConfigFiles(org.jenkinsci.plugins.configfiles.GlobalConfigFiles) Config(org.jenkinsci.lib.configprovider.model.Config) NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig)

Example 3 with NPMConfigProvider

use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.

the class NPMConfigTest method test_load_template.

@Test
public void test_load_template() {
    Descriptor<?> descriptor = j.jenkins.getDescriptor(NPMConfig.class);
    assertNotNull("NPMConfi descriptor not registered", descriptor);
    assertThat("Unexpected descriptor class", descriptor, instanceOf(NPMConfigProvider.class));
    NPMConfigProvider provider = (NPMConfigProvider) descriptor;
    Config config = provider.newConfig("testId");
    assertThat("Unexpected config class", config, instanceOf(NPMConfig.class));
    assertThat("Expected the default template, instead got empty", config.content, allOf(notNullValue(), is(not(""))));
}
Also used : NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) Config(org.jenkinsci.lib.configprovider.model.Config) Test(org.junit.Test)

Example 4 with NPMConfigProvider

use of jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider in project nodejs-plugin by jenkinsci.

the class NpmrcFileSupplyTest method createSetting.

private Config createSetting(String id, String content, List<NPMRegistry> registries) {
    String providerId = new NPMConfigProvider().getProviderId();
    Config config = new NPMConfig(id, null, null, content, providerId, registries);
    GlobalConfigFiles globalConfigFiles = j.jenkins.getExtensionList(GlobalConfigFiles.class).get(GlobalConfigFiles.class);
    globalConfigFiles.save(config);
    return config;
}
Also used : NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig) NPMConfigProvider(jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider) GlobalConfigFiles(org.jenkinsci.plugins.configfiles.GlobalConfigFiles) Config(org.jenkinsci.lib.configprovider.model.Config) NPMConfig(jenkins.plugins.nodejs.configfiles.NPMConfig)

Aggregations

NPMConfigProvider (jenkins.plugins.nodejs.configfiles.NPMConfig.NPMConfigProvider)4 Config (org.jenkinsci.lib.configprovider.model.Config)4 NPMConfig (jenkins.plugins.nodejs.configfiles.NPMConfig)3 GlobalConfigFiles (org.jenkinsci.plugins.configfiles.GlobalConfigFiles)3 Test (org.junit.Test)1