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


Java CdiTestSuiteRunner类代码示例

本文整理汇总了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()]));
}
 
开发者ID:database-rider,项目名称:database-rider,代码行数:27,代码来源:CdiCucumberTestRunner.java

示例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);
}
 
开发者ID:database-rider,项目名称:database-rider,代码行数:14,代码来源:CdiCucumberTestRunner.java

示例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"));
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:9,代码来源:ContainerConfigTest.java

示例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"));
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:9,代码来源:ContainerConfigTest.java


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