Package org.junit.runners.model

Examples of org.junit.runners.model.TestClass


     * @param errors The list where to report any problem found.
     */
    @Override
    protected void validateTestMethods(final List<Throwable> errors) {
        super.validateTestMethods(errors);
        final TestClass testClass = getTestClass();
        final List<FrameworkMethod> depends = testClass.getAnnotatedMethods(DependsOnMethod.class);
        if (!isNullOrEmpty(depends)) {
            final Set<String> dependencies = new HashSet<String>(hashMapCapacity(depends.size()));
            for (final FrameworkMethod method : depends) {
                for (final String value : method.getAnnotation(DependsOnMethod.class).value()) {
                    dependencies.add(value);
                }
            }
            for (final FrameworkMethod method : testClass.getAnnotatedMethods(Test.class)) {
                dependencies.remove(method.getName());
            }
            for (final String notFound : dependencies) {
                errors.add(new NoSuchMethodException("@DependsOnMethod(\"" + notFound + "\"): "
                        + "method not found in " + testClass.getName()));
            }
        }
    }
View Full Code Here


   * We're using JUnit infrastructure here, but provide constant
   * ordering of the result. The returned list has class...super order.
   */
  private <T> List<T> getAnnotatedFieldValues(Object test,
      Class<? extends Annotation> annotationClass, Class<T> valueClass) {
    TestClass info = new TestClass(suiteClass);
    List<T> results = new ArrayList<T>();

    List<FrameworkField> annotatedFields =
        new ArrayList<FrameworkField>(info.getAnnotatedFields(annotationClass));

    // Split fields by class
    final HashMap<Class<?>, List<FrameworkField>> byClass =
        new HashMap<Class<?>, List<FrameworkField>>();
    for (FrameworkField field : annotatedFields) {
View Full Code Here

   /**
    * Setup a new gwt-test-utils test class.
    */
   public GwtTest() {
      TestClass testClass = new TestClass(this.getClass());
      GwtConfig.get().setupGwtModule(testClass.getJavaClass());
      GwtConfig.get().setupInstance(this);
   }
View Full Code Here

   * We're using JUnit infrastructure here, but provide constant
   * ordering of the result. The returned list has class...super order.
   */
  private <T> List<T> getAnnotatedFieldValues(Object test,
      Class<? extends Annotation> annotationClass, Class<T> valueClass) {
    TestClass info = new TestClass(suiteClass);
    List<T> results = new ArrayList<T>();

    List<FrameworkField> annotatedFields =
        new ArrayList<FrameworkField>(info.getAnnotatedFields(annotationClass));

    // Split fields by class
    final HashMap<Class<?>, List<FrameworkField>> byClass =
        new HashMap<Class<?>, List<FrameworkField>>();
    for (FrameworkField field : annotatedFields) {
View Full Code Here

        return prototypeList;
    }

    private static List<FrameworkMethod> getPrototypesMethods(Class<?> testClass) throws Exception {
        List<FrameworkMethod> methods = new TestClass(testClass).getAnnotatedMethods(Prototypes.class);

        if (methods.isEmpty()) {
            throw new Exception("No public static prototypes method on class " + testClass.getName());
        }
View Full Code Here

   * We're using JUnit infrastructure here, but provide constant
   * ordering of the result. The returned list has class...super order.
   */
  private <T> List<T> getAnnotatedFieldValues(Object test,
      Class<? extends Annotation> annotationClass, Class<T> valueClass) {
    TestClass info = new TestClass(suiteClass);
    List<T> results = new ArrayList<T>();

    List<FrameworkField> annotatedFields =
        new ArrayList<FrameworkField>(info.getAnnotatedFields(annotationClass));

    // Split fields by class
    final HashMap<Class<?>, List<FrameworkField>> byClass =
        new HashMap<Class<?>, List<FrameworkField>>();
    for (FrameworkField field : annotatedFields) {
View Full Code Here

   * We're using JUnit infrastructure here, but provide constant
   * ordering of the result. The returned list has class...super order.
   */
  private <T> List<T> getAnnotatedFieldValues(Object test,
      Class<? extends Annotation> annotationClass, Class<T> valueClass) {
    TestClass info = new TestClass(suiteClass);
    List<T> results = new ArrayList<T>();

    List<FrameworkField> annotatedFields =
        new ArrayList<FrameworkField>(info.getAnnotatedFields(annotationClass));

    // Split fields by class
    final HashMap<Class<?>, List<FrameworkField>> byClass =
        new HashMap<Class<?>, List<FrameworkField>>();
    for (FrameworkField field : annotatedFields) {
View Full Code Here

   * We're using JUnit infrastructure here, but provide constant
   * ordering of the result. The returned list has class...super order.
   */
  private <T> List<T> getAnnotatedFieldValues(Object test,
      Class<? extends Annotation> annotationClass, Class<T> valueClass) {
    TestClass info = new TestClass(suiteClass);
    List<T> results = new ArrayList<T>();

    List<FrameworkField> annotatedFields =
        new ArrayList<FrameworkField>(info.getAnnotatedFields(annotationClass));

    // Split fields by class
    final HashMap<Class<?>, List<FrameworkField>> byClass =
        new HashMap<Class<?>, List<FrameworkField>>();
    for (FrameworkField field : annotatedFields) {
View Full Code Here

    public Description getDescription() {
        return jUnit4.getDescription();
    }
   
    private void initTest() {
        TestClass testClass = jUnit4.getTestClass();
        if(testClass != null){
            TestEngine.initTest(testClass.getJavaClass());
        }
    }
View Full Code Here

   * We're using JUnit infrastructure here, but provide constant
   * ordering of the result. The returned list has class...super order.
   */
  private <T> List<T> getAnnotatedFieldValues(Object test,
      Class<? extends Annotation> annotationClass, Class<T> valueClass) {
    TestClass info = new TestClass(suiteClass);
    List<T> results = new ArrayList<T>();

    List<FrameworkField> annotatedFields =
        new ArrayList<FrameworkField>(info.getAnnotatedFields(annotationClass));

    // Split fields by class
    final HashMap<Class<?>, List<FrameworkField>> byClass =
        new HashMap<Class<?>, List<FrameworkField>>();
    for (FrameworkField field : annotatedFields) {
View Full Code Here

TOP

Related Classes of org.junit.runners.model.TestClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.