当前位置: 首页>>代码示例>>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;未经允许,请勿转载。