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


Java MockPrinter類代碼示例

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


MockPrinter類屬於com.intellij.execution.testframework.sm.runner.ui包,在下文中一共展示了MockPrinter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
  super.setUp();

  final TestConsoleProperties consoleProperties = createConsoleProperties();
  final ExecutionEnvironment environment = new ExecutionEnvironment();

  myMockResettablePrinter = new MockPrinter(true);
  myConsole = new MyConsoleView(consoleProperties, environment);
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myRootSuite = myResultsViewer.getTestsRootNode();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");

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

示例2: 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", "");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:SMTRunnerConsoleTest.java

示例3: 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", "");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:SMTRunnerConsoleTest.java

示例4: 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", "");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:SMTRunnerConsoleTest.java

示例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");

  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");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:SMTRunnerConsoleTest.java

示例6: setUp

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
  super.setUp();

  TestConsoleProperties consoleProperties = createConsoleProperties();
  TestConsoleProperties.HIDE_PASSED_TESTS.set(consoleProperties, false);
  TestConsoleProperties.OPEN_FAILURE_LINE.set(consoleProperties, false);
  TestConsoleProperties.SCROLL_TO_SOURCE.set(consoleProperties, false);
  TestConsoleProperties.SELECT_FIRST_DEFECT.set(consoleProperties, false);
  TestConsoleProperties.TRACK_RUNNING_TEST.set(consoleProperties, false);

  final ExecutionEnvironment environment = new ExecutionEnvironment();
  myMockResettablePrinter = new MockPrinter(true);
  myConsole = new MyConsoleView(consoleProperties, environment);
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(consoleProperties.getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");
  myEventsProcessor.addEventsListener(myResultsViewer);
  myTreeModel = myResultsViewer.getTreeView().getModel();

  myEventsProcessor.onStartTesting();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:GeneralToSMTRunnerEventsConvertorTest.java

示例7: setUp

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
  super.setUp();

  final TestConsoleProperties consoleProperties = createConsoleProperties();
  final ExecutionEnvironment environment = new ExecutionEnvironment();

  myMockResettablePrinter = new MockPrinter(true);
  myConsole = new MyConsoleView(consoleProperties, environment);
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myRootSuite = myResultsViewer.getTestsRootNode();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(myResultsViewer.getTestsRootNode(), "SMTestFramework");

  myEventsProcessor.onStartTesting();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:17,代碼來源:SMTRunnerConsoleTest.java

示例8: 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");
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:25,代碼來源:SMTRunnerConsoleTest.java

示例9: setUp

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
  super.setUp();

  TestConsoleProperties consoleProperties = createConsoleProperties();
  TestConsoleProperties.HIDE_PASSED_TESTS.set(consoleProperties, false);
  TestConsoleProperties.OPEN_FAILURE_LINE.set(consoleProperties, false);
  TestConsoleProperties.SCROLL_TO_SOURCE.set(consoleProperties, false);
  TestConsoleProperties.SELECT_FIRST_DEFECT.set(consoleProperties, false);
  TestConsoleProperties.TRACK_RUNNING_TEST.set(consoleProperties, false);

  final ExecutionEnvironment environment = new ExecutionEnvironment();
  myMockResettablePrinter = new MockPrinter(true);
  myConsole = new MyConsoleView(consoleProperties, environment);
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(myResultsViewer.getTestsRootNode(), "SMTestFramework");
  myEventsProcessor.addEventsListener(myResultsViewer);
  myTreeModel = myResultsViewer.getTreeView().getModel();

  myEventsProcessor.onStartTesting();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:23,代碼來源:GeneralToSMTRunnerEventsConvertorTest.java

示例10: setUp

import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; //導入依賴的package包/類
@Override
protected void setUp() throws Exception {
  super.setUp();

  final TestConsoleProperties consoleProperties = createConsoleProperties();
  final ExecutionEnvironment environment = new ExecutionEnvironment();

  myMockResettablePrinter = new MockPrinter(true);
  myConsole = new MyConsoleView(consoleProperties, environment.getRunnerSettings(), environment.getConfigurationSettings());
  myConsole.initUI();
  myResultsViewer = myConsole.getResultsViewer();
  myRootSuite = myResultsViewer.getTestsRootNode();
  myEventsProcessor = new GeneralToSMTRunnerEventsConvertor(getProject(), myResultsViewer.getTestsRootNode(), "SMTestFramework");

  myEventsProcessor.onStartTesting();
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:17,代碼來源:SMTRunnerConsoleTest.java

示例11: 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", "");
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:23,代碼來源:SMTRunnerConsoleTest.java

示例12: 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", "");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:SMTRunnerConsoleTest.java

示例13: 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   :");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:39,代碼來源:SMTRunnerConsoleTest.java

示例14: 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", "");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:SMTRunnerConsoleTest.java

示例15: 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", "");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:SMTRunnerConsoleTest.java


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