當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。