• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BuildProblemTypes类的典型用法和代码示例

java 1次浏览

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

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

示例1: testCreateBuildProblemDataWithFilePath

点赞 3

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
@Test
public void testCreateBuildProblemDataWithFilePath() throws Exception {
    final String bucket_name = "my-bucket-with-long-name";
    final String file_path = "/Users/sg0216948/Downloads/TeamCity/buildAgent/work/56eb2e988bd79b91/.gitignore";
    final String exception_message = "my-bucket";

    BuildProblemData result = helper.createBuildProblemData(bucket_name, file_path, exception_message);

    System.out.println(result.getIdentity());
    System.out.println(result.getIdentity().length());

    assertTrue(result.getIdentity().contains("my-bucket-w" + ":" + "rk/56eb2e988bd79b91/.gitignore" + ":"));

    assertEquals(result.getType(), BuildProblemTypes.TC_ERROR_MESSAGE_TYPE);
    assertEquals(result.getDescription(), exception_message);
}
 

开发者ID:gonzadocarmo,
项目名称:teamcity-s3-plugin,
代码行数:17,
代码来源:AWSS3BuildProcessAdapterHelperTest.java

示例2: responsibleChanged

点赞 3

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
@Override
public void responsibleChanged(@NotNull SProject project, @NotNull Collection<BuildProblemInfo> buildProblems, @Nullable ResponsibilityEntry entry) {
  super.responsibleChanged(project, buildProblems, entry);

  if (entry == null) return;
  if (notifyInvestigationTaken(entry)) return;
  if (!notifyInvestigationDelegated(entry)) return;

  User responsible = entry.getResponsibleUser();

  for (BuildProblemInfo problem: buildProblems) {
    if (problem instanceof BuildProblem) {
      BuildProblem bp = (BuildProblem) problem;
      if (BuildProblemTypes.TC_COMPILATION_ERROR_TYPE.equals(bp.getBuildProblemData().getType())) {
        registerUserEvent(responsible, AchievementEvents.compilationBroken.name());
        break;
      }
    }
  }
}
 

开发者ID:JetBrains,
项目名称:teamcity-achievements,
代码行数:21,
代码来源:ServerEventsAdapter.java

示例3: createBuildProblemData

点赞 2

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
public @NotNull BuildProblemData createBuildProblemData(String bucketName, String filePath, String exceptionMessage) {
    String bucketID = bucketName.length() <= 12 ? bucketName : bucketName.substring(0, 11);
    String filePathID = filePath.length() <= 30 ? filePath : filePath.substring(filePath.length() - 30);

    final String id = String.format("%s:%s:%s",
            bucketID,
            filePathID,
            Calendar.getInstance().getTimeInMillis());
    return BuildProblemData.createBuildProblem(id, BuildProblemTypes.TC_ERROR_MESSAGE_TYPE, exceptionMessage);
}
 

开发者ID:gonzadocarmo,
项目名称:teamcity-s3-plugin,
代码行数:11,
代码来源:AWSS3BuildProcessAdapterHelper.java

示例4: testCreateBuildProblemData

点赞 2

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
@Test
public void testCreateBuildProblemData() throws Exception {
    final String bucket_name = "my-bucket";
    final String exception_message = "Access Denied (Service: Amazon S3; Status Code: 403;";

    BuildProblemData result = helper.createBuildProblemData(bucket_name, exception_message);

    assertTrue(result.getIdentity().contains(bucket_name + ":"));
    assertEquals(result.getType(), BuildProblemTypes.TC_ERROR_MESSAGE_TYPE);
    assertEquals(result.getDescription(), exception_message);
}
 

开发者ID:gonzadocarmo,
项目名称:teamcity-s3-plugin,
代码行数:12,
代码来源:AWSS3BuildProcessAdapterHelperTest.java

示例5: checkAndReportRuntimeRequirements

