當前位置: 首頁>>代碼示例>>Java>>正文


Java TextParser.parse方法代碼示例

本文整理匯總了Java中jetbrains.buildServer.dotNet.buildRunner.agent.TextParser.parse方法的典型用法代碼示例。如果您正苦於以下問題:Java TextParser.parse方法的具體用法?Java TextParser.parse怎麽用?Java TextParser.parse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jetbrains.buildServer.dotNet.buildRunner.agent.TextParser的用法示例。


在下文中一共展示了TextParser.parse方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shouldParseAcl

import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; //導入方法依賴的package包/類
@Test(dataProvider = "parseAclCases")
public void shouldParseAcl(
  @NotNull final String aclStr,
  @Nullable final AccessControlList expectedAcl,
  final boolean expectedThrowException) throws ExecutionException {
  // Given
  final TextParser<AccessControlList> instance = createInstance();

  boolean actualThrowException = false;
  AccessControlList actualAcl = null;
  // When
  try {
    actualAcl = instance.parse(aclStr);
  }
  catch (BuildStartException buildStartException) {
    actualThrowException = true;
  }

  // Then
  then(actualThrowException).isEqualTo(expectedThrowException);
  then(actualAcl).isEqualTo(expectedAcl);
}
 
開發者ID:JetBrains,項目名稱:teamcity-runas-plugin,代碼行數:23,代碼來源:FileAccessParserTest.java

示例2: shouldParseFiltersFromString

import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; //導入方法依賴的package包/類
@Test(dataProvider = "parseFiltersFromStringCases")
public void shouldParseFiltersFromString(@NotNull final String text, @NotNull final List<ProcessFilter> expectedFilters, boolean expectedExceptionThrown)
{
  // Given
  final TextParser<List<ProcessFilter>> instance = createInstance();

  // When
  List<ProcessFilter> actualFilters = null;
  boolean actualExceptionThrown = false;

  try {
    actualFilters = instance.parse(text);
  }
  catch (BuildException ex) {
    actualExceptionThrown = true;
  }

  // Then
  if(!expectedExceptionThrown) {
    //noinspection ConstantConditions,ConstantConditions
    then(actualFilters).containsExactlyElementsOf(expectedFilters);
  }

  then(actualExceptionThrown).isEqualTo(expectedExceptionThrown);
}
 
開發者ID:JetBrains,項目名稱:teamcity-dottrace,代碼行數:26,代碼來源:ProcessFilterParserTest.java

示例3: shouldParseThresholdsFromString

import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; //導入方法依賴的package包/類
@Test(dataProvider = "parseThresholdsFromStringCases")
public void shouldParseThresholdsFromString(@NotNull final String text, @NotNull final Metrics expectedMetrics, boolean expectedExceptionThrown)
{
  // Given
  final TextParser<Metrics> instance = createInstance();

  // When
  Metrics actualMetrics = null;
  boolean actualExceptionThrown = false;

  try {
    actualMetrics = instance.parse(text);
  }
  catch (BuildException ex) {
    actualExceptionThrown = true;
  }

  // Then
  if(!expectedExceptionThrown) {
    //noinspection ConstantConditions,ConstantConditions
    then(actualMetrics.getMetrics()).containsExactlyElementsOf(expectedMetrics.getMetrics());
  }

  then(actualExceptionThrown).isEqualTo(expectedExceptionThrown);
}
 
開發者ID:JetBrains,項目名稱:teamcity-dottrace,代碼行數:26,代碼來源:MetricsParserTest.java

示例4: shouldParseDotTraceReportFromXml

import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; //導入方法依賴的package包/類
@Test(dataProvider = "parseDotTraceReportFromXmlCases")
public void shouldParseDotTraceReportFromXml(@NotNull final String text, @NotNull final Metrics expectedMetrics)
{
  final TextParser<Metrics> instance = createInstance();

  // When
  final Metrics actualMetrics = instance.parse(text);

  // Then
  then(actualMetrics).isEqualTo(expectedMetrics);
}
 
開發者ID:JetBrains,項目名稱:teamcity-dottrace,代碼行數:12,代碼來源:ReportParserTest.java

示例5: shouldParseDotMemoryUnitOutputFromXml

import jetbrains.buildServer.dotNet.buildRunner.agent.TextParser; //導入方法依賴的package包/類
@Test(dataProvider = "parseDotMemoryUnitOutputFromXmlCases")
public void shouldParseDotMemoryUnitOutputFromXml(@NotNull final String text, @NotNull final DotMemoryUnitOutput expectedOutput)
{
  final TextParser<DotMemoryUnitOutput> instance = createInstance();

  // When
  final DotMemoryUnitOutput actualOutput = instance.parse(text);

  // Then
  then(actualOutput).isEqualTo(expectedOutput);
}
 
開發者ID:JetBrains,項目名稱:teamcity-dotmemory,代碼行數:12,代碼來源:DotMemoryUnitOutputParserTest.java


注:本文中的jetbrains.buildServer.dotNet.buildRunner.agent.TextParser.parse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。