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


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

    }

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

    */
   @SuppressWarnings("unchecked")
   private void addContextsToApplicationScope()
   {
      ApplicationContext appContext = getContext(ApplicationContext.class);
      ObjectStore store = appContext.getObjectStore();
     
      for(Context context : contexts)
      {
         store.add((Class<Context>)context.getClass().getInterfaces()[0], context);
      }
   }
View Full Code Here

    */
   @SuppressWarnings("unchecked")
   private void addContextsToApplicationScope()
   {
      ApplicationContext appContext = getContext(ApplicationContext.class);
      ObjectStore store = appContext.getObjectStore();
     
      for(Context context : contexts)
      {
         store.add((Class<Context>)context.getClass().getInterfaces()[0], context);
      }
   }
View Full Code Here

    */
   @SuppressWarnings("unchecked")
   private void addContextsToApplicationScope()
   {
      ApplicationContext appContext = getContext(ApplicationContext.class);
      ObjectStore store = appContext.getObjectStore();
     
      for(Context context : contexts)
      {
         store.add((Class<Context>)context.getClass().getInterfaces()[0], context);
      }
   }
View Full Code Here

    */
   @SuppressWarnings("unchecked")
   private void addContextsToApplicationScope()
   {
      ApplicationContext appContext = getContext(ApplicationContext.class);
      ObjectStore store = appContext.getObjectStore();

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

         Assert.assertFalse(context.isActive());

         context.activate();
         Assert.assertTrue(context.isActive());

         ObjectStore store = context.getObjectStore();
         store.add(Boolean.class, true);

         Assert.assertEquals(
               "Verify that we can get objects from a active context",
               new Boolean(true),
               store.get(Boolean.class));

         context.deactivate();
         Assert.assertFalse(context.isActive());

         try
         {
            context.getObjectStore();
            Assert.fail("Trying to get ObjectStore outside active context should have thrown Exception");
         }
         catch (Exception e) {
         }

         context.activate();
         store = context.getObjectStore();

         Assert.assertEquals(
               "Verify that we can get objects from a active context",
               new Boolean(true),
               store.get(Boolean.class));
      }
      finally
      {
         context.deactivate();
         context.destroy();
View Full Code Here

        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);
        for (URL url : getInitialModuleLocations()) {
            ClassLoader classLoader = EmbeddedSetupObserver.class.getClassLoader();
            EmbeddedUtils.installAndStartModule(classLoader, url);
        }
View Full Code Here

         Assert.assertFalse(context.isActive());
        
         context.activate();
         Assert.assertTrue(context.isActive());
        
         ObjectStore store = context.getObjectStore();
         store.add(Boolean.class, true);
        
         Assert.assertEquals(
               "Verify that we can get objects from a active context",
               new Boolean(true),
               store.get(Boolean.class));
        
         context.deactivate();
         Assert.assertFalse(context.isActive());
        
         try
         {
            context.getObjectStore();
            Assert.fail("Trying to get ObjectStore outside active context should have thrown Exception");
         }
         catch (Exception e) {
         }
  
         context.activate();
         store = context.getObjectStore();
  
         Assert.assertEquals(
               "Verify that we can get objects from a active context",
               new Boolean(true),
               store.get(Boolean.class));
      }
      finally
      {
         context.deactivate();
         context.destroy();
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.