コード例 #1
0
  public static void addLabel(final TestFrameworkRunningModel model) {
    String label;
    int color;

    if (model.getRoot().isDefect()) {
      color = RED.getRGB();
      label = ExecutionBundle.message("junit.runing.info.tests.failed.label");
    } else {
      color = GREEN.getRGB();
      label = ExecutionBundle.message("junit.runing.info.tests.passed.label");
    }
    final TestConsoleProperties consoleProperties = model.getProperties();
    String name = label + " " + consoleProperties.getConfiguration().getName();
    LocalHistory.getInstance().putSystemLabel(consoleProperties.getProject(), name, color);
  }
コード例 #2
0
 private static void addToHistory(
     final SMTestProxy.SMRootTestProxy root,
     TestConsoleProperties consoleProperties,
     Disposable parentDisposable) {
   final RunProfile configuration = consoleProperties.getConfiguration();
   if (configuration instanceof RunConfiguration
       && !(consoleProperties instanceof ImportedTestConsoleProperties)) {
     final MySaveHistoryTask backgroundable =
         new MySaveHistoryTask(consoleProperties, root, (RunConfiguration) configuration);
     final BackgroundableProcessIndicator processIndicator =
         new BackgroundableProcessIndicator(backgroundable);
     Disposer.register(
         parentDisposable,
         new Disposable() {
           @Override
           public void dispose() {
             processIndicator.cancel();
             backgroundable.dispose();
           }
         });
     Disposer.register(parentDisposable, processIndicator);
     ProgressManager.getInstance()
         .runProcessWithProgressAsynchronously(backgroundable, processIndicator);
   }
 }
コード例 #3
0
  public SMTestRunnerResultsForm(
      @NotNull final JComponent console,
      AnAction[] consoleActions,
      final TestConsoleProperties consoleProperties,
      @Nullable String splitterPropertyName) {
    super(
        console,
        consoleActions,
        consoleProperties,
        StringUtil.notNullize(splitterPropertyName, DEFAULT_SM_RUNNER_SPLITTER_PROPERTY),
        0.2f);
    myProject = consoleProperties.getProject();

    // Create tests common suite root
    //noinspection HardCodedStringLiteral
    myTestsRootNode = new SMTestProxy.SMRootTestProxy();
    // todo myTestsRootNode.setOutputFilePath(runConfiguration.getOutputFilePath());

    // Fire selection changed and move focus on SHIFT+ENTER
    // TODO[romeo] improve
    /*
    final ArrayList<Component> components = new ArrayList<Component>();
    components.add(myTreeView);
    components.add(myTabs.getComponent());
    myContentPane.setFocusTraversalPolicy(new MyFocusTraversalPolicy(components));
    myContentPane.setFocusCycleRoot(true);
    */
  }
コード例 #4
0
 public MySaveHistoryTask(
     TestConsoleProperties consoleProperties,
     SMTestProxy.SMRootTestProxy root,
     RunConfiguration configuration) {
   super(consoleProperties.getProject(), "Save Test Results", true);
   myConsoleProperties = consoleProperties;
   myRoot = root;
   myConfiguration = configuration;
 }