Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-08-30 10:43:51 +0000
committerMarkus Keller2012-08-30 10:43:51 +0000
commit109057d1c59d4e9deb46e848dc6f4d810f43820c (patch)
treedd4460f7af3542e22b1cfd2225ef6eae0d79645a /org.eclipse.ui.workbench.texteditor.tests
parent54d70bc9abb288b278ce134bfe8f6dae764f4a4e (diff)
downloadeclipse.platform.text-109057d1c59d4e9deb46e848dc6f4d810f43820c.tar.gz
eclipse.platform.text-109057d1c59d4e9deb46e848dc6f4d810f43820c.tar.xz
eclipse.platform.text-109057d1c59d4e9deb46e848dc6f4d810f43820c.zip
clean up
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor.tests')
-rw-r--r--org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/BytecodeOrderedTestSuite.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/BytecodeOrderedTestSuite.java b/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/BytecodeOrderedTestSuite.java
index b08cfb84f..42d61fdec 100644
--- a/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/BytecodeOrderedTestSuite.java
+++ b/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/BytecodeOrderedTestSuite.java
@@ -24,7 +24,7 @@ import junit.framework.TestSuite;
/**
* Test suite that contains the same tests as a regular {@link TestSuite},
- * but the order of tests is the bytecode order from the classfile.
+ * but the order of tests is the order as declared in the classfile's bytecode.
*
* <p>
* <b>Background:</b> {@link java.lang.Class#getDeclaredMethods()} does not
@@ -38,7 +38,7 @@ import junit.framework.TestSuite;
public class BytecodeOrderedTestSuite extends TestSuite {
/**
- * Creates a new test suite that runs tests in bytecode order.
+ * Creates a new test suite that runs tests in bytecode declaration order.
*
* @param testClass the JUnit-3-style test class
*/
@@ -47,7 +47,7 @@ public class BytecodeOrderedTestSuite extends TestSuite {
}
/**
- * Creates a new test suite that runs tests in bytecode order.
+ * Creates a new test suite that runs tests in bytecode declaration order.
*
* @param testClass the JUnit-3-style test class
* @param name the name of the suite
@@ -105,7 +105,11 @@ public class BytecodeOrderedTestSuite extends TestSuite {
};
}
- private ArrayList addDeclaredTestMethodNames(Class c, ArrayList methodNames) throws IOException {
+ private void addDeclaredTestMethodNames(Class c, ArrayList methodNames) throws IOException {
+ /*
+ * XXX: This method needs to be updated if a new major class file version
+ * or new constant pool tags are specified.
+ */
String className= c.getName();
int lastDot= className.lastIndexOf(".");
if (lastDot != -1)
@@ -116,7 +120,7 @@ public class BytecodeOrderedTestSuite extends TestSuite {
throw new IOException("bad magic bytes: 0x" + Integer.toHexString(magic));
skip(is, 2); // minor_version
int major= is.readUnsignedShort();
- if (major > 51) { // > Java 7
+ if (major > 51) { // major > Java 7
addTest(error(c, "suite can't handle class file version", new RuntimeException(c.getName() + " (major = " + major + ")")));
}
int cpCount= is.readUnsignedShort();
@@ -143,7 +147,7 @@ public class BytecodeOrderedTestSuite extends TestSuite {
case 5: // CONSTANT_Long
case 6: // CONSTANT_Double
skip(is, 8);
- i++; // weird spec
+ i++; // weird spec wants this
break;
case 12: // CONSTANT_NameAndType
skip(is, 4);
@@ -195,7 +199,6 @@ public class BytecodeOrderedTestSuite extends TestSuite {
skip(is, attInfoCount);
}
}
- return methodNames;
}
private static void skip(DataInputStream is, long bytes) throws IOException {

Back to the top