Package org.junit.runners.model

Examples of org.junit.runners.model.TestClass


    private final TestClass testClass;

    public ApplicationComposer(Class<?> klass) throws InitializationError {
        super(klass);
        testClass = new TestClass(klass);
        validate();
    }
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

         * @throws Exception If there was an error creating the test object.
         */
        @Override
        protected Object createTest() throws Exception {
            final Object test = super.createTest();
            final TestClass testClass = getTestClass();
            final String browser = seleniumFactory.getBrowser();

            List<FrameworkField> fields = testClass
                    .getAnnotatedFields(annotationType);
            for (final FrameworkField field : fields) {
                FieldUtils.writeField(field.getField(), test, selenium, true);
            }

            fields = testClass.getAnnotatedFields(SeleniumBrowser.class);
            for (final FrameworkField field : fields) {
                FieldUtils.writeField(field.getField(), test, browser, true);
            }

            final List<TestRule> rules = this.getTestRules(test);
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

            classLoader = new TestClassLoader();

        }

        Thread.currentThread().setContextClassLoader(classLoader);
        testClassFromClassLoader = new TestClass(classLoader
                .loadClass(getTestClass().getJavaClass().getName()));
        // See withAfters and withBefores for the reason.
        beforeFromClassLoader = classLoader.loadClass(Before.class.getName());
        afterFromClassLoader = classLoader.loadClass(After.class.getName());
    }
View Full Code Here

        Thread.currentThread().setContextClassLoader(getTestLoader());
        try {
            final Class<?> testTransformedClass = testLoader.loadClass(getTestClass().getName());
            final Field f = ParentRunner.class.getDeclaredField("fTestClass");
            f.setAccessible(true);
            f.set(this, new TestClass(testTransformedClass));
        } catch (final Exception e) {
            throw new RuntimeException(e);
        } finally {
            Thread.currentThread().setContextClassLoader(originalLoader);
        }
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

    private final TestClass testClass;

    public ApplicationComposer(Class<?> klass) throws InitializationError {
        super(klass);
        testClass = new TestClass(klass);
        validate();
    }
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

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.