All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.carrotsearch.randomizedtesting.JUnit3MethodProvider Maven / Gradle / Ivy

package com.carrotsearch.randomizedtesting;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

import com.carrotsearch.randomizedtesting.ClassModel.MethodModel;

/**
 * Method provider selecting tests that follow a name pattern of test(.*).
 */
public class JUnit3MethodProvider implements TestMethodProvider {
  @Override
  public Collection getTestMethods(Class suiteClass, ClassModel suiteClassModel) {
    Map methods = suiteClassModel.getMethods();
    ArrayList result = new ArrayList();
    for (MethodModel mm : methods.values()) {
      if (mm.getDown() == null && mm.element.getName().startsWith("test")) {
        result.add(mm.element);
      }
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy