Package com.nokia.dempsy.container.internal

Examples of com.nokia.dempsy.container.internal.LifecycleHelper.newInstance()


   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);

      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();
      assertNotNull("instantiation failed; null instance", instance);
      assertNotSame("instantiation failed; returned prototype", prototype, instance);

      assertFalse("instance activated before activation method called", instance.isActivated);
      assertTrue(invoker.activate(instance, null, "ABC".getBytes()));
View Full Code Here


   public void testActivateReturns() throws Exception
   {
      ActivateReturns prototype = new ActivateReturns();
      LifecycleHelper invoker = new LifecycleHelper(prototype);

      ActivateReturns instance = (ActivateReturns)invoker.newInstance();
      assertNotNull("instantiation failed; null instance", instance);
      assertNotSame("instantiation failed; returned prototype", prototype, instance);

      assertFalse("instance activated before activation method called", instance.isActivated);
      assertTrue(invoker.activate(instance, null, "ABC".getBytes()));
View Full Code Here

   public void testInvocationExactClass()
   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);
      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();
      BasicStatsCollector statsCollector = new BasicStatsCollector();

      // pre-condition assertion
      assertNull(prototype.lastStringHandlerValue);
      assertNull(instance.lastStringHandlerValue);
View Full Code Here

   public void testInvocationCommonSuperclass()
   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);
      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();
      BasicStatsCollector statsCollector = new BasicStatsCollector();

      Integer message1 = new Integer(1);
      Object o = invoker.invoke(instance, message1,statsCollector);
      assertEquals(message1, instance.lastNumberHandlerValue);
View Full Code Here

   public void testInvocationFailureNoHandler()
   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);
      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();
      BasicStatsCollector statsCollector = new BasicStatsCollector();

      invoker.invoke(instance, new Object(),statsCollector);
   }
View Full Code Here

   public void testInvocationFailureNullMessage()
   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);
      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();
      BasicStatsCollector statsCollector = new BasicStatsCollector();

      invoker.invoke(instance, null,statsCollector);
   }
View Full Code Here

   public void testOutput()
   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);
      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();

      assertFalse("instance says it did output before method called", instance.outputCalled);
      invoker.invokeOutput(instance);
      assertTrue("output method was not called", instance.outputCalled);
   }
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.