Package org.jboss.ejb3.test.spec_3_2_1

Examples of org.jboss.ejb3.test.spec_3_2_1.MyStatelessBean


      // get metadata
      JBossSessionBeanMetaData metadata = this.sessionContainer.getMetaData();

      // Lookup the remote bean
      Context ctx = new InitialContext();
      MyRemote remote = (MyRemote) ctx.lookup(metadata.getJndiName());

      testPassByValueForMethodParameters(remote);

   }
View Full Code Here


      // get metadata
      JBossSessionBeanMetaData metadata = this.sessionContainer.getMetaData();

      // Lookup the remote bean
      Context ctx = new InitialContext();
      MyRemote remote = (MyRemote) ctx.lookup(metadata.getJndiName());

      testPassByValueForReturnedObject(remote);

   }
View Full Code Here

      // get metadata
      JBossSessionBeanMetaData metadata = this.sessionContainer.getMetaData();

      // Lookup the remote bean
      Context ctx = new InitialContext();
      MyRemote remote = (MyRemote) ctx.lookup(metadata.getJndiName());

      testPassByValueForMethodParameters(remote);

   }
View Full Code Here

      // get metadata
      JBossSessionBeanMetaData metadata = this.sessionContainer.getMetaData();

      // Lookup the remote bean
      Context ctx = new InitialContext();
      MyRemote remote = (MyRemote) ctx.lookup(metadata.getJndiName());

      testPassByValueForReturnedObject(remote);

   }
View Full Code Here

    * @param remote
    * @throws Throwable
    */
   private void testPassByValueForMethodParameters(MyRemote remote) throws Throwable
   {
      SimplePojo localSimplePojo = new SimplePojo();

      // set some initial value
      int value = 3;
      localSimplePojo.setTransientField(value);
      // call the method on the bean
      SimplePojo returnedPojo = remote.changeAndReturn(localSimplePojo);

      // The passed and the returned objects should not be the same
      assertFalse(
            "The object passed to the method of the remote bean and the object returned from the bean are both the same",
            localSimplePojo == returnedPojo);

      // Any value changed in the method of the remote bean should not
      // affect the local object - Confirms pass by value
      assertEquals("The object passed to a method of remote bean was modified(passed by reference)", localSimplePojo
            .getTransientField(), value);

      SimplePojo anotherPojo = new SimplePojo();
      SimplePojo returnedObj = remote.doNothingAndReturn(anotherPojo);

      // The passed and the returned objects should not be the same
      assertFalse(
            "The object passed to the method of the remote bean and the object returned from the bean are both the same",
            anotherPojo == returnedObj);
View Full Code Here

    * @param remote
    * @throws Throwable
    */
   private void testPassByValueForReturnedObject(MyRemote remote) throws Throwable
   {
      SimplePojo returnedPojo = remote.getPojo();
      log.info("Returned object has value = " + returnedPojo.getTransientField());
      assertTrue("The object returned from the remote bean is passed by reference",
            returnedPojo.getTransientField() == 0);

   }
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.spec_3_2_1.MyStatelessBean

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.