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

Java SFinishedBuild类代码示例

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

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



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


示例16: should_proper_bitness_run

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
public void should_proper_bitness_run(@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, "Write-Host \"ptr: $([IntPtr]::size)\"\r\n");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

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

  final String output = bits == PowerShellBitness.x64 ? "8" : "4";
  Assert.assertTrue(getBuildLog(build).contains("ptr: " + output + " NO"));
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:15,代码来源:PowerShellIntegrationTests.java


示例17: testShouldKeepGeneratedFiles_PowerShellSpecific

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = {"TW-39841", "TW-49772"})
public void testShouldKeepGeneratedFiles_PowerShellSpecific(@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());

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


示例18: testShouldKeepGeneratedFiles_Global

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = {"TW-39841", "TW-49772"})
public void testShouldKeepGeneratedFiles_Global(@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\r\n");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());

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


示例19: testShouldWriteBOMinExternalFileMode

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test(dataProvider = "supportedBitnessProvider")
@TestFor(issues = "TW-44082")
public void testShouldWriteBOMinExternalFileMode(@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, "$var = \"Value is \u00f8\u00e5\u00e6\"\r\n Write-Output $var\r\n");
  setRunnerParameter(PowerShellConstants.RUNNER_BITNESS, bits.getValue());
  setBuildConfigurationParameter(PowerShellConstants.CONFIG_KEEP_GENERATED, "true");

  final SFinishedBuild build = doTest(null);
  assertEquals(1, getTempFiles().length);
  final File generatedScript = getTempFiles()[0];
  InputStreamReader reader = null;
  try {
    reader = new InputStreamReader(new FileInputStream(generatedScript), FILES_ENCODING);
    char[] buf = new char[1];
    assertEquals(1, reader.read(buf));
    assertEquals("BOM is not written to external file", '\ufeff', buf[0]);
  } catch (IOException e) {
    fail(e.getMessage());
  } finally {
    if (reader != null) {
      reader.close();
    }
  }
  final String fileContents = FileUtil.readText(getTempFiles()[0], FILES_ENCODING);
  assertTrue("Non-ASCII symbols were not written to generated script", fileContents.contains("\u00f8\u00e5\u00e6"));
  dumpBuildLogLocally(build);
  Assert.assertTrue(build.getBuildStatus().isSuccessful());
}
 
开发者ID:JetBrains,项目名称:teamcity-powershell,代码行数:31,代码来源:PowerShellIntegrationTests.java


示例20: shouldNotGenerateMessageAndShouldNotPublishValuesWhenStatistic

import jetbrains.buildServer.serverSide.SFinishedBuild; //导入依赖的package包/类
@Test
public void shouldNotGenerateMessageAndShouldNotPublishValuesWhenStatistic() {
  // Given
  final List<SFinishedBuild> builds = Arrays.asList(myBuild1, myBuild2);
  final List<HistoryElement> historyElements = Arrays.asList(myHistoryElement1, myHistoryElement2);
  final StatisticMessage statisticMessage = new StatisticMessage("method1", "L10", "F20", "12", "34");

  myCtx.checking(new Expectations() {{
    oneOf(myServerExtensionHolder).registerExtension(with(ServiceMessageTranslator.class), with(DotTraceStatisticTranslator.class.getName()), with(any(ServiceMessageTranslator.class)));

    oneOf(myRunningBuild).getBuildType();
    will(returnValue(myBuildType));

    oneOf(myBuildType).getHistory();
    will(returnValue(builds));

    oneOf(myHistory).getElements(builds);
    will(returnValue(historyElements));

    oneOf(myStatisticProvider).tryCreateStatistic(statisticMessage, historyElements);
    will(returnValue(null));
  }});

  // When
  final ServiceMessageTranslator instance = createInstance();
  final List<BuildMessage1> messages = instance.translate(myRunningBuild, buildMessage1, statisticMessage);

  // Then
  myCtx.assertIsSatisfied();
  then(messages.size()).isEqualTo(1);
}
 
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:32,代码来源:DotTraceStatisticTranslatorTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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