当前位置: 首页>>代码示例>>Java>>正文


Java PackageConfiguration.add方法代码示例

本文整理汇总了Java中com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration.add方法的典型用法代码示例。如果您正苦于以下问题:Java PackageConfiguration.add方法的具体用法?Java PackageConfiguration.add怎么用?Java PackageConfiguration.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration的用法示例。


在下文中一共展示了PackageConfiguration.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPackageConfiguration

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Override
@EntryPoint
public PackageConfiguration getPackageConfiguration() {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME)
            .withDisplayName("Module Name")
            .withPartOfIdentity(true)
            .withDisplayOrder(0)
            .build());
    packageConfig.add(property(LOWER_VERSION_BOUND_INCLUSIVE)
            .withRequired(false)
            .withDisplayName("Version to poll >=")
            .withPartOfIdentity(false)
            .withDisplayOrder(1)
            .build());
    packageConfig.add(property(UPPER_VERSION_BOUND_EXCLUSIVE)
            .withRequired(false)
            .withDisplayName("Version to poll <")
            .withPartOfIdentity(false)
            .withDisplayOrder(2)
            .build());
    return packageConfig;
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:24,代码来源:ForgePollerPluginConfig.java

示例2: shouldFailValidationIfSpuriousPropertiesAreConfigured

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldFailValidationIfSpuriousPropertiesAreConfigured() {
    ValidationResult validationResult = new ValidationResult();
    PackageConfiguration packageConfigurations = new PackageConfiguration();
    RepositoryConfiguration repositoryConfiguration = new RepositoryConfiguration();
    packageConfigurations.add(new PackageMaterialProperty("PACKAGE_NAME", "foo"));
    packageConfigurations.add(new PackageMaterialProperty("foo1", "foo"));
    packageConfigurations.add(new PackageMaterialProperty("foo2", "foo"));
    repositoryConfiguration.add(new PackageMaterialProperty("bar1", "bar"));
    repositoryConfiguration.add(new PackageMaterialProperty("bar2", "bar"));
    repositoryConfiguration.add(new PackageMaterialProperty("REPO_URL", "http://asdsa"));
    new DebRepositoryConfiguration().validate(packageConfigurations, repositoryConfiguration, validationResult);
    assertThat(validationResult.isSuccessful(), is(false));
    assertThat(validationResult.getErrors().contains(new ValidationError("", "Unsupported key(s) found : bar1, bar2. Allowed key(s) are : REPO_URL")), is(true));
    assertThat(validationResult.getErrors().contains(new ValidationError("", "Unsupported key(s) found : foo1, foo2. Allowed key(s) are : PACKAGE_NAME, VERSION_SPEC, ARCHITECTURE")), is(true));
}
 
开发者ID:gocd-contrib,项目名称:deb-repo-poller,代码行数:17,代码来源:DebRepositoryConfigurationTest.java

示例3: shouldThrowExceptionGivenEmptyRepo_getLatestRevision

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldThrowExceptionGivenEmptyRepo_getLatestRevision() throws Exception {
    RepositoryConfiguration repositoryPackageConfigurations = new RepositoryConfiguration();
    File emptyRepo = new File(getClass().getResource("/repos/emptyrepo").toURI());
    repositoryPackageConfigurations.add(new PackageMaterialProperty(Constants.REPO_URL, "file://" + emptyRepo.getAbsolutePath()));
    PackageConfiguration packagePackageConfigurations = new PackageConfiguration();
    packagePackageConfigurations.add(new PackageMaterialProperty(Constants.PACKAGE_NAME, "crap-artifact"));
    try {
        poller.getLatestRevision(packagePackageConfigurations, repositoryPackageConfigurations);
        fail("");
    } catch (RuntimeException e) {
        String expectedMessage = "Invalid file path.";
        String actualMessage = e.getMessage();
        assertThat(actualMessage.startsWith(expectedMessage), is((true)));
    }
}
 
开发者ID:gocd-contrib,项目名称:deb-repo-poller,代码行数:17,代码来源:DebRepositoryPollerTest.java

示例4: getPackageConfiguration

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Override
public PackageConfiguration getPackageConfiguration() {
    LOGGER.debug("getPackageConfiguration called.");
    PackageConfiguration packageConfig = new PackageConfiguration();

    packageConfig.add(space);
    packageConfig.add(appName);
    packageConfig.add(orgName);
    return packageConfig;
}
 
开发者ID:Sounie,项目名称:springer-gocd-cloudfoundry-plugin,代码行数:11,代码来源:CloudFoundryConfig.java

示例5: shouldRejectUnsupportedTagsInPkgConfig

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldRejectUnsupportedTagsInPkgConfig() {
    PackageConfiguration pkgConfig = new PackageConfiguration();
    pkgConfig.add(new PackageMaterialProperty(PACKAGE_ID, "abc"));
    pkgConfig.add(new PackageMaterialProperty("unsupported_key", "value"));
    assertForPackageConfigurationErrors(
            pkgConfig,
            asList(new ValidationError("Unsupported key: unsupported_key. Valid keys: " + Arrays.toString(NpmPackageConfig.getValidKeys()))),
            false);
}
 
开发者ID:varchev,项目名称:go-npm-poller,代码行数:11,代码来源:PluginConfigTest.java

示例6: factoryCreatesInstance

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void factoryCreatesInstance() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));
    packageConfig.add(property(LOWER_VERSION_BOUND_INCLUSIVE, "1.0.0"));
    packageConfig.add(property(UPPER_VERSION_BOUND_EXCLUSIVE, "1.1.0"));

    ModuleSpec moduleSpec = new ModuleSpec.Factory().build(packageConfig);

    assertThat(moduleSpec.getName(), is("puppetlabs/apache"));
    assertThat(moduleSpec.getLowerVersionBound(), is(Version.of("1.0.0")));
    assertThat(moduleSpec.getUpperVersionBound(), is(Version.of("1.1.0")));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:14,代码来源:ModuleSpecTest.java

