Java 类org.junit.internal.runners.InitializationError 实例源码

项目:unitils    文件:UnitilsParameterized.java   
/**
 * @see org.junit.internal.runners.JUnit4ClassRunner#validate()
 */
@Override
protected void validate() throws InitializationError {
    testClassInternalRunners = new org.junit.internal.runners.TestClass(clazz);
    UnitilsMethodValidator validator = new UnitilsMethodValidator(testClassInternalRunners);
    List<Throwable> errors = validator.validateMethodsForParameterizedRunner();
    if (!errors.isEmpty()) {
        throw new InitializationError(errors);
    }
}
项目:unitils    文件:UnitilsIntegrationTest.java   
protected void runTest(Class<?> testClass, final String testMethodName) throws InitializationError, IOException {
        Result result = new Result();
        RunNotifier runNotifier = new RunNotifier();
        runNotifier.addListener(result.createListener());

        UnitilsJUnit4TestClassRunner testRunner = new UnitilsJUnit4TestClassRunner(testClass) {

            @Override
            protected List<Method> getTestMethods() {
                return Arrays.asList(ReflectionUtils.getMethod(getTestClass().getJavaClass(), testMethodName, false));
            }

        };
        testRunner.run(runNotifier);

        if (result.getFailureCount() > 0) {
            registerFailure();
        }

        for (Failure failure : result.getFailures()) {
            logger.error("Failure exception", failure.getException());
            StringWriter stringWriter = new StringWriter();
            failure.getException().printStackTrace(new PrintWriter(stringWriter));
//          logFileWriter.println(stringWriter.toString() + "\n");
        }
        if (result.getFailureCount() > 0) {
            String failureMessage = "Failure count is " + result.getFailureCount() + "\n" + result.getFailures().get(0).getMessage() + "\n"
                + result.getFailures().get(0).getTrace();
            fail(failureMessage);
        }
        assertEquals(0, result.getIgnoreCount());
    }
项目:powermock    文件:PowerMockJUnit4LegacyRunnerDelegateImpl.java   
public PowerMockJUnit4LegacyRunnerDelegateImpl(Class<?> klass, String[] methodsToRun,
        PowerMockTestListener[] listeners) throws InitializationError, NoTestsRemainException {
    super(klass, new PowerMockJUnit4LegacyTestClassMethodsRunner(klass,
            listeners == null ? new PowerMockTestListener[0] : listeners));
    filter(new PowerMockJUnit4LegacyFilter(methodsToRun));

    testCount = methodsToRun.length;
}
项目:mlo-gui    文件:JavaFxJUnitRunner.java   
/**
 * @throws InitializationError 
 * 
 */
