diff -r e6a4db88c6dc src/vm/runtime/defmeth/shared/DefMethTest.java --- a/src/vm/runtime/defmeth/shared/DefMethTest.java Tue Oct 15 14:36:34 2013 -0700 +++ b/src/vm/runtime/defmeth/shared/DefMethTest.java Tue Nov 12 13:37:23 2013 -0800 @@ -5,6 +5,7 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; +import java.util.TreeSet; import java.util.regex.Pattern; import nsk.share.TestFailure; import nsk.share.log.Log; @@ -213,6 +214,15 @@ /** Information about the test being executed */ public String shortTestName; + public static class ComparableMethod implements Comparable { + final java.lang.reflect.Method m; + ComparableMethod(java.lang.reflect.Method m) { this.m = m; } + public int compareTo(ComparableMethod mo) { + String name = m.getName(); + String mo_name = mo.m.getName(); + return name.compareTo(mo_name); + } + } /** * Execute all tests from current class and report status. @@ -240,7 +250,13 @@ getLog().info(format("\n%s %s", test.getSimpleName(), factory.toString())); + TreeSet ts = new TreeSet(); for (java.lang.reflect.Method m : test.getDeclaredMethods()) { + ts.add(new ComparableMethod(m)); + } + + for (ComparableMethod cm : ts) { + java.lang.reflect.Method m = cm.m; for (ExecutionMode mode : invocationModes) { shortTestName = format("%s.%s", test.getSimpleName(), m.getName()); diff -r e6a4db88c6dc src/vm/runtime/defmeth/shared/MemoryClassLoader.java --- a/src/vm/runtime/defmeth/shared/MemoryClassLoader.java Tue Oct 15 14:36:34 2013 -0700 +++ b/src/vm/runtime/defmeth/shared/MemoryClassLoader.java Tue Nov 12 13:37:23 2013 -0800 @@ -3,7 +3,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; import nsk.share.TestFailure; @@ -17,12 +17,12 @@ private Map classes; public MemoryClassLoader(Map classes) { - this.classes = new HashMap<>(classes); + this.classes = new LinkedHashMap<>(classes); } public MemoryClassLoader(Map classes, ClassLoader parent) { super(parent); - this.classes = new HashMap<>(classes); + this.classes = new LinkedHashMap<>(classes); } @Override diff -r e6a4db88c6dc src/vm/runtime/defmeth/shared/builder/TestBuilder.java --- a/src/vm/runtime/defmeth/shared/builder/TestBuilder.java Tue Oct 15 14:36:34 2013 -0700 +++ b/src/vm/runtime/defmeth/shared/builder/TestBuilder.java Tue Nov 12 13:37:23 2013 -0800 @@ -94,7 +94,7 @@ private List tests = new ArrayList<>(); // Elements under construction - private Set> underConstruction = new HashSet<>(); + private Set> underConstruction = new LinkedHashSet<>(); private DefMethTest testInstance; @@ -345,7 +345,7 @@ * @return */ private Map produce(int defaultMajorVer, List elements) { - HashMap classes = new HashMap<>(); + LinkedHashMap classes = new LinkedHashMap<>(); if (Constants.PRINT_TESTS) { System.out.printf("\nTEST: %s\n\n", Util.getTestName()); diff -r e6a4db88c6dc src/vm/runtime/defmeth/shared/executor/MHInvokeWithArgsTest.java --- a/src/vm/runtime/defmeth/shared/executor/MHInvokeWithArgsTest.java Tue Oct 15 14:36:34 2013 -0700 +++ b/src/vm/runtime/defmeth/shared/executor/MHInvokeWithArgsTest.java Tue Nov 12 13:37:23 2013 -0800 @@ -142,11 +142,11 @@ : target.getClass(); Class expectedExc; try { - expectedExc = cl.loadClass(expectedExcName); + expectedExc = cl.getSystemClassLoader().loadClass(expectedExcName); } catch (ClassNotFoundException e) { throw new Error(e); } - if (!expectedExc.isAssignableFrom(target.getClass())) + if (!expectedExc.isAssignableFrom(actualExc)) throw new TestFailure( String.format("Caught exception as expected, but it's type is wrong: expected: %s; actual: %s.", expectedExcName, actualExc.getName()), target);