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


Java ServiceMessage.getAttributes方法代码示例

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


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

示例1: testFailureLines

import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
public static String[] testFailureLines(String line) {
    try {
        ServiceMessage msg = ServiceMessage.parse(line.trim());
        if (msg != null) {
            Map<String, String> attributes = msg.getAttributes();
            if (attributes.containsKey("message") && attributes.containsKey("details")) {
                String state = TestErrorState.buildErrorPresentationText(attributes.get("message"), attributes.get("details"));
                if (state != null) {
                    return state.split("\n");
                } else {
                    return ArrayUtils.EMPTY_STRING_ARRAY;
                }
            } else {
                return ArrayUtils.EMPTY_STRING_ARRAY;
            }
        } else {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }
    } catch (ParseException e) {
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }
}
 
开发者ID:samebug,项目名称:samebug-idea-plugin,代码行数:23,代码来源:TeamCityDecoder.java

示例2: translate

import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
@NotNull
@Override
public List<BuildMessage1> translate(@NotNull SRunningBuild sRunningBuild, @NotNull BuildMessage1 buildMessage1,
                                     @NotNull ServiceMessage serviceMessage)
{
    final Map<String, String> messageAttributes = serviceMessage.getAttributes();
    if (messageAttributes.isEmpty())
    {
        LOG.warning("Could not translate service message with empty attributes.");
        return Arrays.asList(buildMessage1);
    }

    dataStoreServices.get(activeDataStoreName)
            .saveData(sRunningBuild, new HighlightData(messageAttributes.get("title"),
                                                       Arrays.asList(messageAttributes.get("text")),
                                                       valueOfOrDefault(messageAttributes.get("level"), Level.class, Level.info),
                                                       valueOfOrDefault(messageAttributes.get("block"), Block.class, Block.expanded),
                                                       valueOfOrDefault(messageAttributes.get("order"), Order.class, Order.none)));

    return Arrays.asList(buildMessage1);
}
 
开发者ID:jpfeffer,项目名称:teamcity-highlighter,代码行数:22,代码来源:HighlightServiceMessageTranslator.java

示例3: tryParse

import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
@Nullable
public static StatisticMessage tryParse(@NotNull final ServiceMessage message) {
  if(!MESSAGE_NAME.equalsIgnoreCase(message.getMessageName())) {
    return null;
  }

  return new StatisticMessage(message.getAttributes());
}
 
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:9,代码来源:StatisticMessage.java

示例4: getParserId

import jetbrains.buildServer.messages.serviceMessages.ServiceMessage; //导入方法依赖的package包/类
@NotNull
protected static ParserId getParserId(@NotNull final ServiceMessage message) {
  final Map<String, String> attributes = message.getAttributes();
  final String argument = message.getArgument();
  final String file = attributes.get("file");
  final String name = attributes.get("name");
  final String resource = attributes.get("resource");
  final String id = attributes.get("id");
  if (isEmptyOrSpaces(argument) && isEmptyOrSpaces(file) && isEmptyOrSpaces(name) && isEmptyOrSpaces(resource) && isEmptyOrSpaces(id)) {
    throw new IllegalArgumentException("Command requires either attribute 'name', 'file', 'id' or single argument. Actual message: " + message);
  }
  // TODO: improve
  return new ParserId(name, resource, file);
}
 
开发者ID:JetBrains,项目名称:teamcity-process-output-parsers,代码行数:15,代码来源:ParserCommand.java


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