~ubuntu-branches/ubuntu/utopic/testng/utopic

« back to all changes in this revision

Viewing changes to src/main/org/testng/internal/Graph.java

  • Committer: Bazaar Package Importer
  • Author(s): Marcus Better
  • Date: 2009-07-23 12:11:17 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090723121117-k1so370589zvpef2
* Changed section to "java".
* debian/rules: Make it work with debhelper 7.3.5. (Closes: #538016)
* Use qdox 1.9 and add a patch for the API changes. Thanks to Ludovic
  Claude.
* debian/control: Bump policy version to 3.8.2.
* debian/control: Build with default-jdk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package org.testng.internal;
2
2
 
3
3
import org.testng.TestNGException;
 
4
import org.testng.collections.Lists;
4
5
 
5
6
import java.util.ArrayList;
6
7
import java.util.Collection;
 
8
import java.util.Collections;
7
9
import java.util.HashMap;
8
10
import java.util.HashSet;
9
11
import java.util.LinkedList;
128
130
    }
129
131
    
130
132
    //
 
133
    // Sort the nodes alphabetically to make sure that methods of the same class
 
134
    // get run close to each other as much as possible
 
135
    //
 
136
    Collections.sort(nodes2);
 
137
    
 
138
    //
131
139
    // Sort
132
140
    //
133
141
    while (! nodes2.isEmpty()) {
208
216
    // Locate the node
209
217
    Node<T> node = findNode(o);
210
218
    if (null == node) {
211
 
      throw new AssertionError("No such node: " + o);
 
219
      // This can happen if an interceptor returned new methods
 
220
      return Lists.newArrayList();
212
221
    }
213
222
 
214
223
    // If we found the node, use breadth first search to find all
251
260
  /////
252
261
  // class Node
253
262
  //
254
 
  public static class Node<T> {
 
263
  public static class Node<T> implements Comparable<Node<T>> {
255
264
    private T m_object = null;
256
265
    private Map<T, T> m_predecessors = new HashMap<T, T>();
257
266
    
335
344
    public boolean hasPredecessor(T m) {
336
345
      return m_predecessors.containsKey(m);
337
346
    }
 
347
 
 
348
    public int compareTo(Node<T> o) {
 
349
      return getObject().toString().compareTo(o.getObject().toString());
 
350
    }
338
351
  } 
339
352
  
340
353
  //