• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ErrorCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.atlassian.bamboo.utils.error.ErrorCollection的典型用法代码示例。如果您正苦于以下问题:Java ErrorCollection类的具体用法?Java ErrorCollection怎么用?Java ErrorCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ErrorCollection类属于com.atlassian.bamboo.utils.error包,在下文中一共展示了ErrorCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
	super.validate(params, errorCollection);

	if (StringUtils.isEmpty(params.getString(DeployTaskConstants.STACK_NAME)))
	{
		errorCollection.addError(DeployTaskConstants.STACK_NAME, textProvider.getText("bamboo-opsworks.stack_name.required"));
	}
	if (StringUtils.isEmpty(params.getString(DeployTaskConstants.APP_NAME)))
	{
		errorCollection.addError(DeployTaskConstants.APP_NAME, textProvider.getText("bamboo-opsworks.app_name.required"));
	}
	
	if(StringUtils.isEmpty(params.getString(AWSConstants.ACCESS_KEY_ID))
			&& !StringUtils.isEmpty(params.getString(AWSConstants.SECRET_ACCESS_KEY))) {
		errorCollection.addError(AWSConstants.ACCESS_KEY_ID, textProvider.getText("bamboo-opsworks.access_key_id.required_with_secret"));
	}
	
	if(StringUtils.isEmpty(params.getString(AWSConstants.SECRET_ACCESS_KEY))
			&& !StringUtils.isEmpty(params.getString(AWSConstants.ACCESS_KEY_ID))) {
		errorCollection.addError(AWSConstants.SECRET_ACCESS_KEY, textProvider.getText("bamboo-opsworks.secret_access_key.required_with_access"));
	}
}
 
开发者ID:KabbageInc,项目名称:bamboo-opsworks,代码行数:25,代码来源:DeployTaskConfigurator.java


示例2: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
    super.validate(params, errorCollection);
    
    this.validator.params = params;
    this.validator.errorCollection = errorCollection;
    this.errorCollection = errorCollection;

    validator.validateZsUrl();
    validator.validateApiKey();
    validator.validateApiSecret();
    validator.validateAppName();
    validator.validateBaseUrl();
    validator.validateZsVersion();
    validateRetry(params.getString("retry"));
    validateWaittime(params.getString("waittime"));
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:18,代码来源:RollbackTaskConfigurator.java


示例3: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
    super.validate(params, errorCollection);
    
    this.validator.params = params;
    this.validator.errorCollection = errorCollection;
    this.errorCollection = errorCollection;

    validator.validateZsUrl();
    validator.validateApiKey();
    validator.validateApiSecret();
    validator.validateAppName();
    validator.validateBaseUrl();
    validator.validateZsVersion();
    validateRetry(params.getString("retry"));
    validateWaittime(params.getString("waittime"));
    
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:20,代码来源:DeploymentCheckTaskConfigurator.java


示例4: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
/**
 * Validate gui form when Saving params
 */
@Override
public void validate(ActionParametersMap params, ErrorCollection errorCollection) {
    super.validate(params, errorCollection);
    utils.getNotifier().notifyInfo("Validating BlazeMeter task settings before saving.");
    final String selectedTest = Utils.cutTestType(params.getString(Constants.SETTINGS_SELECTED_TEST_ID));
    fillErrorCollection(selectedTest, errorCollection);
    if (errorCollection.hasAnyErrors()) {
        return;
    }
    try {
        if (StringUtils.isBlank(User.getUser(utils).getId())) {
            errorCollection.addErrorMessage("Cannot load tests from BlazeMeter server. Invalid user key!");
        } else {
            //verify if the test still exists on BlazeMeter server
            AbstractTest receivedTest = TestDetector.detectTest(utils, selectedTest);
            if (receivedTest == null) {
                errorCollection.addErrorMessage("Test '" + selectedTest + "' doesn't exits on BlazeMeter server.");
            }
        }
    } catch (Exception e) {
        errorCollection.addErrorMessage("Failed to get tests from BlazeMeter account: " + e.getMessage());
    }
    utils.getNotifier().notifyInfo("BlazeMeter task settings were validated and saved.");
}
 
开发者ID:Blazemeter,项目名称:blazemeter-bamboo-plugin,代码行数:28,代码来源:ConfigTask.java


示例5: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
public void validate(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection) {
    super.validate(params, errorCollection);

    final String directory = params.getString(xUnitParserTask.TEST_FILE_PATTERN);
    if (StringUtils.isEmpty(directory))
    {
        errorCollection.addError(xUnitParserTask.TEST_FILE_PATTERN, i18nResolver.getText(xUnitParserTask.TEST_FILE_PATTERN + ".error"));
    }
}
 
