diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2014-08-16 00:22:52 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2014-08-16 00:39:53 +0800 |
commit | 774cb99b4713e145cee92217eb24a0f4a2649e26 (patch) | |
tree | 20300a8aa2c3142751e23c9004c81316f6f34a23 | |
parent | 85692369a3d7bf968de7ff2af2c34349f0881d3d (diff) | |
download | cts-linaro-armv8-14.08.tar.gz |
sort the content of cts libcore testcases xmllinaro-armv8-14.08
since the testcases xml for libcore packages are generated
with different method from the normal cts package,
the content are not sorted and thus are not easy to check.
this change is to make the content in the testcases xml are sorted
cts-xml-generator/
Change-Id: I0a05266a6809955321fb6b0e506b48ae044a35c8
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | tools/utils/CollectAllTests.java | 4 | ||||
-rw-r--r-- | tools/utils/DescriptionGenerator.java | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tools/utils/CollectAllTests.java b/tools/utils/CollectAllTests.java index fe13e004980..f78d2907802 100644 --- a/tools/utils/CollectAllTests.java +++ b/tools/utils/CollectAllTests.java @@ -38,7 +38,7 @@ import java.util.Arrays; import java.util.Enumeration; import java.util.HashSet; import java.util.Iterator; -import java.util.LinkedHashMap; +import java.util.TreeMap; import java.util.Map; import java.util.Set; import java.util.jar.JarEntry; @@ -183,7 +183,7 @@ public class CollectAllTests extends DescriptionGenerator { System.exit(1); } - Map<String,TestClass> testCases = new LinkedHashMap<String, TestClass>(); + Map<String,TestClass> testCases = new TreeMap<String, TestClass>(); String javaPackagePrefix = javaPackageFilter.isEmpty() ? "" : (javaPackageFilter + "."); diff --git a/tools/utils/DescriptionGenerator.java b/tools/utils/DescriptionGenerator.java index 0731b493e35..c999898da83 100644 --- a/tools/utils/DescriptionGenerator.java +++ b/tools/utils/DescriptionGenerator.java @@ -21,7 +21,9 @@ import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Iterator; +import java.util.List; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -415,7 +417,9 @@ public class DescriptionGenerator extends Doclet { // if no method, remove from parent elem.getParentNode().removeChild(elem); } else { - for (TestMethod caze : cases) { + List<TestMethod> list = new ArrayList<TestMethod>(cases); + Collections.sort(list); + for (TestMethod caze : list) { if (caze.mIsBroken || caze.mIsSuppressed || caze.mKnownFailure != null) { continue; } @@ -610,7 +614,7 @@ public class DescriptionGenerator extends Doclet { /** * Represent the test method inside the test class. */ - static class TestMethod { + static class TestMethod implements Comparable<TestMethod>{ String mName; String mDescription; String mController; @@ -634,5 +638,14 @@ public class DescriptionGenerator extends Doclet { mIsBroken = isBroken; mIsSuppressed = isSuppressed; } + + public String getName() { + return mName; + } + + @Override + public int compareTo(TestMethod another) { + return getName().compareTo(another.getName()); + } } } |