Examples of IRare


Examples of org.jboss.test.kernel.lazy.support.IRare

         assertEquals(ControllerState.INSTALLED, lazyContext.getState());

         controller.change(beanContext, ControllerState.DESCRIBED);
         controller.change(lazyContext, ControllerState.INSTALLED);

         IRare lazyRare = (IRare)lazyContext.getTarget();
         assertNotNull(lazyRare);

         try
         {
            lazyRare.getHits();
            throw new RuntimeException("Should not be here.");
         }
         catch(Throwable t)
         {
            assertInstanceOf(t, IllegalArgumentException.class);
         }

         controller.install(new AbstractBeanMetaData("foobar", Object.class.getName()));
         controller.change(beanContext, ControllerState.INSTALLED);

         assertEquals(0, lazyRare.getHits());
         lazyRare.setHits(10);
         assertEquals(5, lazyRare.checkHits(15));

         controller.uninstall(beanContext.getName());
         assertEquals(ControllerState.DESCRIBED, lazyContext.getState());
      }
      finally
View Full Code Here

Examples of org.jboss.test.kernel.lazy.support.IRare

         lazy.setInterfaces(Collections.singleton(IRare.class.getName()));
         KernelControllerContext lazyContext = controller.install(lazy);
         assertNotNull(lazyContext);
         assertEquals(ControllerState.INSTALLED, lazyContext.getState());

         IRare lazyRare = (IRare)lazyContext.getTarget();
         assertNotNull(lazyRare);

         // should not be fully installed yet
         assertEquals(ControllerState.DESCRIBED, beanContext.getState());
         assertEquals(0, lazyRare.getHits());
         // the hit should install it
         assertEquals(ControllerState.INSTALLED, beanContext.getState());

         lazyRare.setHits(10);
         assertEquals(5, lazyRare.checkHits(15));

         controller.uninstall(beanContext.getName());
         assertEquals(ControllerState.DESCRIBED, lazyContext.getState());
      }
      finally
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.