DependencySorter { public String[] sort() { return collectLocationNames(sortLocations()); } DependencySorter(String[] configLocations, Map<String, List<BeanReferenceInfo>> imports, Map<String, BeanReferenceInfo> exports); void setProhibitCycles(boolean prohibitCycles); String[] getConflictContextGroup(); String[] sort(); String[] collectLocationNames(List<Location> locations);  }
@Test public void simpleTestsSort() { fillSimpleData(); DependencySorter sorter = new DependencySorter(getLocations(), getImports(), getExports()); String[] locations = sorter.sort(); checkLocations(locations, getLocations()); }
@Test public void sortWithRedundantExports() { fillLocationsWithRedundantExports(); DependencySorter sorter = new DependencySorter(getLocations(), getImports(), getExports()); String[] locations = sorter.sort(); checkLocations(locations, getLocations()); }
@Test public void sortWithSolvableConflict() { fillLocationsWithSolvableConlict(); DependencySorter sorter = new DependencySorter(getLocations(), getImports(), getExports()); String[] locations = sorter.sort(); checkLocations(locations, new String[]{"some1.test.location.xml", "some3.test.location.xml", "some2.test.location.xml", "some4.test.location.xml"}); }