Package org.jboss.arquillian.core.spi.context

Examples of org.jboss.arquillian.core.spi.context.ObjectStore


   {
      executeInApplicationContext(new Callable<Void>() {
         @Override
         public Void call() throws Exception {
            ApplicationContext appContext = getContext(ApplicationContext.class);
            ObjectStore store = appContext.getObjectStore();

            for(Context context : contexts)
            {
               store.add((Class<Context>)context.getClass().getInterfaces()[0], context);
            }
            return null;
         }
      });
   }
View Full Code Here


        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>();
    }
View Full Code Here

        SuiteContext suiteContext = suiteContextInstance.get();
        return suiteContext.getObjectStore();
    }

    public void handleBeforeSuite(@Observes BeforeSuite event) throws Throwable {
        ObjectStore objectStore = getSuiteObjectStore();
        objectStore.add(TaskList.class, new TaskList<>());
    }
View Full Code Here

    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);
            }
        }
View Full Code Here

    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);
            }
        }
View Full Code Here

    @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);
            }
        }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.core.spi.context.ObjectStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.