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


Java SFinishedBuild类代码示例

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


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

示例1: should_fail_on_exception_file

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_on_exception_file(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE,
          "try { \n" +
                  " throw \"You shall not pass!\"" +
                  "} \n" +
                  "Catch\n" +
                  "{\n" +
                  "    $ErrorMessage = $_.Exception.Message\n" +
                  "    Write-Output $ErrorMessage\n" +
                  "    exit(1) \n"+
                  "}");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());
  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:20,代码来源:BuildFailureTests.java

示例2: should_run_simple_command_file_ps1

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-29803")
public void should_run_simple_command_file_ps1(@NotNull final PowerShellBitness bits) throws Throwable {
  final File dir = createTempDir();
  final File code = new File(dir, "code.ps1");
  FileUtil.writeFileAndReportErrors(code, "echo works");

  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.FILE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_FILE, code.getPath());
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isSuccessful());

  Assert.assertTrue(getBuildLog(build).contains("works"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:19,代码来源:PowerShellIntegrationTests.java

示例3: testOutputIsWrittenFromScriptInFile

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-34775")
public void testOutputIsWrittenFromScriptInFile(@NotNull final PowerShellBitness bits) throws Throwable {
  final File dir = createTempDir();
  final File code = new File(dir, "code.ps1");
  FileUtil.writeFileAndReportErrors(code,
      "param ([string]$PowerShellParam = \"value\",)\n" +
          "Write-Host \"String from Write-Host\"\n" +
          "Write-Output \"String from Write-Output\"\n" +
          "Write-Host \"Function call from Write-Host $((Get-Date -Year 2000 -Month 12 -Day 31).DayOfYear)\"\n" +
          "Write-Output \"Function call from Write-Output $((Get-Date -Year 2000 -Month 12 -Day 31).DayOfYear)\"\n"
  );

  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.FILE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_FILE, code.getPath());
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isSuccessful());
  Assert.assertTrue(getBuildLog(build).contains("String from Write-Host"));
  Assert.assertTrue(getBuildLog(build).contains("String from Write-Output"));
  Assert.assertTrue(getBuildLog(build).contains("Function call from Write-Host 366"));
  Assert.assertTrue(getBuildLog(build).contains("Function call from Write-Output 366"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:27,代码来源:PowerShellIntegrationTests.java

示例4: setUp

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@BeforeMethod
public void setUp()
{
  myCtx = new Mockery();

  myServerExtensionHolder = myCtx.mock(ServerExtensionHolder.class);
  myBuildDataStorage = myCtx.mock(BuildDataStorage.class);
  myMetricComparer = myCtx.mock(MetricComparer.class);
  myStatisticKeyFactory = myCtx.mock(StatisticKeyFactory.class);
  myStatisticProvider = myCtx.mock(StatisticProvider.class);
  myHistory = myCtx.mock(History.class);
  myRunningBuild = myCtx.mock(SRunningBuild.class);
  myBuildType = myCtx.mock(SBuildType.class);

  buildMessage1 = new BuildMessage1("sourceId", "typeId", Status.NORMAL, new Date(1234567), "value", Arrays.asList("a", "b"));
  myBuild1 = myCtx.mock(SFinishedBuild.class, "Build1");
  myBuild2 = myCtx.mock(SFinishedBuild.class, "Build2");

  myHistoryElement1 = myCtx.mock(HistoryElement.class, "HistoryElement1");
  myHistoryElement2 = myCtx.mock(HistoryElement.class, "HistoryElement2");
}
 
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:22,代码来源:DotTraceStatisticTranslatorTest.java

示例5: SetUp

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@BeforeMethod
public void SetUp() {
    mockery = new Mockery();
    buildType = mockery.mock(SBuildType.class, "BuildType");

    build1 = mockery.mock(SFinishedBuild.class, "Build1");
    build2 = mockery.mock(SFinishedBuild.class, "Build2");
    build3 = mockery.mock(SFinishedBuild.class, "Build3");

    buildHistory = new ArrayList<SFinishedBuild>();
    buildHistory.add(build3);
    buildHistory.add(build2);
    buildHistory.add(build1);

    change1 = mockery.mock(SVcsModification.class, "change1");
    change2 = mockery.mock(SVcsModification.class, "change2");
    change3 = mockery.mock(SVcsModification.class, "change3");
    change4 = mockery.mock(SVcsModification.class, "change4");

    mockery.checking(new Expectations() {{
        oneOf(buildType).getHistory(null, true, true); will(returnValue(buildHistory));
        oneOf(build1).getCanceledInfo(); will(returnValue(null));
        oneOf(build2).getCanceledInfo(); will(returnValue(null));
        oneOf(build3).getCanceledInfo(); will(returnValue(null));
    }});
}
 
开发者ID:sferencik,项目名称:SinCity,代码行数:27,代码来源:FinishedBuildWithChangesTest.java

示例6: should_fail_on_uncaught_exception_stdin

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_on_uncaught_exception_stdin(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "throw \"You shall not pass!\"");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:13,代码来源:BuildFailureTests.java

示例7: should_fail_syntax_error_file

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_syntax_error_file(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "callToSomeNonExistentFunction(param1, param2)");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());

  setRunnerParameter(PowerShellConstants.RUNNER_LOG_ERR_TO_ERROR, "true");
  getBuildType().setOption(SBuildType.BT_FAIL_ON_ANY_ERROR_MESSAGE, true);

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:15,代码来源:BuildFailureTests.java

示例8: should_fail_syntax_error_cmd

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_syntax_error_cmd(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "callToSomeNonExistentFunction(param1, param2)");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_LOG_ERR_TO_ERROR, "true");

  getBuildType().setOption(SBuildType.BT_FAIL_ON_ANY_ERROR_MESSAGE, true);

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:16,代码来源:BuildFailureTests.java

示例9: should_fail_on_error_output_cmd

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_on_error_output_cmd(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "$res = \"Epic fail\" \nWrite-Error $res");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:13,代码来源:BuildFailureTests.java

示例10: should_fail_on_error_output_file

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_fail_on_error_output_file(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "$res = \"Epic fail\" \nWrite-Error $res");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());

  setRunnerParameter(PowerShellConstants.RUNNER_LOG_ERR_TO_ERROR, "true");
  getBuildType().setOption(SBuildType.BT_FAIL_ON_ANY_ERROR_MESSAGE, true);

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:15,代码来源:BuildFailureTests.java

