private Description findChildForParams(Statement methodInvoker, Description methodDescription) { for (Description child : methodDescription.getChildren()) { InvokeParameterisedMethod parameterisedInvoker = findParameterisedMethodInvokerInChain(methodInvoker); /* if (child.getMethodName().startsWith(parameterisedInvoker.getParamsAsString())) return child; */ int paramsSetInx = parameterisedInvoker.getParamsSetIdx() - 1; if (child.getMethodName().endsWith("[" + paramsSetInx + "]")) return child; } return null; }
private static LinkedHashMap<String, Prop> createProps() { Field[] fs = Configuration.class.getDeclaredFields(); LinkedHashMap<String, Prop> res = new LinkedHashMap<String, Prop>(); for (Field f : fs) if (!Modifier.isStatic(f.getModifiers())) { Description annotation = f.getAnnotation(Description.class); if (annotation != null) { String name = f.getName().replace('_', '.'); res.put(name, new Prop(name, annotation.value(), f)); } } return res; }
Description describeMethod() { Object[] params = paramsFromAnnotation(); Description parametrised = Description.createSuiteDescription(method.name()); for (int i = 0; i < params.length; i++) { /* Object paramSet = params[i]; parametrised.addChild(Description.createTestDescription(method.frameworkMethod.getMethod().getDeclaringClass(), Utils.stringify(paramSet, i) + " (" + method.name() + ")", method.frameworkMethod.getAnnotations())); */ parametrised.addChild( Description.createTestDescription( method.frameworkMethod.getMethod().getDeclaringClass(), method.name() + " [" + i + "]", method.frameworkMethod.getAnnotations())); } return parametrised; }