Package gw.test
Class TestClassHelper
java.lang.Object
gw.test.TestClassHelper
Helper methods for analyzing methods, and instantiating test classes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends junit.framework.TestCase>
junit.framework.TestcreateTestSuite
(Class<T> clazz, Iterable<String> methodNames) private static <T extends junit.framework.TestCase>
Constructor<T>getConstructor
(Class<T> clazz) private static int
getLineNumber
(org.objectweb.asm.tree.MethodNode o2) static <T extends junit.framework.TestCase>
List<org.objectweb.asm.tree.MethodNode>getMethodsSorted
(Class<T> clazz) Returns list of methods according to their order in the source file.private static org.objectweb.asm.tree.ClassNode
parseClass
(Class<?> clazz)
-
Field Details
-
cache
-
-
Constructor Details
-
TestClassHelper
public TestClassHelper()
-
-
Method Details
-
getMethodsSorted
public static <T extends junit.framework.TestCase> List<org.objectweb.asm.tree.MethodNode> getMethodsSorted(Class<T> clazz) Returns list of methods according to their order in the source file. Supertype methods go first in the list. Returns empty list if cannot find class file for the specified class. Class file is retrieved by usingClass.getResourceAsStream(java.lang.String)
so it won't work for classes generated at runtine.- Parameters:
clazz
- class to analyze- Returns:
- list of method names
-
getLineNumber
private static int getLineNumber(org.objectweb.asm.tree.MethodNode o2) -
parseClass
-
createTestSuite
-
getConstructor
-