public static TestSuiteMethod[] allTesters(IOpenClass openClass) { List<TestSuiteMethod> res = new ArrayList<TestSuiteMethod>(); for (IOpenMethod tester : openClass.getMethods()) { if (isTester(tester)) { res.add((TestSuiteMethod) tester); } if (tester instanceof OpenMethodDispatcher && isTester(((OpenMethodDispatcher) tester).getTargetMethod())) { res.add((TestSuiteMethod) ((OpenMethodDispatcher) tester).getTargetMethod()); } } TestSuiteMethod[] testSuiteMethods = new TestSuiteMethod[res.size()]; return res.toArray(testSuiteMethods); }
/** * Get tests for tested method that have filled rules rows data for testing * its functionality. Run methods and tests with empty test cases are not * being processed. If you need to get all test methods, including run * methods and empty ones, use * {@link #isTestForMethod(IOpenMethod, IOpenMethod)}. */ public static IOpenMethod[] testers(IOpenMethod tested) { List<IOpenMethod> res = new ArrayList<IOpenMethod>(); for (IOpenMethod tester : tested.getDeclaringClass().getMethods()) { if (isTester(tester) && isTestForMethod(tester, tested)) { res.add(tester); } } return res.toArray(new IOpenMethod[res.size()]); }