Package org.jboss.arquillian.test.spi.context

Examples of org.jboss.arquillian.test.spi.context.SuiteContext


   @Inject @ClassScoped
   private InstanceProducer<TestClass> testClassProducer;

   public void createSuiteContext(@Observes(precedence=100) EventContext<SuiteEvent> context)
   {
      SuiteContext suiteContext = this.suiteContextInstance.get();
      try
      {
         suiteContext.activate();
         context.proceed();
      }
      finally
      {
         suiteContext.deactivate();
      }
   }
View Full Code Here


   @ClassScoped
   private InstanceProducer<TestClass> testClassProducer;

   public void createSuiteContext(@Observes(precedence = 100) EventContext<SuiteEvent> context)
   {
      SuiteContext suiteContext = this.suiteContextInstance.get();
      try
      {
         suiteContext.activate();
         context.proceed();
      }
      finally
      {
         suiteContext.deactivate();
         if (AfterSuite.class.isAssignableFrom(context.getEvent().getClass()))
         {
            suiteContext.destroy();
         }
      }
   }
View Full Code Here

   // TODO: cast to raw type to get away from generic issue..
   @SuppressWarnings({"unchecked", "rawtypes"})
   public ContainerMethodExecutor getContainerMethodExecutor(ProtocolDefinition protocol, ProtocolConfiguration protocolConfiguration)
   {
      final ApplicationContext applicationContext = applicationContextInst.get();
      final SuiteContext suiteContext = suiteContextInst.get();
     
      final ClassContext classContext = classContextInst.get();
      final Class<?> classContextId = classContext.getActiveId();
     
      final TestContext testContext = testContextInst.get();
      final Object testContextId = testContext.getActiveId();
     
      ContainerMethodExecutor executor = ((Protocol)protocol.getProtocol()).getExecutor(
            protocolConfiguration,
            protocolMetadata.get(), new CommandCallback()
            {
               @Override
               public void fired(Command<?> event)
               {
                  applicationContext.activate();
                  suiteContext.activate();
                  classContext.activate(classContextId);
                  testContext.activate(testContextId);
                  try
                  {
                     remoteEvent.fire(event);
                  }
                  finally
                  {
                     testContext.deactivate();
                     classContext.deactivate();
                     suiteContext.deactivate();
                     applicationContext.deactivate();
                  }
               }
            });
      return executor;
View Full Code Here

   @Inject
   private Instance<TestContext> testContextInstance;
  
   public void createSuiteContext(@Observes(precedence=100) EventContext<SuiteEvent> context)
   {
      SuiteContext suiteContext = this.suiteContextInstance.get();
      try
      {
         suiteContext.activate();
         context.proceed();
      }
      finally
      {
         suiteContext.deactivate();
      }
   }
View Full Code Here

    protected <C extends SetupContext> C getSetupContext(ObjectStore suiteStore, ObjectStore classStore) {
        return (C) new AbstractSetupContext(suiteStore, classStore);
    }

    protected ObjectStore getSuiteObjectStore() {
        SuiteContext suiteContext = suiteContextInstance.get();
        return suiteContext.getObjectStore();
    }
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.test.spi.context.SuiteContext

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.