本文整理匯總了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"));
}