本文整理匯總了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();
}
示例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);
}