Package org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb

Examples of org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb.MyStatefulLocalBusiness


     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new ClusteredMetaDataBridge());
   }
View Full Code Here


      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new ClusteredMetaDataBridge());
   }
View Full Code Here

      Assert.assertNotNull("Lookup of local bean at " + localJndiName + " returned null", obj);
      Assert.assertTrue("Lookup at " + localJndiName + " returned unexpected object " + obj,
            obj instanceof MyStatefulLocalBusiness);

      MyStatefulLocalBusiness bean = (MyStatefulLocalBusiness) obj;
      int counter = bean.getNextCounter();
      logger.debug("Got counter " + counter);

      Assert.assertEquals("Unexpected counter value = " + counter, counter, 0);

   }
View Full Code Here

    */
   @Test
   public void testSessionScoping() throws Exception
   {
      // Lookup 2 Instances
      MyStatefulLocalBusiness bean1 = (MyStatefulLocalBusiness) ProxyStatefulSessionTestCase.context
            .lookup("MyStatefulBean/local");
      MyStatefulLocalBusiness bean2 = (MyStatefulLocalBusiness) ProxyStatefulSessionTestCase.context
            .lookup("MyStatefulBean/local");

      // Invoke continuously on instance one 10 times to ensure that the SFSB counter increments properly
      for (int counter = 0; counter < 10; counter++)
      {
         // Invoke
         int result = bean1.getNextCounter();
         TestCase.assertEquals("SFSB invocations should have memory of the session", counter, result);
      }

      // Invoke once on instance two to ensure its scope is separate from that of instance one
      TestCase
            .assertEquals("SFSB Session Scopes must not be shared between Proxy instances", 0, bean2.getNextCounter());
   }
View Full Code Here

    */
   @Test
   public void testSessionScoping() throws Exception
   {
      // Lookup 2 Instances
      MyStatefulLocalBusiness bean1 = (MyStatefulLocalBusiness) ProxyStatefulSession30OnlyTestCase.context
            .lookup("MyStateful30OnlyBean/local");
      MyStatefulLocalBusiness bean2 = (MyStatefulLocalBusiness) ProxyStatefulSession30OnlyTestCase.context
            .lookup("MyStateful30OnlyBean/local");

      // Invoke continuously on instance one 10 times to ensure that the SFSB counter increments properly
      for (int counter = 0; counter < 10; counter++)
      {
         // Invoke
         int result = bean1.getNextCounter();
         TestCase.assertEquals("SFSB invocations should have memory of the session", counter, result);
      }

      // Invoke once on instance two to ensure its scope is separate from that of instance one
      TestCase
            .assertEquals("SFSB Session Scopes must not be shared between Proxy instances", 0, bean2.getNextCounter());
   }
View Full Code Here

      Assert.assertNotNull("Local jndi name " + localJNDIName + " lookup returned null", obj);
      Assert.assertTrue("Local jndi name lookup at " + localJNDIName + " returned unexpected object " + obj,
            obj instanceof MyStatefulLocalBusiness);

      MyStatefulLocalBusiness localBean = (MyStatefulLocalBusiness) obj;

      int count = localBean.getNextCounter();
      Assert.assertEquals("Unexpected counter value: " + count + " from local stateful bean", count, 0);

      // now lookup remote and invoke on it
      String remoteJNDIName = smd.getJndiName();
View Full Code Here

    * @return
    */
   private TimerService createTimerService()
   {
      // get the TimedObjectInvoker
      TimedObjectInvoker timedObjectInvoker = this.getTimedObjectInvoker();
      // if there's no TimedObjectInvoker, we can't do anything, so just
      // throw an exception
      if (timedObjectInvoker == null)
      {
         throw new IllegalStateException("Cannot create timerservice for EJB " + this.getEjbName()
View Full Code Here

      try
      {
         Thread.currentThread().setContextClassLoader(classloader);
         try
         {
            Util.rebind(getEnc(), "UserTransaction", new UserTransactionImpl());
         }
         catch (NamingException e)
         {
            NamingException namingException = new NamingException("Could not bind user transaction for ejb name " + ejbName + " into JNDI under jndiName: " + getEnc().getNameInNamespace() + "/" + "UserTransaction");
            namingException.setRootCause(e);
View Full Code Here

      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
View Full Code Here

      interceptorBridges.add(new InterceptorMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.test.proxy.impl.common.ejb.sfsb.MyStatefulLocalBusiness

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.