示例7: factoryIgnoresNullVersionNumbers

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
//TODO: does this actually happen?
public void factoryIgnoresNullVersionNumbers() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));
    packageConfig.add(property(LOWER_VERSION_BOUND_INCLUSIVE, null));
    packageConfig.add(property(UPPER_VERSION_BOUND_EXCLUSIVE, null));

    ModuleSpec moduleSpec = new ModuleSpec.Factory().build(packageConfig);

    assertThat(moduleSpec.getLowerVersionBound(), is(Version.ZERO));
    assertThat(moduleSpec.getUpperVersionBound(), is(Version.INFINITY));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:14,代码来源:ModuleSpecTest.java

示例8: factoryIgnoresMissingVersionNumbers

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
/**
 * This happens when checking the connection to the repository after creating the resource
 */
@Test
public void factoryIgnoresMissingVersionNumbers() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));

    ModuleSpec moduleSpec = new ModuleSpec.Factory().build(packageConfig);

    assertThat(moduleSpec.getLowerVersionBound(), is(Version.ZERO));
    assertThat(moduleSpec.getUpperVersionBound(), is(Version.INFINITY));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:14,代码来源:ModuleSpecTest.java

示例9: factoryIgnoresEmptyVersionNumbers

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void factoryIgnoresEmptyVersionNumbers() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));
    packageConfig.add(property(LOWER_VERSION_BOUND_INCLUSIVE, " "));
    packageConfig.add(property(UPPER_VERSION_BOUND_EXCLUSIVE, "  "));

    ModuleSpec moduleSpec = new ModuleSpec.Factory().build(packageConfig);

    assertThat(moduleSpec.getLowerVersionBound(), is(Version.ZERO));
    assertThat(moduleSpec.getUpperVersionBound(), is(Version.INFINITY));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:13,代码来源:ModuleSpecTest.java

示例10: shouldAcceptPackageConfigIfNoVersionsSpecified

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldAcceptPackageConfigIfNoVersionsSpecified() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));

    ValidationResult validationResult = config.isPackageConfigurationValid(packageConfig, new RepositoryConfiguration());

    assertThat(validationResult.isSuccessful(), is(true));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:10,代码来源:ForgePollerPluginConfigTest.java

示例11: shouldRejectPackageConfigIfModuleNameIsEmpty

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldRejectPackageConfigIfModuleNameIsEmpty() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "  "));

    ValidationResult validationResult = config.isPackageConfigurationValid(packageConfig, new RepositoryConfiguration());

    assertThat(validationResult.isSuccessful(), is(false));
    assertThat(validationResult.getMessages(), hasItem(equalTo("Module name is mandatory")));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:11,代码来源:ForgePollerPluginConfigTest.java

示例12: shouldRejectPackageConfigIfModuleNameIsNull

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldRejectPackageConfigIfModuleNameIsNull() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, null));

    ValidationResult validationResult = config.isPackageConfigurationValid(packageConfig, new RepositoryConfiguration());

    assertThat(validationResult.isSuccessful(), is(false));
    assertThat(validationResult.getMessages(), hasItem(equalTo("Module name is mandatory")));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:11,代码来源:ForgePollerPluginConfigTest.java

示例13: shouldRejectPackageConfigIfModuleNameInWrongFormat

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldRejectPackageConfigIfModuleNameInWrongFormat() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "apache"));

    ValidationResult validationResult = config.isPackageConfigurationValid(packageConfig, new RepositoryConfiguration());

    assertThat(validationResult.isSuccessful(), is(false));
    assertThat(validationResult.getMessages(), hasItem(equalTo("Module name should be in format \"author/module\"")));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:11,代码来源:ForgePollerPluginConfigTest.java

示例14: shouldRejectPackageConfigIfLowerVersionBoundInWrongFormat

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldRejectPackageConfigIfLowerVersionBoundInWrongFormat() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));
    packageConfig.add(property(LOWER_VERSION_BOUND_INCLUSIVE, "XX Bad format XX"));

    ValidationResult validationResult = config.isPackageConfigurationValid(packageConfig, new RepositoryConfiguration());

    assertThat(validationResult.isSuccessful(), is(false));
    assertThat(validationResult.getMessages(), hasItem(equalTo("Version to poll >= should be a version number")));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:12,代码来源:ForgePollerPluginConfigTest.java

示例15: shouldRejectPackageConfigIfUpperVersionBoundInWrongFormat

import com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration; //导入方法依赖的package包/类
@Test
public void shouldRejectPackageConfigIfUpperVersionBoundInWrongFormat() throws Exception {
    PackageConfiguration packageConfig = new PackageConfiguration();
    packageConfig.add(property(MODULE_NAME, "puppetlabs/apache"));
    packageConfig.add(property(UPPER_VERSION_BOUND_EXCLUSIVE, "XX Bad format XX"));

    ValidationResult validationResult = config.isPackageConfigurationValid(packageConfig, new RepositoryConfiguration());

    assertThat(validationResult.isSuccessful(), is(false));
    assertThat(validationResult.getMessages(), hasItem(equalTo("Version to poll < should be a version number")));
}
 
开发者ID:drrb,项目名称:go-puppet-forge-poller,代码行数:12,代码来源:ForgePollerPluginConfigTest.java


注:本文中的com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。