src/test/java/de/dfki/lt/loot/digraph/algo/TestTopoOrderVisitor.java
@Test
  public void test() throws CyclicGraphException {
    // calculate topological order
    @SuppressWarnings("unchecked")
    VertexPropertyMap<String> names =
        (VertexPropertyMap<String>)graph.getPropertyMap("names");
    StringBuilder result = new StringBuilder();
    for (int v : graph.topoSort()) {
      result.append(String.format("%s ", names.get(v)));
    }
    assertEquals(
      "socks undershorts pants shoes watch shirt belt tie jacket",
      result.toString().trim());
  }
/**
   * Tests the {@link TopoOrderVisitor} via graph.toposort()
   * @throws CyclicGraphException
   */
Tests the  TopoOrderVisitor via graph.toposort()
@throws CyclicGraphException
Tests the TopoOrderVisitor via graph . toposort () @throws CyclicGraphException
@Test
  public void test() throws CyclicGraphException {
    @SuppressWarnings("unchecked")
    VertexPropertyMap<String> names =
        (VertexPropertyMap<String>)graph.getPropertyMap("names");
    StringBuilder result = new StringBuilder();
    for (int v : graph.topoSort()) {
      result.append(String.format("%s ", names.get(v)));
    }
    assertEquals(
      "socks undershorts pants shoes watch shirt belt tie jacket",
      result.toString().trim());
  }
@ Test public void test ( ) throws CyclicGraphException { @ SuppressWarnings ( "unchecked" ) VertexPropertyMap < String > names = ( VertexPropertyMap < String > ) graph . getPropertyMap ( "names" ) ; StringBuilder result = new StringBuilder ( ) ; for ( int v : graph . topoSort ( ) ) { result . append ( String . format ( "%s " , names . get ( v ) ) ) ; } assertEquals ( "socks undershorts pants shoes watch shirt belt tie jacket" , result . toString ( ) . trim ( ) ) ; }
Tests the {@link TopoOrderVisitor} via graph.toposort()
 @throws CyclicGraphException
Tests the { @link TopoOrderVisitor } via graph . toposort () @throws CyclicGraphException
// calculate topological order