Package org.junit.internal.runners

Examples of org.junit.internal.runners.InitializationError


         fTestClass = (TestClass) testClass;
      }

      public void assertValid() throws InitializationError {
         if (!fErrors.isEmpty())
            throw new InitializationError(fErrors);
      }
View Full Code Here


                    return field;
                }
            }
        }
       
        throw new InitializationError("no Mockery found in test class "
            + testClass);
    }
View Full Code Here

    try {
      return runnerClass.getConstructor(Class.class).newInstance(new Object[] { fTestClass });
    } catch (NoSuchMethodException e) {
      String simpleName= runnerClass.getSimpleName();
      InitializationError error= new InitializationError(String.format(
          CONSTRUCTOR_ERROR_FORMAT, simpleName, simpleName));
      return Request.errorReport(fTestClass, error).getRunner();
    } catch (Exception e) { //可能存在java.lang.SecurityException
      DEBUG.P("e="+e);
      e.printStackTrace();
View Full Code Here

  public Runner buildRunner(Class<? extends Runner> runnerClass) {
    try {
      return runnerClass.getConstructor(Class.class).newInstance(new Object[] { fTestClass });
    } catch (NoSuchMethodException e) {
      String simpleName= runnerClass.getSimpleName();
      InitializationError error= new InitializationError(String.format(
          CONSTRUCTOR_ERROR_FORMAT, simpleName, simpleName));
      return Request.errorReport(fTestClass, error).getRunner();
    } catch (Exception e) {
      return Request.errorReport(fTestClass, e).getRunner();
    }
View Full Code Here

    methodValidator.assertValid();
  }

  private Class<?> addParent(Class<?> parent) throws InitializationError {
    if (!parents.add(parent))
      throw new InitializationError(String.format("class '%s' (possibly indirectly) contains itself as a SuiteClass", parent.getName()));
    return parent;
  }
View Full Code Here

  }

  private static Class<?>[] getAnnotatedClasses(Class<?> klass) throws InitializationError {
    SuiteClasses annotation= klass.getAnnotation(SuiteClasses.class);
    if (annotation == null)
      throw new InitializationError(String.format("class '%s' must have a SuiteClasses annotation", klass.getName()));
    return annotation.value();
  }
View Full Code Here

TOP

Related Classes of org.junit.internal.runners.InitializationError

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.