当前位置: 首页>>代码示例>>Java>>正文


Java InitializationError类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:13,代码来源:UnitilsParameterized.java

示例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());
    }
 
开发者ID:linux-china,项目名称:unitils,代码行数:33,代码来源:UnitilsIntegrationTest.java

示例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;
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:9,代码来源:PowerMockJUnit4LegacyRunnerDelegateImpl.java

示例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();
}
 
开发者ID:o3project,项目名称:mlo-gui,代码行数:11,代码来源:JavaFxJUnitRunner.java

示例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);
}
 
开发者ID:o3project,项目名称:mlo-gui,代码行数:8,代码来源:JavaFxJUnitRunner.java

示例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;
        }
    };
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:JUnit44RunnerImpl.java

示例7: MondrianFileSchemaProviderTest

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public MondrianFileSchemaProviderTest() throws InitializationError {
  super(MondrianFileSchemaProviderTest.class);
  try {
  	KettleClientEnvironment.init();
  } catch (Exception e) {
  	e.printStackTrace();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:9,代码来源:MondrianFileSchemaProviderTest.java

示例8: ConnectionControllerITest

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public ConnectionControllerITest() throws InitializationError {
  super(ConnectionControllerITest.class);
  try {
  	KettleClientEnvironment.init();
  } catch (Exception e) {
  	e.printStackTrace();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:9,代码来源:ConnectionControllerITest.java

示例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);
}
 
开发者ID:alibaba,项目名称:bulbasaur,代码行数:5,代码来源:JUnit4ClassRunner.java

示例10: LoepardMockRunnerDelegateImpl

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public LoepardMockRunnerDelegateImpl(Class<?> klass) throws InitializationError {
	super(klass);
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:4,代码来源:LoepardMockRunnerDelegateImpl.java

示例11: runTestFindById

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
protected void runTestFindById(Class<?> testClass) throws InitializationError, IOException {
    runTest(testClass, "testFindById");
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:4,代码来源:UnitilsIntegrationTest.java

示例12: runTestPersist

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
protected void runTestPersist(Class<?> testClass) throws InitializationError, IOException {
    runTest(testClass, "testPersist");
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:4,代码来源:UnitilsIntegrationTest.java

示例13: runMappingTest

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
protected void runMappingTest(Class<?> testClass) throws InitializationError, IOException {
    runTest(testClass, "testMapping");
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:4,代码来源:UnitilsIntegrationTest.java

示例14: TestUnitilsJUnit4TestClassRunner

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public TestUnitilsJUnit4TestClassRunner(Class<?> testClass) throws InitializationError {
    super(testClass);
}
 
开发者ID:linux-china,项目名称:unitils,代码行数:4,代码来源:JUnit4TestExecutor.java

示例15: PowerMockJUnit49RunnerDelegateImpl

import org.junit.internal.runners.InitializationError; //导入依赖的package包/类
public PowerMockJUnit49RunnerDelegateImpl( Class<?> klass, String[] methodsToRun, PowerMockTestListener[] listeners ) throws InitializationError {
    super( klass, methodsToRun, listeners );
}
 
开发者ID:awenblue,项目名称:powermock,代码行数:4,代码来源:PowerMockJUnit49RunnerDelegateImpl.java


注:本文中的org.junit.internal.runners.InitializationError类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。