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

https://bitbucket.org/nbargnesi/idea · Java · 80 lines · 35 code · 14 blank · 31 comment · 0 complexity · ad92273a196ef5c1039e5cf87de25b07 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.ui;
  17. import com.intellij.execution.testframework.AbstractTestProxy;
  18. import com.intellij.execution.testframework.TestFrameworkRunningModel;
  19. import com.intellij.execution.testframework.sm.runner.SMTestProxy;
  20. import com.intellij.openapi.Disposable;
  21. import org.jetbrains.annotations.NotNull;
  22. import org.jetbrains.annotations.Nullable;
  23. /**
  24. * @author Roman Chernyatchik
  25. */
  26. public interface TestResultsViewer extends Disposable {
  27. /**
  28. * Fake Root for toplevel test suits/tests
  29. *
  30. * @return root
  31. */
  32. SMTestProxy getTestsRootNode();
  33. /**
  34. * Selects test or suite in Tests tree and notify about selection changed
  35. *
  36. * @param proxy
  37. */
  38. void selectAndNotify(@Nullable AbstractTestProxy proxy);
  39. void addEventsListener(EventsListener listener);
  40. void setShowStatisticForProxyHandler(PropagateSelectionHandler handler);
  41. /**
  42. * If handler for statistics was set this method will execute it
  43. */
  44. void showStatisticsForSelectedProxy();
  45. interface EventsListener extends TestProxyTreeSelectionListener {
  46. void onTestingStarted(TestResultsViewer sender);
  47. void onTestingFinished(TestResultsViewer sender);
  48. void onTestNodeAdded(TestResultsViewer sender, SMTestProxy test);
  49. }
  50. class SMEventsAdapter implements EventsListener {
  51. @Override
  52. public void onTestingStarted(TestResultsViewer sender) {
  53. }
  54. @Override
  55. public void onTestingFinished(TestResultsViewer sender) {
  56. }
  57. @Override
  58. public void onTestNodeAdded(TestResultsViewer sender, SMTestProxy test) {
  59. }
  60. @Override
  61. public void onSelected(@Nullable SMTestProxy selectedTestProxy,
  62. @NotNull TestResultsViewer viewer,
  63. @NotNull TestFrameworkRunningModel model) {
  64. }
  65. }
  66. }