本文整理匯總了Java中com.intellij.execution.testframework.sm.runner.ui.MockPrinter.onNewAvailable方法的典型用法代碼示例。如果您正苦於以下問題:Java MockPrinter.onNewAvailable方法的具體用法?Java MockPrinter.onNewAvailable怎麽用?Java MockPrinter.onNewAvailable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.execution.testframework.sm.runner.ui.MockPrinter
的用法示例。
在下文中一共展示了MockPrinter.onNewAvailable方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testProcessor_OnFailure
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnFailure() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test", "error msg", "method1:1\nmethod2:2", false, null, null));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg\nmethod1:1\nmethod2:2\nstderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test2", "error msg", "method1:1\nmethod2:2", false, null, null));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
}
示例2: testProcessor_OnFailure_Comparision_MultilineTexts
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnFailure_Comparision_MultilineTexts() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test", "error msg", "method1:1\nmethod2:2", false,
"this is:\nactual", "this is:\nexpected"));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg \n" +
"\n" +
"method1:1\n" +
"method2:2\n" +
"stderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 \n" +
"error msg \n" +
"\n" +
"method1:1\n" +
"method2:2\n", "");
}
示例3: testProcessor_OnError
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnError() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test", "error msg", "method1:1\nmethod2:2", true, null, null));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg\nmethod1:1\nmethod2:2\nstderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test2", "error msg", "method1:1\nmethod2:2", true, null, null));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
}
示例4: testProcessor_OnIgnored
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnIgnored() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test", "ignored msg", null));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 ", "\nignored msg");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 ", "\nignored msg");
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test2", "ignored msg", null));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 ", "\nignored msg");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 ", "\nignored msg");
}
示例5: testProcessor_OnIgnored
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnIgnored() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test", "ignored msg", null));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 ", "\nignored msg\n");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 ", "\nignored msg\n");
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test2", "ignored msg", null));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 ", "\nignored msg\n");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 ", "\nignored msg\n");
}
示例6: testProcessor_OnFailure_Comparision_MultilineTexts
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnFailure_Comparision_MultilineTexts() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test", "error msg", "method1:1\nmethod2:2", false,
"this is:\nactual", "this is:\nexpected"));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg \n" +
"\n" +
"method1:1\n" +
"method2:2\n" +
"stderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 \n" +
"error msg \n" +
"\n" +
"method1:1\n" +
"method2:2\n", "");
}
示例7: testProcessor_OnFailure_EmptyStacktrace
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnFailure_EmptyStacktrace() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test", "error msg", "\n\n", false, null, null));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg\nstderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "stderr1 \nerror msg\n", "");
}
示例8: testProcessor_OnFailure_Comparision_Strings
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnFailure_Comparision_Strings() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestFailure(new TestFailedEvent("my_test", "error msg", "method1:1\nmethod2:2", false, "actual", "expected"));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter,
// std out
"stdout1 ",
// std err
"\n" +
"error msg\n" +
"expected\n" +
"actual\n" +
" \n" +
"\n" +
"method1:1\n" +
"method2:2\n" +
"stderr1 ",
// std sys
"Expected :Actual :");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1,
// std out
"stdout1 ",
// std err
"stderr1 \nerror msg\n" +
"expected\n" +
"actual\n" +
" \n" +
"\n" +
"method1:1\nmethod2:2\n",
// std sys
"Expected :Actual :");
}
示例9: testProcessor_OnErrorMsg
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnErrorMsg() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onError("error msg", "method1:1\nmethod2:2", true);
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg\nmethod1:1\nmethod2:2\nstderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "\n" +
"error msg\n" +
"method1:1\n" +
"method2:2\n" +
"stderr1 ", "");
myEventsProcessor.onTestFinished(new TestFinishedEvent("my_test", 1l));
myTest1.setFinished();
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onError("error msg", "method1:1\nmethod2:2", true);
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
}
示例10: testProcessor_Suite_OnErrorMsg
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_Suite_OnErrorMsg() {
myEventsProcessor.onError("error msg:root", "method1:1\nmethod2:2", true);
myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite", null));
final SMTestProxy suite = myEventsProcessor.getCurrentSuite();
suite.setPrinter(myMockResettablePrinter);
myEventsProcessor.onError("error msg:suite", "method1:1\nmethod2:2", true);
assertAllOutputs(myMockResettablePrinter, "", "\n" +
"error msg:suite\n" +
"method1:1\n" +
"method2:2\n", "");
final MockPrinter mockSuitePrinter = new MockPrinter(true);
mockSuitePrinter.onNewAvailable(suite);
assertAllOutputs(mockSuitePrinter, "", "\n" +
"error msg:suite\n" +
"method1:1\n" +
"method2:2\n", "");
final MockPrinter mockRootSuitePrinter = new MockPrinter(true);
mockRootSuitePrinter.onNewAvailable(myRootSuite);
assertAllOutputs(mockRootSuitePrinter, "", "\n" +
"error msg:root\n" +
"method1:1\n" +
"method2:2\n" +
"\n" +
"error msg:suite\n" +
"method1:1\n" +
"method2:2\n", "");
}
示例11: testProcessor_OnIgnored_WithStacktrace
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnIgnored_WithStacktrace() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test", "ignored2 msg", "method1:1\nmethod2:2"));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ",
"\nmethod1:1\nmethod2:2\nstderr1 ",
"\nignored2 msg");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1,
"stdout1 ",
"stderr1 \nmethod1:1\nmethod2:2\n",
"\nignored2 msg");
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onTestIgnored(new TestIgnoredEvent("my_test2", "ignored msg", "method1:1\nmethod2:2"));
assertAllOutputs(myMockResettablePrinter,
"stdout1 ",
"stderr1 \nmethod1:1\nmethod2:2\n",
"\nignored msg");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2,
"stdout1 ",
"stderr1 \nmethod1:1\nmethod2:2\n",
"\nignored msg");
}
示例12: testProcessor_OnErrorMsg
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_OnErrorMsg() {
final SMTestProxy myTest1 = startTestWithPrinter("my_test");
myEventsProcessor.onError("error msg", "method1:1\nmethod2:2", true);
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test", "stderr1 ", false));
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "\nerror msg\nmethod1:1\nmethod2:2\nstderr1 ", "");
final MockPrinter mockPrinter1 = new MockPrinter(true);
mockPrinter1.onNewAvailable(myTest1);
assertAllOutputs(mockPrinter1, "stdout1 ", "\n" +
"error msg\n" +
"method1:1\n" +
"method2:2\n" +
"stderr1 ", "");
myEventsProcessor.onTestFinished(new TestFinishedEvent("my_test", 1));
myTest1.setFinished();
//other output order
final SMTestProxy myTest2 = startTestWithPrinter("my_test2");
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stdout1 ", true));
myEventsProcessor.onTestOutput(new TestOutputEvent("my_test2", "stderr1 ", false));
myEventsProcessor.onError("error msg", "method1:1\nmethod2:2", true);
assertAllOutputs(myMockResettablePrinter, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
final MockPrinter mockPrinter2 = new MockPrinter(true);
mockPrinter2.onNewAvailable(myTest2);
assertAllOutputs(mockPrinter2, "stdout1 ", "stderr1 \nerror msg\nmethod1:1\nmethod2:2\n", "");
}
示例13: testProcessor_Suite_OnErrorMsg
import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入方法依賴的package包/類
public void testProcessor_Suite_OnErrorMsg() {
myEventsProcessor.onError("error msg:root", "method1:1\nmethod2:2", true);
myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite", null));
final SMTestProxy suite = myEventsProcessor.getCurrentSuite();
suite.setPrinter(myMockResettablePrinter);
myEventsProcessor.onError("error msg:suite", "method1:1\nmethod2:2", true);
assertAllOutputs(myMockResettablePrinter, "", "\n" +
"error msg:suite\n" +
"method1:1\n" +
"method2:2\n", "");
final MockPrinter mockSuitePrinter = new MockPrinter(true);
mockSuitePrinter.onNewAvailable(suite);
assertAllOutputs(mockSuitePrinter, "", "\n" +
"error msg:suite\n" +
"method1:1\n" +
"method2:2\n", "");
final MockPrinter mockRootSuitePrinter = new MockPrinter(true);
mockRootSuitePrinter.onNewAvailable(myRootSuite);
assertAllOutputs(mockRootSuitePrinter, "", "\n" +
"error msg:root\n" +
"method1:1\n" +
"method2:2\n" +
"\n" +
"error msg:suite\n" +
"method1:1\n" +
"method2:2\n", "");
}