Package org.jboss.arquillian.impl.core

Examples of org.jboss.arquillian.impl.core.ManagerImpl


{

   @Test
   public void shouldBeAbleToDoStaticInjection() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .extension(TestObserver.class).create();
     
      manager.getContext(ApplicationContextImpl.class).getObjectStore()
         .add(Object.class, new Object());
     
      manager.fire("test event");
     
      Assert.assertTrue(manager.getExtension(TestObserver.class).wasCalled);
   }
View Full Code Here


public class ManagerImplTestCase
{
   @Test
   public void shouldBeAbleToRegisterContextAndExtensions() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .context(SuiteContextImpl.class)
         .extension(TestExtension.class).create();

      SuiteContext context = manager.getContext(SuiteContext.class);
      try
      {
         context.activate();
         // bind something to the context so our Instance<Object> is resolved
         context.getObjectStore().add(Object.class, new Object());
        
         manager.fire("some string");
        
         Assert.assertTrue(manager.getExtension(TestExtension.class).wasCalled);
        
      }
      finally
      {
         context.deactivate();
View Full Code Here

   }

   @Test
   public void shouldBindToTheScopedContext() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .context(SuiteContextImpl.class)
         .context(ClassContextImpl.class).create();

      SuiteContext suiteContext = manager.getContext(SuiteContext.class);
      ClassContext classContext = manager.getContext(ClassContext.class);

      try
      {
         suiteContext.activate();
         classContext.activate(this.getClass());
        
         Object testObject = new Object();
        
         manager.bind(SuiteScoped.class, Object.class, testObject);
        
         Assert.assertEquals(
               "Verify value was bound to the correct context",
               testObject,
               suiteContext.getObjectStore().get(Object.class));
View Full Code Here

   }
  
   @Test
   public void shouldResolveToNullIfNoActiveContexts() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from().create();
      Assert.assertNull(manager.resolve(Object.class));
   }
View Full Code Here

   }
  
   @Test
   public void shouldResolveToNullContextIfNotFound() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from().create();
      Assert.assertNull(manager.getContext(SuiteContextImpl.class));
   }
View Full Code Here

   }

   @Test
   public void shouldResolveToNullExtensionIfNotFound() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from().create();
      Assert.assertNull(manager.getExtension(SuiteContextImpl.class));
   }
View Full Code Here

   {
      final String testEvent = "test";
     
      TestNonManagedObserver observer = new TestNonManagedObserver();
     
      ManagerImpl manager = ManagerBuilder.from().create();
      manager.fire(testEvent, observer);
     
      Assert.assertNotNull(
            "NonManagedObserver should have been called",
            TestNonManagedObserver.firedEvent);
      Assert.assertEquals(
View Full Code Here

   }
  
   @Test(expected = IllegalArgumentException.class)
   public void shouldThrowExceptionOnBindWithNoFoundScopedContext() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from().create();
      manager.bind(SuiteScoped.class, Object.class, new Object());
   }
View Full Code Here

   }

   @Test(expected = IllegalArgumentException.class)
   public void shouldThrowExceptionOnBindWithNonActiveScopedContext() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .context(SuiteContextImpl.class).create();

      manager.bind(SuiteScoped.class, Object.class, new Object());
   }
View Full Code Here

public class EventFireTestCase
{
   @Test
   public void shouldBeAbleToFireEventToAExtension() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .extension(ExtensionWithObservers.class).create();
     
      manager.fire(new Object());
     
      Assert.assertTrue(manager.getExtension(ExtensionWithObservers.class).methodOneWasCalled);
   }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.impl.core.ManagerImpl

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.