Package org.testng.eclipse.ui

Examples of org.testng.eclipse.ui.RunInfo


  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (m_searchString == null || m_searchString.length() == 0) {
      return true;
    }

    RunInfo p = (RunInfo) element;

    return p.getTestName().toLowerCase().matches(m_searchString.toLowerCase());
  }
View Full Code Here


  }

  public int compare(Viewer viewer, Object e1, Object e2) {
    int result = 0;

    RunInfo r1 = (RunInfo) e1;
    RunInfo r2 = (RunInfo) e2;
    switch(m_column) {
      // Test name
      case 0 : result = r1.getTestName().compareTo(r2.getTestName()); break;

      // Time
      case 1: result = (int) (m_tab.getTestTime(r1.getTestId())
          - m_tab.getTestTime(r2.getTestId()));
          break;

      // Class count
      case 2: result = (int) (m_tab.getTestClassCount(r1.getTestId())
          - m_tab.getTestClassCount(r2.getTestId()));
          break;

      // Method count
      case 3: result = (int) (m_tab.getTestMethodCount(r1.getTestId())
          - m_tab.getTestMethodCount(r2.getTestId()));
          break;
    }

    return adjustDirection(result);
  }
View Full Code Here

      public void selectionChanged(SelectionChangedEvent event) {
        ISelection selection = event.getSelection();
        if (selection instanceof StructuredSelection) {
          StructuredSelection ss = (StructuredSelection) selection;
          RunInfo selected = ((RunInfo) ss.getFirstElement());
          if (selected != null) {
            String selectedId = ((RunInfo) ss.getFirstElement()).getTestId();
            if (m_selectedId != null && !m_selectedId.startsWith(selectedId)) {
              m_selectedId = selectedId;
            }
          }
        }
      }

    });

    //
    // Content provider
    //
    m_testViewer.setContentProvider(new IStructuredContentProvider() {

      public void dispose() {
      }

      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
      }

      public Object[] getElements(Object inputElement) {
        return m_tests.values().toArray();
      }
     
    });

    //
    // Label provider
    //
    m_testViewer.setLabelProvider(new ITableLabelProvider() {
     
      public void removeListener(ILabelProviderListener listener) {
      }
     
      public boolean isLabelProperty(Object element, String property) {
        return false;
      }
     
      public void dispose() {
      }
     
      public void addListener(ILabelProviderListener listener) {
      }
     
      public String getColumnText(Object element, int columnIndex) {
        RunInfo runInfo = (RunInfo) element;
        String testId = runInfo.getTestId();
        switch(columnIndex) {
          case 0return ((RunInfo) element).getTestName();
          case 1: return MessageFormat.format("{0}", ((float) getTestTime(testId)) / 1000);
          case 2: return Integer.toString(getTestClassCount(testId));
          case 3: return Integer.toString(getTestMethodCount(testId));
View Full Code Here

  public TestMethodTreeItem(TreeItem parent, RunInfo runInfo) {
    super(parent, runInfo);
  }

  protected String getLabel() {
    RunInfo runInfo = getRunInfo();
    String result = runInfo.getMethodName() + runInfo.getInvocationCountDisplay();
    return result;
  }
View Full Code Here

TOP

Related Classes of org.testng.eclipse.ui.RunInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.