/** * @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); } }
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()); }
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; }
/** * @throws InitializationError * */ public JavaFxJUnitRunner(final Class<?> clazz) throws InitializationError { super(); LOG.info(clazz.getName()); delegate = RunnerFactory.createRunnerFor(clazz); JavaFxJUnitApplication.startJavaFx(); }
public static Runner createRunnerFor(Class<?> clazz) throws InitializationError { if (!shouldSkipClass() && isSubclassOfTestCase(clazz)) { return new JUnit38ClassRunner(clazz); } return new JUnit4ClassRunner(clazz); }
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; } }; }
public MondrianFileSchemaProviderTest() throws InitializationError { super(MondrianFileSchemaProviderTest.class); try { KettleClientEnvironment.init(); } catch (Exception e) { e.printStackTrace(); } }
public ConnectionControllerITest() throws InitializationError { super(ConnectionControllerITest.class); try { KettleClientEnvironment.init(); } catch (Exception e) { e.printStackTrace(); } }
public JUnit4ClassRunner(Class<?> clazz) throws InitializationError, org.junit.internal.runners.InitializationError, org.junit.runners.model.InitializationError { super(clazz); }
public LoepardMockRunnerDelegateImpl(Class<?> klass) throws InitializationError { super(klass); }
public LoepardMockRunnerDelegateImpl(Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners) throws InitializationError { super(klass, methodsToRun, listeners); }
protected void runTestFindById(Class<?> testClass) throws InitializationError, IOException { runTest(testClass, "testFindById"); }
protected void runTestPersist(Class<?> testClass) throws InitializationError, IOException { runTest(testClass, "testPersist"); }
protected void runMappingTest(Class<?> testClass) throws InitializationError, IOException { runTest(testClass, "testMapping"); }
public TestUnitilsJUnit4TestClassRunner(Class<?> testClass) throws InitializationError { super(testClass); }
public PowerMockJUnit4LegacyRunnerDelegateImpl(Class<?> klass, String[] methodsToRun) throws InitializationError, NoTestsRemainException { this(klass, methodsToRun, null); }
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners ) throws InitializationError { super( klass, methodsToRun, listeners ); }
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass, String[] methodsToRun ) throws InitializationError { super( klass, methodsToRun ); }
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass ) throws InitializationError { super( klass ); }
public PowerMockJUnit47RunnerDelegateImpl(Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners) throws InitializationError { super(klass, methodsToRun, listeners); }
public PowerMockJUnit47RunnerDelegateImpl(Class<?> klass, String[] methodsToRun) throws InitializationError { super(klass, methodsToRun); }
public PowerMockJUnit47RunnerDelegateImpl(Class<?> klass) throws InitializationError { super(klass); }
public JMHRunWith(Class<?> klass) throws InitializationError { fTestClass = new TestClass(klass); fTestMethods = getTestMethods(); validate(); }
protected void validate() throws InitializationError { MethodValidator methodValidator = new MethodValidator(fTestClass); methodValidator.validateMethodsForDefaultRunner(); methodValidator.assertValid(); }
public SAAJTestRunner(Class<?> klass) throws InitializationError { super(klass); }
public GoJUnitExtSpringRunner(Class<?> aClass) throws InitializationError { super(aClass); }
public TavernJUnit4ClassRunner(Class<?> klass) throws InitializationError { super(klass); }
/** * 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); }