/platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralTestEventsProcessor.java

https://bitbucket.org/nbargnesi/idea · Java · 79 lines · 32 code · 18 blank · 29 comment · 0 complexity · 3fdd6f865980b0f77de512007e3a2daa MD5 · raw file

  1. /*
  2. * Copyright 2000-2009 JetBrains s.r.o.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.intellij.execution.testframework.sm.runner;
  17. import com.intellij.execution.testframework.sm.runner.events.*;
  18. import com.intellij.openapi.Disposable;
  19. import com.intellij.openapi.util.Key;
  20. import com.intellij.testIntegration.TestLocationProvider;
  21. import org.jetbrains.annotations.NotNull;
  22. import org.jetbrains.annotations.Nullable;
  23. /**
  24. * @author: Roman Chernyatchik
  25. *
  26. * Processes events of test runner in general text-based form
  27. *
  28. * NB: Test name should be unique for all suites. E.g. it can consist of suite name
  29. * and name of test method
  30. */
  31. public interface GeneralTestEventsProcessor extends Disposable {
  32. void onStartTesting();
  33. void onTestsCountInSuite(final int count);
  34. void onTestStarted(@NotNull TestStartedEvent testStartedEvent);
  35. void onTestFinished(@NotNull TestFinishedEvent testFinishedEvent);
  36. void onTestFailure(@NotNull TestFailedEvent testFailedEvent);
  37. void onTestIgnored(@NotNull TestIgnoredEvent testIgnoredEvent);
  38. void onTestOutput(@NotNull TestOutputEvent testOutputEvent);
  39. void onSuiteStarted(@NotNull TestSuiteStartedEvent suiteStartedEvent);
  40. void onSuiteFinished(@NotNull TestSuiteFinishedEvent suiteFinishedEvent);
  41. void onUncapturedOutput(@NotNull final String text,
  42. final Key outputType);
  43. void onError(@NotNull final String localizedMessage,
  44. @Nullable final String stackTrace,
  45. final boolean isCritical);
  46. // Custom progress statistics
  47. /**
  48. * @param categoryName If isn't empty then progress statistics will use only custom start/failed events.
  49. * If name is null statistics will be switched to normal mode
  50. * @param testCount - 0 will be considered as unknown tests number
  51. */
  52. void onCustomProgressTestsCategory(@Nullable final String categoryName,
  53. final int testCount);
  54. void onCustomProgressTestStarted();
  55. void onCustomProgressTestFailed();
  56. void onTestsReporterAttached();
  57. void setLocator(@NotNull TestLocationProvider locator);
  58. void addEventsListener(@NotNull SMTRunnerEventsListener viewer);
  59. void onFinishTesting();
  60. void setPrinterProvider(@NotNull TestProxyPrinterProvider printerProvider);
  61. }