public JavaFxJUnitRunner(final Class<?> clazz) throws InitializationError {
    super();
    LOG.info(clazz.getName());
    delegate = RunnerFactory.createRunnerFor(clazz);
    JavaFxJUnitApplication.startJavaFx();
}
项目:mlo-gui    文件:JavaFxJUnitRunner.java   
public static Runner createRunnerFor(Class<?> clazz) throws InitializationError {
    if (!shouldSkipClass() && isSubclassOfTestCase(clazz)) {
        return new JUnit38ClassRunner(clazz);
    }

    return new JUnit4ClassRunner(clazz);
}
项目:astor    文件:JUnit44RunnerImpl.java   
public JUnit44RunnerImpl(Class<?> klass) throws InitializationError {
    this.runner = new JUnit4ClassRunner(klass) {
        @Override
        protected Object createTest() throws Exception {
            Object test = super.createTest();
            MockitoAnnotations.initMocks(test);
            return test;
        }
    };
}
项目:astor    文件:JUnit44RunnerImpl.java   
public JUnit44RunnerImpl(Class<?> klass) throws InitializationError {
    this.runner = new JUnit4ClassRunner(klass) {
        @Override
        protected Object createTest() throws Exception {
            Object test = super.createTest();
            MockitoAnnotations.initMocks(test);
            return test;
        }
    };
}
项目:pentaho-aggdesigner    文件:MondrianFileSchemaProviderTest.java   
public MondrianFileSchemaProviderTest() throws InitializationError {
  super(MondrianFileSchemaProviderTest.class);
  try {
    KettleClientEnvironment.init();
  } catch (Exception e) {
    e.printStackTrace();
  }
}
项目:pentaho-aggdesigner    文件:ConnectionControllerITest.java   
public ConnectionControllerITest() throws InitializationError {
  super(ConnectionControllerITest.class);
  try {
    KettleClientEnvironment.init();
  } catch (Exception e) {
    e.printStackTrace();
  }
}
项目:bulbasaur    文件:JUnit4ClassRunner.java   
public JUnit4ClassRunner(Class<?> clazz) throws InitializationError, org.junit.internal.runners.InitializationError,
    org.junit.runners.model.InitializationError {
    super(clazz);
}
项目:leopard    文件:LoepardMockRunnerDelegateImpl.java   
public LoepardMockRunnerDelegateImpl(Class<?> klass) throws InitializationError {
    super(klass);
}
项目:leopard    文件:LoepardMockRunnerDelegateImpl.java   
public LoepardMockRunnerDelegateImpl(Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners) throws InitializationError {
    super(klass, methodsToRun, listeners);
}
项目:unitils    文件:UnitilsIntegrationTest.java   
protected void runTestFindById(Class<?> testClass) throws InitializationError, IOException {
    runTest(testClass, "testFindById");
}
项目:unitils    文件:UnitilsIntegrationTest.java   
protected void runTestPersist(Class<?> testClass) throws InitializationError, IOException {
    runTest(testClass, "testPersist");
}
项目:unitils    文件:UnitilsIntegrationTest.java   
protected void runMappingTest(Class<?> testClass) throws InitializationError, IOException {
    runTest(testClass, "testMapping");
}
项目:unitils    文件:JUnit4TestExecutor.java   
public TestUnitilsJUnit4TestClassRunner(Class<?> testClass) throws InitializationError {
    super(testClass);
}
项目:powermock    文件:PowerMockJUnit4LegacyRunnerDelegateImpl.java   
public PowerMockJUnit4LegacyRunnerDelegateImpl(Class<?> klass, String[] methodsToRun) throws InitializationError,
        NoTestsRemainException {
    this(klass, methodsToRun, null);
}
项目:powermock    文件:PowerMockJUnit49RunnerDelegateImpl.java   
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners ) throws InitializationError {
    super( klass, methodsToRun, listeners );
}
项目:powermock    文件:PowerMockJUnit49RunnerDelegateImpl.java   
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass, String[] methodsToRun ) throws InitializationError {
    super( klass, methodsToRun );
}
项目:powermock    文件:PowerMockJUnit49RunnerDelegateImpl.java   
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass ) throws InitializationError {
    super( klass );
}
项目:powermock    文件:PowerMockJUnit47RunnerDelegateImpl.java   
public PowerMockJUnit47RunnerDelegateImpl(Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners) throws InitializationError {
    super(klass, methodsToRun, listeners);
}
项目:powermock    文件:PowerMockJUnit47RunnerDelegateImpl.java   
public PowerMockJUnit47RunnerDelegateImpl(Class<?> klass, String[] methodsToRun) throws InitializationError {
    super(klass, methodsToRun);
}
项目:powermock    文件:PowerMockJUnit47RunnerDelegateImpl.java   
public PowerMockJUnit47RunnerDelegateImpl(Class<?> klass) throws InitializationError {
    super(klass);
}
项目:UnsafeAdapter    文件:JMHRunWith.java   
public JMHRunWith(Class<?> klass) throws InitializationError {
    fTestClass = new TestClass(klass);
    fTestMethods = getTestMethods();
    validate();
}
项目:UnsafeAdapter    文件:JMHRunWith.java   
protected void validate() throws InitializationError {
    MethodValidator methodValidator = new MethodValidator(fTestClass);
    methodValidator.validateMethodsForDefaultRunner();
    methodValidator.assertValid();
}
项目:wso2-axis2    文件:SAAJTestRunner.java   
public SAAJTestRunner(Class<?> klass) throws InitializationError {
    super(klass);
}
项目:gocd    文件:GoJUnitExtSpringRunner.java   
public GoJUnitExtSpringRunner(Class<?> aClass) throws InitializationError {
    super(aClass);
}
项目:tavern    文件:TavernJUnit4ClassRunner.java   
public TavernJUnit4ClassRunner(Class<?> klass) throws InitializationError {
    super(klass);
}
项目:Rubus    文件:OrderedTestRunner.java   
/**
 * Creates a new runner
 * 
 * @param clazz
 *            the class being tested
 * @throws InitializationError
 *             if something goes wrong
 * @throws org.junit.runners.model.InitializationError 
 */
public OrderedTestRunner(Class<?> clazz) throws  org.junit.runners.model.InitializationError {
    super(clazz);
}