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


Java TestsProgressAnimator類代碼示例

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


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

示例1: createTestTreeView

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
protected JComponent createTestTreeView() {
  tree = new TestNGTestTreeView();

  final TestTreeStructure structure = new TestTreeStructure(project, rootNode);
  tree.attachToModel(this);
  treeBuilder = new TestTreeBuilder(tree, structure);
  Disposer.register(this, treeBuilder);

  animator = new TestsProgressAnimator(treeBuilder);

  openSourceListener = new OpenSourceSelectionListener();
  tree.getSelectionModel().addTreeSelectionListener(openSourceListener);

  TrackRunningTestUtil.installStopListeners(tree, this, new Pass<AbstractTestProxy>() {
    @Override
    public void pass(AbstractTestProxy abstractTestProxy) {
      myLastSelected = (TestProxy)abstractTestProxy;
    }
  });

  return tree;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:TestNGResults.java

示例2: getIcon

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
@Nullable
private static Icon getIcon(final SMTestProxy testProxy,
                            final TestConsoleProperties consoleProperties) {
  final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo();

  final boolean hasErrors = testProxy.hasErrors();

  switch (magnitude) {
    case ERROR_INDEX:
      return ERROR_ICON;
    case FAILED_INDEX:
      return hasErrors ? FAILED_E_ICON : FAILED_ICON;
    case IGNORED_INDEX:
      return hasErrors ? IGNORED_E_ICON : IGNORED_ICON;
    case NOT_RUN_INDEX:
      return NOT_RAN;
    case COMPLETE_INDEX:
    case PASSED_INDEX:
      return hasErrors ? PASSED_E_ICON : PASSED_ICON;
    case RUNNING_INDEX:
      if (consoleProperties.isPaused()) {
        return hasErrors ? PAUSED_E_ICON : AllIcons.RunConfigurations.TestPaused;
      }
      else {
        final int frameIndex = TestsProgressAnimator.getCurrentFrameIndex();
        return hasErrors ? FRAMES_E[frameIndex] : TestsProgressAnimator.FRAMES[frameIndex];
      }
    case SKIPPED_INDEX:
      return hasErrors ? SKIPPED_E_ICON : SKIPPED_ICON;
    case TERMINATED_INDEX:
      return hasErrors ? TERMINATED_E_ICON : TERMINATED_ICON;
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:35,代碼來源:TestsPresentationUtil.java

示例3: assertIsAnimatorProgressIcon

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
private static void assertIsAnimatorProgressIcon(final Icon icon) {
  for (Icon frame : TestsProgressAnimator.FRAMES) {
    if (icon == frame) {
      return;
    }
  }

  fail("Icon isn't an Animator progress frame");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:TestsPresentationUtilTest.java

示例4: getIconFor

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
public static Icon getIconFor(final TestProxy testProxy, final boolean isPaused) {
  final int magnitude = testProxy.getState().getMagnitude();
  if (magnitude == PoolOfTestStates.RUNNING_INDEX)
    return isPaused ? AllIcons.RunConfigurations.TestPaused : TestsProgressAnimator.getCurrentFrame();
  else
    return ourIcons.get(new Integer(magnitude));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:TestRenderer.java

示例5: assertIsAnimatorProgressIcon

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
private void assertIsAnimatorProgressIcon(final Icon icon) {
  for (Icon frame : TestsProgressAnimator.FRAMES) {
    if (icon == frame) {
      return;
    }
  }

  fail("Icon isn't an Animator progress frame");
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:10,代碼來源:TestsPresentationUtilTest.java

示例6: getIcon

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
@javax.annotation.Nullable
private static Icon getIcon(final SMTestProxy testProxy,
                            final TestConsoleProperties consoleProperties) {
  final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo();

  final boolean hasErrors = testProxy.hasErrors();

  switch (magnitude) {
    case ERROR_INDEX:
      return ERROR_ICON;
    case FAILED_INDEX:
      return hasErrors ? FAILED_E_ICON : FAILED_ICON;
    case IGNORED_INDEX:
      return hasErrors ? IGNORED_E_ICON : IGNORED_ICON;
    case NOT_RUN_INDEX:
      return NOT_RAN;
    case COMPLETE_INDEX:
    case PASSED_INDEX:
      return hasErrors ? PASSED_E_ICON : PASSED_ICON;
    case RUNNING_INDEX:
      if (consoleProperties.isPaused()) {
        return hasErrors ? PAUSED_E_ICON : AllIcons.RunConfigurations.TestPaused;
      }
      else {
        final int frameIndex = TestsProgressAnimator.getCurrentFrameIndex();
        return hasErrors ? FRAMES_E[frameIndex] : TestsProgressAnimator.FRAMES[frameIndex];
      }
    case SKIPPED_INDEX:
      return hasErrors ? SKIPPED_E_ICON : SKIPPED_ICON;
    case TERMINATED_INDEX:
      return hasErrors ? TERMINATED_E_ICON : TERMINATED_ICON;
  }
  return null;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:35,代碼來源:TestsPresentationUtil.java

示例7: createTestTreeView

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
protected JComponent createTestTreeView() {
  myTreeView = new SMTRunnerTestTreeView();

  myTreeView.setLargeModel(true);
  myTreeView.attachToModel(this);
  myTreeView.setTestResultsViewer(this);
  if (Registry.is("tests.view.old.statistics.panel")) {
    addTestsTreeSelectionListener(new TreeSelectionListener() {
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        AbstractTestProxy selectedTest = getTreeView().getSelectedTest();
        if (selectedTest instanceof SMTestProxy) {
          myStatisticsPane.selectProxy(((SMTestProxy)selectedTest), this, false);
        }
      }
    });
  }

  final SMTRunnerTreeStructure structure = new SMTRunnerTreeStructure(myProject, myTestsRootNode);
  myTreeBuilder = new SMTRunnerTreeBuilder(myTreeView, structure);
  myTreeBuilder.setTestsComparator(TestConsoleProperties.SORT_ALPHABETICALLY.value(myProperties));
  Disposer.register(this, myTreeBuilder);

  myAnimator = new TestsProgressAnimator(myTreeBuilder);

  TrackRunningTestUtil.installStopListeners(myTreeView, myProperties, new Pass<AbstractTestProxy>() {
    @Override
    public void pass(AbstractTestProxy testProxy) {
      if (testProxy == null) return;
      //drill to the first leaf
      while (!testProxy.isLeaf()) {
        final List<? extends AbstractTestProxy> children = testProxy.getChildren();
        if (!children.isEmpty()) {
          final AbstractTestProxy firstChild = children.get(0);
          if (firstChild != null) {
            testProxy = firstChild;
            continue;
          }
        }
        break;
      }

      //pretend the selection on the first leaf
      //so if test would be run, tracking would be restarted 
      myLastSelected = testProxy;
    }
  });

  //TODO always hide root node
  //myTreeView.setRootVisible(false);
  myUpdateQueue = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, this);
  return myTreeView;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:54,代碼來源:SMTestRunnerResultsForm.java

示例8: customizeCellRenderer

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
@Override
public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
    if (node.getUserObject() instanceof TestNodeDescriptor) {
        TestProxy proxy = ((TestNodeDescriptor) node.getUserObject()).getElement();
        if (node == tree.getModel().getRoot()) {
            TreeRootNode root = (TreeRootNode) proxy;
            if (node.getChildCount() == 0 && !((TestNGResults)model).hasFinishedTests()) {
                if ((root.isStarted() && root.isInProgress()) || (root.isInProgress() && !root.isStarted())) {
                    setIcon(PoolOfTestIcons.NOT_RAN);
                    append("Instantiating tests... ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
                } else if (root.isStarted() && !root.isInProgress()) {
                    setIcon(PoolOfTestIcons.PASSED_ICON);
                    append("All Tests Passed.", SimpleTextAttributes.REGULAR_ATTRIBUTES);
                } else {
                    setIcon(PoolOfTestIcons.NOT_RAN);
                    append("No Test Results.", SimpleTextAttributes.REGULAR_ATTRIBUTES);
                }

            } else {
                setIcon(root.isInProgress() ? TestsProgressAnimator.getCurrentFrame() : getIcon(proxy));
                append(root.isInProgress() ? "Running tests..." : "Test Results", SimpleTextAttributes.REGULAR_ATTRIBUTES);
            }

            if (model.getProperties().isPaused()) {
                setIcon(AllIcons.RunConfigurations.TestPaused);
            }
        } else {
            if (proxy.getResultMessage() != null) {
              final TestResultMessage result = proxy.getResultMessage();
              final String name = TestProxy.toDisplayText(result, model.getProperties().getProject());
              append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);
            } else {
                append(proxy.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
            }
            setIcon(proxy.isInProgress() ? TestsProgressAnimator.getCurrentFrame() : proxy.isInterrupted() ? PoolOfTestIcons.NOT_RAN : getIcon(proxy));
        }
    } else {
        setIcon(TestsProgressAnimator.getCurrentFrame());
        append(node.getUserObject() != null ? node.getUserObject().toString() : "null", SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:43,代碼來源:ResultTreeRenderer.java

示例9: createTestTreeView

import com.intellij.execution.testframework.ui.TestsProgressAnimator; //導入依賴的package包/類
@Override
protected JComponent createTestTreeView() {
  myTreeView = new SMTRunnerTestTreeView();

  myTreeView.setLargeModel(true);
  myTreeView.attachToModel(this);
  myTreeView.setTestResultsViewer(this);
  if (Registry.is("tests.view.old.statistics.panel")) {
    addTestsTreeSelectionListener(new TreeSelectionListener() {
      @Override
      public void valueChanged(TreeSelectionEvent e) {
        AbstractTestProxy selectedTest = getTreeView().getSelectedTest();
        if (selectedTest instanceof SMTestProxy) {
          myStatisticsPane.selectProxy(((SMTestProxy)selectedTest), this, false);
        }
      }
    });
  }

  final SMTRunnerTreeStructure structure = new SMTRunnerTreeStructure(myProject, myTestsRootNode);
  myTreeBuilder = new SMTRunnerTreeBuilder(myTreeView, structure);
  myTreeBuilder.setTestsComparator(TestConsoleProperties.SORT_ALPHABETICALLY.value(myProperties));
  Disposer.register(this, myTreeBuilder);

  myAnimator = new TestsProgressAnimator(myTreeBuilder);

  TrackRunningTestUtil.installStopListeners(myTreeView, myProperties, new Pass<AbstractTestProxy>() {
    @Override
    public void pass(AbstractTestProxy testProxy) {
      if (testProxy == null) return;
      final AbstractTestProxy selectedProxy = testProxy;
      //drill to the first leaf
      while (!testProxy.isLeaf()) {
        final List<? extends AbstractTestProxy> children = testProxy.getChildren();
        if (!children.isEmpty()) {
          final AbstractTestProxy firstChild = children.get(0);
          if (firstChild != null) {
            testProxy = firstChild;
            continue;
          }
        }
        break;
      }

      //pretend the selection on the first leaf
      //so if test would be run, tracking would be restarted
      myLastSelected = testProxy;

      //ensure scroll to source on explicit selection only
      if (ScrollToTestSourceAction.isScrollEnabled(SMTestRunnerResultsForm.this)) {
        final Navigatable descriptor = TestsUIUtil.getOpenFileDescriptor(selectedProxy, SMTestRunnerResultsForm.this);
        if (descriptor != null) {
          OpenSourceUtil.navigate(false, descriptor);
        }
      }
    }
  });

  //TODO always hide root node
  //myTreeView.setRootVisible(false);
  myUpdateQueue = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, this);
  return myTreeView;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:64,代碼來源:SMTestRunnerResultsForm.java


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