示例11: should_pass_explicit_exit_code_cmd

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_pass_explicit_exit_code_cmd(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "$res = \"Test is running\"\nWrite-Output $res\nexit(123)");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
  Assert.assertTrue(getBuildLog(build).contains("Process exited with code 123"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:14,代码来源:BuildFailureTests.java

示例12: should_pass_explicit_exit_code_file

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_pass_explicit_exit_code_file(@NotNull final PowerShellBitness bitness) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "$res = \"Test is running\"\nWrite-Output $res\nexit(123)");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bitness.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isFailed());
  Assert.assertTrue(getBuildLog(build).contains("Process exited with code 123"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:13,代码来源:BuildFailureTests.java

示例13: should_run_simple_command_code_stdin

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-29803")
public void should_run_simple_command_code_stdin(@NotNull final PowerShellBitness bits) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "echo works");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isSuccessful());
  Assert.assertTrue(getBuildLog(build).contains("works"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:15,代码来源:PowerShellIntegrationTests.java

示例14: should_run_simple_command_file_stdin

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-29803")
public void should_run_simple_command_file_stdin(@NotNull final PowerShellBitness bits) throws Throwable {
  final File code = createTempFile("echo works");
  setRunnerParameter(PowerShellConstants.RUNNER_MIN_VERSION, "2.0");
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.STDIN.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.FILE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_FILE, code.getPath());
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isSuccessful());
  Assert.assertTrue(getBuildLog(build).contains("works"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:16,代码来源:PowerShellIntegrationTests.java

示例15: should_run_simple_command_code_ps1

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-29803")
public void should_run_simple_command_code_ps1(@NotNull final PowerShellBitness bits) throws Throwable {
  setRunnerParameter(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.CODE.getValue());
  setRunnerParameter(PowerShellConstants.RUNNER_SCRIPT_CODE, "echo works");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

  final SFinishedBuild build = doTest(null);
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isSuccessful());
  Assert.assertTrue(getBuildLog(build).contains("works"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:14,代码来源:PowerShellIntegrationTests.java


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