开发者ID:wwwlicious,项目名称:wwwlicious.bamboo.xunit,代码行数:10,代码来源:xUnitParserConfigurator.java


示例6: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(ActionParametersMap params, ErrorCollection errorCollection) {
	validateRequired(params, errorCollection, CFG_SELECTED_UTIL);
	validateRequired(params, errorCollection, CFG_SELECTED_CRED);
	validateRequired(params, errorCollection, CFG_APP_ID);
	validateNumber(params, errorCollection, CFG_MAX_HIGH);
	validateNumber(params, errorCollection, CFG_MAX_MEDIUM);
	validateNumber(params, errorCollection, CFG_MAX_LOW);
}
 
开发者ID:AppSecDev,项目名称:asoc-bamboo-plugin,代码行数:10,代码来源:SASTScanTaskConfigurator.java


示例7: checkValidationErrors

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
private void checkValidationErrors(final HubScanConfigFieldEnum field,
        final ValidationResults result,
        final ErrorCollection errorCollection) {

    if (result.hasErrors()) {
        final String message = result.getResultString(field);
        errorCollection.addError(field.getKey(), message);
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-bamboo,代码行数:10,代码来源:HubScanTaskConfigurator.java


示例8: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@NotNull
@Override
public ErrorCollection validate(@NotNull BuildConfiguration buildConfiguration) {
    ErrorCollection errors = super.validate(buildConfiguration);
    String url = buildConfiguration.getString(WEB_REPOSITORY_URL, "");
    if (url.isEmpty()) {
        errors.addError("webRepositoryUrl", "This field is required");
    } else if (!UrlUtils.verifyHierachicalURI(url)) {
        errors.addError("webRepositoryUrl", "This is not a valid URL");
    }
    return errors;
}
 
开发者ID:zero1zero,项目名称:bamboo-gitlab-plugin,代码行数:13,代码来源:GitLabWebRepositoryViewer.java


示例9: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(@NotNull ActionParametersMap params, @NotNull ErrorCollection errorCollection)
{
    super.validate(params, errorCollection);

    if (StringUtils.isEmpty(params.getString(CheckStyleTaskConfigurator.CHECKSTYLE_PATH)))
    {
        errorCollection.addError(CheckStyleTaskConfigurator.CHECKSTYLE_PATH, "Please specify the directory containing the XML CheckStyle output files.");
    }
}
 
开发者ID:javiergutites,项目名称:bamboo-checkstyle-plugin,代码行数:11,代码来源:CheckStyleTaskConfigurator.java


示例10: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
    super.validate(params, errorCollection);

    this.validator.params = params;
    this.validator.errorCollection = errorCollection;
    
    validator.validateZsUrl();
    validator.validateApiKey();
    validator.validateApiSecret();
    validator.validateAppName();
    validator.validateBaseUrl();
    validator.validateZsVersion();
    validator.validateCustomZpkFilename();
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:16,代码来源:DeploymentTaskConfigurator.java


示例11: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
    super.validate(params, errorCollection);
    
    this.validator.params = params;
    this.validator.errorCollection = errorCollection;
    
    validator.validateCustomZpkFilename();
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:10,代码来源:PackagingTaskConfigurator.java


示例12: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection)
{
    super.validate(params, errorCollection);
    
    this.validator.params = params;
    this.validator.errorCollection = errorCollection;
    this.errorCollection = errorCollection;

    validator.validateZsUrl();
    validator.validateApiKey();
    validator.validateApiSecret();
    validator.validateAppName();
    validator.validateZsVersion();
}
 
开发者ID:zend-patterns,项目名称:ZendServerBamboo,代码行数:15,代码来源:StatisticsTaskConfigurator.java


示例13: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(@NotNull final ActionParametersMap params,
		@NotNull final ErrorCollection errorCollection) {
	super.validate(params, errorCollection);

	final String hammerValue = params.getString("hammer");
	if (StringUtils.isEmpty(hammerValue)) {
		errorCollection.addError("hammer",
				textProvider.getText("daticaldb.hammer.error"));
	}

	final String driversValue = params.getString("drivers");
	if (StringUtils.isEmpty(driversValue)) {
		errorCollection.addError("drivers",
				textProvider.getText("daticaldb.drivers.error"));
	}

	final String projectDirValue = params.getString("projectDir");
	if (StringUtils.isEmpty(projectDirValue)) {
		errorCollection.addError("projectDir",
				textProvider.getText("daticaldb.projectDir.error"));
	}

	
	final String commandValue = params.getString("projectDir");
	if (StringUtils.isEmpty(commandValue)) {
		errorCollection.addError("command",
				textProvider.getText("daticaldb.command.error"));
	}
	
}
 
开发者ID:Datical,项目名称:DaticalDB4Bamboo,代码行数:32,代码来源:DaticalDBTaskConfigurator.java


示例14: fillErrorCollection

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
private void fillErrorCollection(String selectedTest, ErrorCollection errorCollection) {
    if (StringUtils.isEmpty(selectedTest) | selectedTest.contains(CHECK_CREDENTIALS)) {
        errorCollection.addErrorMessage(CHECK_CREDENTIALS + CHECK_TESTS);
    }
    if (selectedTest.contains(WORKSPACE)) {
        errorCollection.addErrorMessage("Cannot save workspace as a test. Please, select correct test.");
    }
    if (selectedTest.contains(NO_TESTS)) {
        errorCollection.addErrorMessage("No tests in current workspace. Please, select correct test.");
    }
}
 
开发者ID:Blazemeter,项目名称:blazemeter-bamboo-plugin,代码行数:12,代码来源:ConfigTask.java


示例15: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
    public void validate(@NotNull final ActionParametersMap params, @NotNull final ErrorCollection errorCollection) {
        super.validate(params, errorCollection);

//        TextProvider textprovider = TextProviderUtils.getTextProvider();
        I18nBean i18nBean = this.getI18nBean();

        final String gradleTaskValue = params.getString("gradleTask");
        if (StringUtils.isEmpty(gradleTaskValue)) {
//            errorCollection.addError("gradleTask", textprovider.getText("gradle.task.error"));
            errorCollection.addError("gradleTask", i18nBean.getText("gradle.task.error"));
        }
    }
 
开发者ID:bschramke,项目名称:bamboo_plugin_gradlew,代码行数:14,代码来源:GradleTaskConfigurator.java


示例16: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
  public void validate(@NotNull final ActionParametersMap params, @NotNull final ErrorCollection errorCollection)
  {
      super.validate(params, errorCollection);

final String server = params.getString(HOST);
if (StringUtils.isEmpty(server))
{
    errorCollection.addError(HOST, textProvider.getText("vm.server.error"));
}

final String username = params.getString(USERNAME);
if (StringUtils.isEmpty(username))
{
    errorCollection.addError(USERNAME, textProvider.getText("vm.username.error"));
}

if ("true".equals(params.getString(CHANGE_PASSWORD)))
{
	String password = params.getString(PLAIN_PASSWORD);
	if (StringUtils.isEmpty(password))
	{
		errorCollection.addError(PLAIN_PASSWORD, textProvider.getText("vm.password.error"));
	}
}

final String name = params.getString(NAME);
if (StringUtils.isEmpty(name))
{
    errorCollection.addError(NAME, textProvider.getText("vm.name.error"));
}
  }
 
开发者ID:bloudraak,项目名称:blueprint-bamboo-vmware-tasks,代码行数:33,代码来源:VirtualMachineTaskConfigurator.java


示例17: validateRequired

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
private void validateRequired(ActionParametersMap params, ErrorCollection errorCollection, String field) {
	String value = params.getString(field);
	if (value == null || value.trim().isEmpty())
		errorCollection.addError(field, i18nBean.getText("err." + field)); //$NON-NLS-1$
}
 
开发者ID:AppSecDev,项目名称:asoc-bamboo-plugin,代码行数:6,代码来源:SASTScanTaskConfigurator.java


示例18: validateNumber

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
private void validateNumber(ActionParametersMap params, ErrorCollection errorCollection, String field) {
	String value = params.getString(field);
	if (!("".equals(value) || StringUtils.isNumeric(value)))		//$NON-NLS-1$
		errorCollection.addError(field, i18nBean.getText("err.nan"));	//$NON-NLS-1$
}
 
开发者ID:AppSecDev,项目名称:asoc-bamboo-plugin,代码行数:6,代码来源:SASTScanTaskConfigurator.java


示例19: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(final ActionParametersMap params, final ErrorCollection errorCollection) {
    super.validate(params, errorCollection);

    final String projectName = params.getString(HubScanConfigFieldEnum.PROJECT.getKey());
    final String versionName = params.getString(HubScanConfigFieldEnum.VERSION.getKey());
    final String phase = params.getString(HubScanConfigFieldEnum.PHASE.getKey());
    final String distribution = params.getString(HubScanConfigFieldEnum.DISTRIBUTION.getKey());
    final String scanMemory = params.getString(HubScanConfigFieldEnum.SCANMEMORY.getKey());
    final String bomWaitTime = params.getString(HubScanConfigFieldEnum.MAX_WAIT_TIME_FOR_BOM_UPDATE.getKey());
    final String scanTargetText = params.getString(HubScanConfigFieldEnum.TARGETS.getKey());
    final String excludePatternsString = params.getString(HubScanConfigFieldEnum.EXCLUDE_PATTERNS.getKey());

    List<String> scanTargets = new ArrayList<>();
    try {
        scanTargets = HubBambooUtils.getInstance().createScanTargetPaths(scanTargetText, null);
    } catch (final IOException e) {
        errorCollection.addError(HubScanConfigFieldEnum.TARGETS.getKey(), e.getMessage());
    }

    final String[] excludePatterns = HubBambooUtils.getInstance().createExcludePatterns(excludePatternsString);

    final ProjectRequestValidator projectRequestValidator = new ProjectRequestValidator();
    projectRequestValidator.setProjectName(projectName);
    projectRequestValidator.setVersionName(versionName);
    projectRequestValidator.setPhase(phase);
    projectRequestValidator.setDistribution(distribution);
    final ValidationResults projectRequesResult = projectRequestValidator.assertValid();
    if (!projectRequesResult.isSuccess()) {
        checkValidationErrors(HubScanConfigFieldEnum.PROJECT, projectRequesResult, errorCollection);
        checkValidationErrors(HubScanConfigFieldEnum.VERSION, projectRequesResult, errorCollection);
        checkValidationErrors(HubScanConfigFieldEnum.PHASE, projectRequesResult, errorCollection);
        checkValidationErrors(HubScanConfigFieldEnum.DISTRIBUTION, projectRequesResult, errorCollection);
    }
    final HubScanConfigValidator hubScanJobConfigValidator = new HubScanConfigValidator();
    hubScanJobConfigValidator.setScanMemory(scanMemory);
    hubScanJobConfigValidator.addAllScanTargetPaths(new HashSet<>(scanTargets));
    hubScanJobConfigValidator.disableScanTargetPathExistenceCheck();
    final ValidationResults scanConfigResult = hubScanJobConfigValidator.assertValid();
    validateExcludePatterns(scanConfigResult, excludePatterns);
    if (!scanConfigResult.isSuccess()) {
        checkValidationErrors(HubScanConfigFieldEnum.MAX_WAIT_TIME_FOR_BOM_UPDATE, scanConfigResult, errorCollection);
        checkValidationErrors(HubScanConfigFieldEnum.SCANMEMORY, scanConfigResult, errorCollection);
        if (!scanTargets.isEmpty()) {
            checkValidationErrors(HubScanConfigFieldEnum.TARGETS, scanConfigResult, errorCollection);
        }
    }
    checkValidationErrors(HubScanConfigFieldEnum.EXCLUDE_PATTERNS, scanConfigResult, errorCollection);
    checkBomWaitTime(bomWaitTime, errorCollection);
}
 
开发者ID:blackducksoftware,项目名称:hub-bamboo,代码行数:51,代码来源:HubScanTaskConfigurator.java


示例20: validate

import com.atlassian.bamboo.utils.error.ErrorCollection; //导入依赖的package包/类
@Override
public void validate(@NotNull final ActionParametersMap params, @NotNull final ErrorCollection errorCollection)
{
	super.validate(params, errorCollection);

	final String host = params.getString("host");
	if (StringUtils.isEmpty(host))
	{
		errorCollection.addError("host", textProvider.getText("xbdd.host.error"));
	}
	if (host != null && !host.contains("http")) {
		errorCollection.addError("host", textProvider.getText("xbdd.http.error"));
	}

	final String path1Value = params.getString("path");
	if (StringUtils.isEmpty(path1Value))
	{
		errorCollection.addError("path", textProvider.getText("xbdd.path.error"));
	}

	final String build = params.getString("plug-build");
	if (StringUtils.isEmpty(build))
	{
		errorCollection.addError("plug-build", textProvider.getText("xbdd.build.error"));
	}

	final String productName = params.getString("product");
	if (StringUtils.isEmpty(productName))
	{
		errorCollection.addError("product", textProvider.getText("xbdd.product.error"));
	}

	final String[] versionFields = {"major", "minor", "servicepack"};

	for (String field : versionFields) {
		try {
			final Integer fieldVal = Integer.parseInt(params.getString(field));
			if (StringUtils.isEmpty(params.getString(field)) || fieldVal < 0) {
				errorCollection.addError(field, textProvider.getText("xbdd.version.error"));
			}
		} catch (Exception e) {
			errorCollection.addError(field, textProvider.getText("XBDD.version.error"));
		}
	}
}
 
开发者ID:orionhealth,项目名称:xbdd-bamboo-plugin,代码行数:46,代码来源:XBDDTestResultsSenderConfigurator.java



注:本文中的com.atlassian.bamboo.utils.error.ErrorCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DuplicateMessageException类代码示例发布时间:2022-05-22
下一篇:
Java SimpleConfigurationNode类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap