Examples of InitializationError


Examples of org.junit.runners.model.InitializationError

                    } else {
                        testObjects.add(testObject);
                    }
                }
      } else {
        throw new InitializationError(
            "Wrong signature for the @PerformanceTestSuite method");
      }
    }

    // Retrieve the methods before running the methods from the test suite
    List<FrameworkMethod> beforeSuiteMethods = getTestClass()
        .getAnnotatedMethods(BeforeSuite.class);
    if (beforeSuiteMethods.size() > 1) {
      throw new InitializationError(
          "Only one @BeforeSuite method is allowed for a @PerformanceSuite");
    }

    // Retrieve the methods before running the methods from the test suite
    List<FrameworkMethod> afterSuiteMethods = getTestClass()
        .getAnnotatedMethods(AfterSuite.class);
    if (afterSuiteMethods.size() > 1) {
      throw new InitializationError(
          "Only one @AfterSuite method is allowed for a @PerformanceSuite");
    }

    PerformanceSuiteState current = null;
    boolean suiteAlreadyRegistered = false;
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    static public class ExceptionThrowingRunnerFactory implements
            ParametersRunnerFactory {
        public Runner createRunnerForTestWithParameters(TestWithParameters test)
                throws InitializationError {
            throw new InitializationError(
                    "Called ExceptionThrowingRunnerFactory.");
        }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

            if( !(o instanceof SlingRemoteTestParameters)) {
                throw new IllegalArgumentException(o.getClass().getName()
                        + " is not a " + SlingRemoteTestParameters.class.getSimpleName());
            }
        } catch(Exception e) {
            throw new InitializationError(e);
        }
       
        // Set configured username using "admin" as default credential
        final String configuredUsername = System.getProperty(SlingTestBase.TEST_SERVER_USERNAME);
        if (configuredUsername != null && configuredUsername.trim().length() > 0) {
View Full Code Here

Examples of org.junit.runners.model.InitializationError

        try {
            ClassLoader testClassLoader = new TestClassLoader();
            return Class.forName(clazz.getName(), true, testClassLoader);
        }
        catch (ClassNotFoundException e) {
            throw new InitializationError(e);
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

            final String gripe = "Test class should have at least one @Module method";
            errors.add(new Exception(gripe));
        }

        if (!errors.isEmpty()) {
            throw new InitializationError(errors);
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    private void validate() throws InitializationError {
        List<Throwable> errors = new ArrayList<Throwable>();
        collectInitializationErrors(errors);
        if (!errors.isEmpty()) {
            throw new InitializationError(errors);
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

            try {
                return runnerClass.getConstructor(Class.class,
                        RunnerBuilder.class).newInstance(testClass, suiteBuilder);
            } catch (NoSuchMethodException e2) {
                String simpleName = runnerClass.getSimpleName();
                throw new InitializationError(String.format(
                        CONSTRUCTOR_ERROR_FORMAT, simpleName, simpleName));
            }
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

            boolean isAnyIncluded= isAnyIncluded(klass);
            boolean isAnyExcluded= isAnyExcluded(klass);

            filter(CategoryFilter.categoryFilter(isAnyIncluded, included, isAnyExcluded, excluded));
        } catch (NoTestsRemainException e) {
            throw new InitializationError(e);
        }
        assertNoCategorizedDescendentsOfUncategorizeableParents(getDescription());
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    }

    private static void assertNoDescendantsHaveCategoryAnnotations(Description description) throws InitializationError {
        for (Description each : description.getChildren()) {
            if (each.getAnnotation(Category.class) != null) {
                throw new InitializationError("Category annotations on Parameterized classes are not supported on individual methods.");
            }
            assertNoDescendantsHaveCategoryAnnotations(each);
        }
    }
View Full Code Here

Examples of org.junit.runners.model.InitializationError

    }

    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
Copyright © 2018 www.massapi.com. 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.