本文整理汇总了Java中org.jboss.arquillian.core.spi.context.ObjectStore类的典型用法代码示例。如果您正苦于以下问题:Java ObjectStore类的具体用法?Java ObjectStore怎么用?Java ObjectStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObjectStore类属于org.jboss.arquillian.core.spi.context包,在下文中一共展示了ObjectStore类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleBeforeSuite
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
@Override
public void handleBeforeSuite(BeforeSuite event) throws Throwable {
super.handleBeforeSuite(event);
Runtime runtime = RuntimeLocator.getRuntime();
IllegalStateAssertion.assertNull(runtime, "Embedded Runtime already created without @RunWith(Arquillian.class)");
runtime = EmbeddedUtils.getEmbeddedRuntime();
ObjectStore suiteStore = getSuiteObjectStore();
suiteStore.add(Runtime.class, runtime);
// Do additional setup
Iterator<EmbeddedRuntimeSetup> itsetup = ServiceLoader.load(EmbeddedRuntimeSetup.class).iterator();
while(itsetup.hasNext()) {
EmbeddedRuntimeSetup setup = itsetup.next();
setup.setupEmbeddedRuntime(suiteStore);
}
}
示例2: handleBeforeDeploy
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
public void handleBeforeDeploy(@Observes BeforeDeploy event, Container container) throws Throwable {
List<ManagedSetupTask> setupTasks = getSetupTasks();
if (!setupTasks.isEmpty()) {
ClassContext classContext = classContextInstance.get();
ObjectStore suiteStore = suiteContextInstance.get().getObjectStore();
ObjectStore classStore = classContext.getObjectStore();
MBeanServerConnection server = mbeanServerInstance.get();
Map<String, String> props = container.getContainerConfiguration().getContainerProperties();
ManagedSetupContext context = new ManagedSetupContext(suiteStore, classStore, server, props);
for (ManagedSetupTask task : setupTasks) {
task.beforeDeploy(context);
}
}
}
示例3: handleBeforeStop
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
public void handleBeforeStop(@Observes BeforeStop event, Container container) throws Throwable {
List<ManagedSetupTask> setupTasks = getSetupTasks();
if (!setupTasks.isEmpty()) {
ObjectStore suiteStore = suiteContextInstance.get().getObjectStore();
MBeanServerConnection server = mbeanServerInstance.get();
Map<String, String> props = container.getContainerConfiguration().getContainerProperties();
ManagedSetupContext context = new ManagedSetupContext(suiteStore, null, server, props);
for (ManagedSetupTask task : setupTasks) {
task.beforeStop(context);
}
}
}
示例4: getSetupTasks
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<T> getSetupTasks() throws Exception {
TaskList<T> taskList = null;
// Get or create the task list with the {@link ClassContext}
ClassContext classContext = classContextInstance.get();
if (classContext.isActive()) {
ObjectStore objectStore = classContext.getObjectStore();
taskList = objectStore.get(TaskList.class);
if (taskList == null) {
taskList = new TaskList<T>();
Class<?> currentClass = classContext.getActiveId();
ContainerSetup setup = currentClass.getAnnotation(ContainerSetup.class);
if (setup != null) {
Class<T>[] classes = (Class<T>[]) setup.value();
for (Class<T> clazz : classes) {
taskList.add(clazz.newInstance());
}
}
classContext.getObjectStore().add(TaskList.class, taskList);
ObjectStore suiteStore = getSuiteObjectStore();
suiteStore.get(TaskList.class).addAll(taskList);
}
}
return taskList != null ? taskList : new TaskList<T>();
}
示例5: handleBeforeClass
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
public void handleBeforeClass(@Observes BeforeClass event) throws Throwable {
List<T> setupTasks = getSetupTasks();
if (!setupTasks.isEmpty()) {
ClassContext classContext = classContextInstance.get();
ObjectStore suiteStore = suiteContextInstance.get().getObjectStore();
ObjectStore classStore = classContext.getObjectStore();
SetupContext context = getSetupContext(suiteStore, classStore);
for (T task : setupTasks) {
task.beforeClass(context);
}
}
}
示例6: handleAfterClass
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
public void handleAfterClass(@Observes AfterClass event) throws Throwable {
List<T> setupTasks = getSetupTasks();
if (!setupTasks.isEmpty()) {
ClassContext classContext = classContextInstance.get();
ObjectStore classStore = classContext.getObjectStore();
ObjectStore suiteStore = suiteContextInstance.get().getObjectStore();
SetupContext context = getSetupContext(suiteStore, classStore);
for (T task : setupTasks) {
task.afterClass(context);
}
}
}
示例7: handleAfterSuite
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void handleAfterSuite(@Observes AfterSuite event) throws Throwable {
SuiteContext suiteContext = suiteContextInstance.get();
TaskList<T> setupTasks = suiteContext.getObjectStore().get(TaskList.class);
if (!setupTasks.isEmpty()) {
ObjectStore suiteStore = suiteContext.getObjectStore();
SetupContext context = new AbstractSetupContext(suiteStore, null);
for (T task : setupTasks) {
task.afterSuite(context);
}
}
}
示例8: createNewObjectStore
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected ObjectStore createNewObjectStore() {
return new HashObjectStore();
}
示例9: getSetupContext
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected ManagedSetupContext getSetupContext(ObjectStore suiteStore, ObjectStore classStore) {
MBeanServerConnection server = mbeanServerInstance.get();
return new ManagedSetupContext(suiteStore, classStore, server, null);
}
示例10: ManagedSetupContext
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
ManagedSetupContext(ObjectStore suiteStore, ObjectStore classStore, MBeanServerConnection server, Map<String, String> configuration) {
super(suiteStore, classStore);
this.server = server;
this.configuration = configuration;
}
示例11: getSetupContext
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected <C extends SetupContext> C getSetupContext(ObjectStore suiteStore, ObjectStore classStore) {
return (C) new AbstractSetupContext(suiteStore, classStore);
}
示例12: getSuiteObjectStore
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
protected ObjectStore getSuiteObjectStore() {
SuiteContext suiteContext = suiteContextInstance.get();
return suiteContext.getObjectStore();
}
示例13: handleBeforeSuite
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
public void handleBeforeSuite(@Observes BeforeSuite event) throws Throwable {
ObjectStore objectStore = getSuiteObjectStore();
objectStore.add(TaskList.class, new TaskList<>());
}
示例14: AbstractSetupContext
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
public AbstractSetupContext(ObjectStore suiteStore, ObjectStore classStore) {
this.suiteStore = suiteStore;
this.classStore = classStore;
}
示例15: getSuiteStore
import org.jboss.arquillian.core.spi.context.ObjectStore; //导入依赖的package包/类
@Override
public ObjectStore getSuiteStore() {
return suiteStore;
}