Package org.jboss.arquillian.impl.core

Examples of org.jboss.arquillian.impl.core.ManagerImpl.fire()


         .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);
   }
  
   private static class TestObserver
View Full Code Here


      {
         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
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

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

   public void shouldBeAbleToFireExceptionEventOnFailingObserver() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .extensions(ExtensionWithExceptionObserver.class, ExtensionObservingException.class).create();
     
      manager.fire(new String("should cause exception"));
     
      Assert.assertTrue(manager.getExtension(ExtensionObservingException.class).methodOneWasCalled);
   }

   @Test(expected = IOException.class)
View Full Code Here

   public void shouldBeAbleToDetectExceptionEventLoopAndThrowOriginalException() throws Exception
   {
      ManagerImpl manager = ManagerBuilder.from()
         .extensions(ExtensionObservingExceptionLoop.class).create();
     
      manager.fire(new IOException("should cause exception"));
     
  }

   private static class ExtensionWithObservers
   {
View Full Code Here

      {
         context.activate();
         context.getObjectStore().add(Object.class, new Object());
        
        
         manager.fire("some string event");

         Assert.assertTrue(manager.getExtension(TestObserverOne.class).wasCalled);
         Assert.assertTrue(manager.getExtension(TestObserverTwo.class).wasCalled);
         Assert.assertTrue(manager.getExtension(TestObserverTree.class).wasCalled);
        
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.