本文整理汇总了Java中org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner类的典型用法代码示例。如果您正苦于以下问题:Java CdiTestSuiteRunner类的具体用法?Java CdiTestSuiteRunner怎么用?Java CdiTestSuiteRunner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CdiTestSuiteRunner类属于org.apache.deltaspike.testcontrol.api.junit包,在下文中一共展示了CdiTestSuiteRunner类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyBeforeFeatureConfig
import org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner; //导入依赖的package包/类
void applyBeforeFeatureConfig(Class testClass) {
CdiContainer container = CdiContainerLoader.getCdiContainer();
if (!isContainerStarted()) {
container.boot(CdiTestSuiteRunner.getTestContainerConfig());
containerStarted = true;
bootExternalContainers(testClass);
}
List<Class<? extends Annotation>> restrictedScopes = new ArrayList<Class<? extends Annotation>>();
//controlled by the container and not supported by weld:
restrictedScopes.add(ApplicationScoped.class);
restrictedScopes.add(Singleton.class);
if (this.parent == null && this.testControl.getClass().equals(TestControlLiteral.class)) {
//skip scope-handling if @TestControl isn't used explicitly on the test-class -> TODO re-visit it
restrictedScopes.add(RequestScoped.class);
restrictedScopes.add(SessionScoped.class);
}
this.previousProjectStage = ProjectStageProducer.getInstance().getProjectStage();
ProjectStageProducer.setProjectStage(this.projectStage);
startScopes(container, testClass, null, restrictedScopes.toArray(new Class[restrictedScopes.size()]));
}
示例2: run
import org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner; //导入依赖的package包/类
@Override
public void run(RunNotifier runNotifier)
{
CdiContainer container = CdiContainerLoader.getCdiContainer();
if (!containerStarted)
{
container.boot(CdiTestSuiteRunner.getTestContainerConfig());
containerStarted = true;
}
super.run(runNotifier);
}
示例3: configForTestContainerStageUnitTest
import org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner; //导入依赖的package包/类
@Test
@TestControl(projectStage = ProjectStage.UnitTest.class) //just for internal tests
public void configForTestContainerStageUnitTest()
{
Assert.assertNotNull(CdiTestSuiteRunner.getTestContainerConfig());
Assert.assertEquals("jdbc:hsqldb:mem:demoDB",
CdiTestSuiteRunner.getTestContainerConfig().getProperty("demoDatabase.JdbcUrl"));
}
示例4: configForTestContainerStageIntegrationTest
import org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner; //导入依赖的package包/类
@Test
@TestControl(projectStage = ProjectStage.IntegrationTest.class) //just for internal tests
public void configForTestContainerStageIntegrationTest()
{
Assert.assertNotNull(CdiTestSuiteRunner.getTestContainerConfig());
Assert.assertEquals("jdbc:hsqldb:file:demoDB",
CdiTestSuiteRunner.getTestContainerConfig().getProperty("demoDatabase.JdbcUrl"));
}