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


Java MockPrinter.resetIfNecessary方法代碼示例

本文整理匯總了Java中com.intellij.execution.testframework.sm.runner.ui.MockPrinter.resetIfNecessary方法的典型用法代碼示例。如果您正苦於以下問題:Java MockPrinter.resetIfNecessary方法的具體用法?Java MockPrinter.resetIfNecessary怎麽用?Java MockPrinter.resetIfNecessary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.execution.testframework.sm.runner.ui.MockPrinter的用法示例。


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

示例1: assertAllOutputs

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public static void assertAllOutputs(final MockPrinter printer,
                                    final String out, final String err, final String sys)
{
  assertTrue(printer.hasPrinted());
  assertEquals(out, printer.getStdOut());
  assertEquals(err, printer.getStdErr());
  assertEquals(sys, printer.getStdSys());

  printer.resetIfNecessary();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:SMTRunnerConsoleTest.java

示例2: testTestFailedTwice

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testTestFailedTwice() {
  mySimpleTest.setStarted();
  mySimpleTest.setTestFailed("msg 1", "stack trace 1", false);

  assertFalse(mySimpleTest.isInProgress());
  assertTrue(mySimpleTest.wasLaunched());
  assertTrue(mySimpleTest.isDefect());
  assertTrue(mySimpleTest.getMagnitudeInfo() == Magnitude.FAILED_INDEX);
  final MockPrinter printer = new MockPrinter(true);
  mySimpleTest.printOn(printer);
  assertEquals("", printer.getStdOut());
  assertEquals("\nmsg 1\nstack trace 1\n", printer.getStdErr());
  assertEquals("", printer.getStdSys());

  mySimpleTest.setTestFailed("msg 2", "stack trace 2", false);

  assertFalse(mySimpleTest.isInProgress());
  assertTrue(mySimpleTest.wasLaunched());
  assertTrue(mySimpleTest.isDefect());
  assertTrue(mySimpleTest.getMagnitudeInfo() == Magnitude.FAILED_INDEX);
  printer.resetIfNecessary();
  mySimpleTest.printOn(printer);
  assertEquals("", printer.getStdOut());
  assertEquals("\nmsg 1\nstack trace 1\n\nmsg 2\nstack trace 2\n", printer.getStdErr());
  assertEquals("", printer.getStdSys());

  mySimpleTest.setFinished();

  assertFalse(mySimpleTest.isInProgress());
  assertTrue(mySimpleTest.wasLaunched());
  assertTrue(mySimpleTest.isDefect());
  assertTrue(mySimpleTest.getMagnitudeInfo() == Magnitude.FAILED_INDEX);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:34,代碼來源:SMTestProxyTest.java


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