点赞 2

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
private static void checkAndReportRuntimeRequirements(@NotNull BuildAgentConfiguration agentConfiguration, @NotNull BuildProgressLogger logger){
  for (String parameterName : agentConfiguration.getConfigurationParameters().keySet()){
    if(parameterName.startsWith(DOTNET_FRAMEWORK_3_5)) return;
  }
  logger.logBuildProblem(BuildProblemData.createBuildProblem(NET_35_NOT_FOUND_PROBLEM_IDENTITY, BuildProblemTypes.TC_ERROR_MESSAGE_TYPE, ".NET 3.5 runtime required for symbols indexing was not found on build agent."));
}
 

开发者ID:JetBrains,
项目名称:teamcity-symbol-server,
代码行数:7,
代码来源:SymbolsIndexer.java

示例6: logExitCodeBuildProblem

点赞 2

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
private void logExitCodeBuildProblem(int exitCode) {
  myLogger.logBuildProblem(BuildProblemData.createBuildProblem(SSHRunnerConstants.SSH_EXEC_RUN_TYPE + ":" + exitCode, BuildProblemTypes.TC_EXIT_CODE_TYPE, "SSH exit-code " + exitCode));
}
 

开发者ID:JetBrains,
项目名称:teamcity-deployer-plugin,
代码行数:4,
代码来源:SSHExecProcessAdapter.java

示例7: testGetRelevantBuildProblems

点赞 2

import jetbrains.buildServer.BuildProblemTypes; //导入依赖的package包/类
@Test
public void testGetRelevantBuildProblems() {
    /*
        Test that an artifact-dependency-error is removed from the set of build problems.

        thisBuild has three problems:
        1) an artifact dependency problem
        2) an exit code 1
        3) a snapshot dependency problem

        previousBuild has three problems:
        1) an artifact dependency problem (different than above, as TeamCity puts instance-specific info into these)
        2) an exit code 1 (same as above)
        3) a time-out

        The difference between these two tests is the snapshot dependency problem (only).
     */

    //arrange
    mockery.checking(new Expectations() {{
        oneOf(thisBuild).getFailureReasons(); will(returnValue(Arrays.asList(
                BuildProblemData.createBuildProblem("909103612", ErrorData.ARTIFACT_DEPENDENCY_ERROR_TYPE, "Failed to resolve artifacts from <Sam :: SinCity Build, build #61 [id 21768]>"),
                BuildProblemData.createBuildProblem("simpleRunner1", BuildProblemTypes.TC_EXIT_CODE_TYPE, "Process exited with code 1"),
                BuildProblemData.createBuildProblem("bt251", ErrorData.SNAPSHOT_DEPENDENCY_ERROR_BUILD_PROCEEDS_TYPE, "Snapshot dependency \"... Dependency\" failed")
        )));
        oneOf(previousBuild).getFailureReasons(); will(returnValue(Arrays.asList(
                BuildProblemData.createBuildProblem("simpleRunner1", BuildProblemTypes.TC_EXIT_CODE_TYPE, "Process exited with code 1"),
                BuildProblemData.createBuildProblem("-639166500", ErrorData.ARTIFACT_DEPENDENCY_ERROR_TYPE, "Failed to resolve artifacts from <Sam :: SinCity Build, build #58 [id 21760]>"),
                BuildProblemData.createBuildProblem("TC_EXECUTION_TIMEOUT", BuildProblemTypes.TC_EXECUTION_TIMEOUT_TYPE, "Execution timeout")
        )));
    }});

    SettingNames settingNames = new SettingNames();
    CulpritFinder culpritFinder = new CulpritFinder(thisBuild, previousBuild, settingNames.getTriggerOnNew(), settingNames.getNoTrigger(), buildCustomizerFactory, buildQueue, false, "");

    // act
    List<BuildProblemData> relevantBuildProblems = culpritFinder.getRelevantBuildProblems();

    // assert
    assertThat(relevantBuildProblems.size(), is(1));
    assertThat(relevantBuildProblems.get(0).getIdentity(), is("bt251"));
    assertThat(relevantBuildProblems.get(0).getType(), is(ErrorData.SNAPSHOT_DEPENDENCY_ERROR_BUILD_PROCEEDS_TYPE));
    assertThat(relevantBuildProblems.get(0).getDescription(), is("Snapshot dependency \"... Dependency\" failed"));
}
 

开发者ID:sferencik,
项目名称:SinCity,
代码行数:45,
代码来源:CulpritFinderTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)