本文整理汇总了Java中org.junit.internal.runners.InitializationError类的典型用法代码示例。如果您正苦于以下问题:Java InitializationError类的具体用法?Java InitializationError怎么用?Java InitializationError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InitializationError类属于org.junit.internal.runners包,在下文中一共展示了InitializationError类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
/**
* @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);
}
}
示例2: runTest
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
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());
}
示例3: PowerMockJUnit4LegacyRunnerDelegateImpl
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
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;
}
示例4: JavaFxJUnitRunner
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
/**
* @throws InitializationError
*
*/
public JavaFxJUnitRunner(final Class<?> clazz) throws InitializationError {
super();
LOG.info(clazz.getName());
delegate = RunnerFactory.createRunnerFor(clazz);
JavaFxJUnitApplication.startJavaFx();
}
示例5: createRunnerFor
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public static Runner createRunnerFor(Class<?> clazz) throws InitializationError {
if (!shouldSkipClass() && isSubclassOfTestCase(clazz)) {
return new JUnit38ClassRunner(clazz);
}
return new JUnit4ClassRunner(clazz);
}
示例6: JUnit44RunnerImpl
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
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;
}
};
}
示例7: MondrianFileSchemaProviderTest
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public MondrianFileSchemaProviderTest() throws InitializationError {
super(MondrianFileSchemaProviderTest.class);
try {
KettleClientEnvironment.init();
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: ConnectionControllerITest
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public ConnectionControllerITest() throws InitializationError {
super(ConnectionControllerITest.class);
try {
KettleClientEnvironment.init();
} catch (Exception e) {
e.printStackTrace();
}
}
示例9: JUnit4ClassRunner
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public JUnit4ClassRunner(Class<?> clazz) throws InitializationError, org.junit.internal.runners.InitializationError,
org.junit.runners.model.InitializationError {
super(clazz);
}
示例10: LoepardMockRunnerDelegateImpl
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public LoepardMockRunnerDelegateImpl(Class<?> klass) throws InitializationError {
super(klass);
}
示例11: runTestFindById
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
protected void runTestFindById(Class<?> testClass) throws InitializationError, IOException {
runTest(testClass, "testFindById");
}
示例12: runTestPersist
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
protected void runTestPersist(Class<?> testClass) throws InitializationError, IOException {
runTest(testClass, "testPersist");
}
示例13: runMappingTest
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
protected void runMappingTest(Class<?> testClass) throws InitializationError, IOException {
runTest(testClass, "testMapping");
}
示例14: TestUnitilsJUnit4TestClassRunner
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public TestUnitilsJUnit4TestClassRunner(Class<?> testClass) throws InitializationError {
super(testClass);
}
示例15: PowerMockJUnit49RunnerDelegateImpl
import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners ) throws InitializationError {
super( klass, methodsToRun, listeners );
}