コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }