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;
 }
Example #2
0
 /**
  * @param system
  * @args args from main()
  */
 private Result runMain(JUnitSystem system, String... args) {
   system.out().println("JUnit version " + Version.id());
   List<Class<?>> classes = new ArrayList<Class<?>>();
   List<Failure> missingClasses = new ArrayList<Failure>();
   for (String each : args)
     try {
       classes.add(Class.forName(each));
     } catch (ClassNotFoundException e) {
       system.out().println("Could not find class: " + each);
       Description description = Description.createSuiteDescription(each);
       Failure failure = new Failure(description, e);
       missingClasses.add(failure);
     }
   RunListener listener = new TextListener(system);
   addListener(listener);
   Result result = run(classes.toArray(new Class[0]));
   for (Failure each : missingClasses) result.getFailures().add(each);
   return result;
 }
 /** {@inheritDoc} */
 @Override
 public Description getDescription() {
   return Description.createSuiteDescription(cls);
 }