[jboss-cvs] jboss-ejb3/src/test/org/jboss/ejb3/test/mdb ...

Bill DeCoste bdecoste at jboss.com
Mon Jul 24 17:28:30 EDT 2006


  User: bdecoste
  Date: 06/07/24 17:28:30

  Modified:    src/test/org/jboss/ejb3/test/mdb     OverrideTestMDB.java
                        QueueTestMDB.java StatelessBean.java
  Added:       src/test/org/jboss/ejb3/test/mdb     LocalStatelessBean.java
  Log:
  MDB cleanup, standalone test for standard testcases, fixed class level @Resources jndi env bindings
  
  Revision  Changes    Path
  1.5       +3 -2      jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/OverrideTestMDB.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: OverrideTestMDB.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/OverrideTestMDB.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- OverrideTestMDB.java	30 Jun 2006 19:23:44 -0000	1.4
  +++ OverrideTestMDB.java	24 Jul 2006 21:28:30 -0000	1.5
  @@ -32,7 +32,7 @@
   
   /**
    * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  - * @version <tt>$Revision: 1.4 $</tt>
  + * @version <tt>$Revision: 1.5 $</tt>
    */
   @MessageDriven(activationConfig =
           {
  @@ -46,8 +46,9 @@
   
      public void onMessage(Message recvMsg)
      {
  -      System.out.println("*** OverrideTestMDB onMessage");
         if (ctx == null) throw new RuntimeException("FAILED ON CTX LOOKUP");
         TestStatusBean.overrideQueueRan++;
  +      
  +      System.out.println("*** OverrideTestMDB onMessage " + TestStatusBean.overrideQueueRan);
      }
   }
  
  
  
  1.17      +14 -3     jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: QueueTestMDB.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/QueueTestMDB.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- QueueTestMDB.java	30 Jun 2006 19:23:44 -0000	1.16
  +++ QueueTestMDB.java	24 Jul 2006 21:28:30 -0000	1.17
  @@ -26,6 +26,7 @@
   import javax.interceptor.InvocationContext;
   import javax.ejb.MessageDriven;
   import javax.ejb.MessageDrivenContext;
  +import javax.ejb.EJB;
   import javax.annotation.PostConstruct;
   import javax.annotation.PreDestroy;
   import javax.annotation.Resource;
  @@ -42,7 +43,7 @@
    * Comment
    *
    * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  - * @version $Revision: 1.16 $
  + * @version $Revision: 1.17 $
    */
   @MessageDriven(activationConfig =
           {
  @@ -55,6 +56,9 @@
   {
      private static final Logger log = Logger.getLogger(QueueTestMDB.class);
      
  +   @EJB(beanName="LocalStateless")
  +   Stateless localStateless;
  +   
      public int count = 0;
   
      @Resource MessageDrivenContext ctx;
  @@ -68,16 +72,23 @@
         
         System.out.println("*** QueueTestMDB onMessage " + TestStatusBean.queueRan + " " + count + " " + this);
   
  +      testInjections();
  +
         try {
            InitialContext jndiContext = new InitialContext();
  -         Stateless stateful = (Stateless)jndiContext.lookup("Stateless");
  -         stateful.setState("Set");
  +         Stateless stateless = (Stateless)jndiContext.lookup("Stateless");
  +         stateless.setState("Set");
         } catch (Exception e)
         {
            e.printStackTrace();
         }
      }
   
  +   protected void testInjections()
  +   {
  +      localStateless.setState("testing");
  +   }
  +
      @AroundInvoke
      public Object intercept(InvocationContext ctx) throws Exception
      {
  
  
  
  1.3       +3 -3      jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/StatelessBean.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: StatelessBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/StatelessBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- StatelessBean.java	30 Oct 2005 00:06:57 -0000	1.2
  +++ StatelessBean.java	24 Jul 2006 21:28:30 -0000	1.3
  @@ -23,7 +23,7 @@
   
   import javax.annotation.security.RolesAllowed;
   import javax.ejb.Remote;
  -import javax.ejb.Stateful;
  +import javax.ejb.Stateless;
   
   import org.jboss.annotation.ejb.RemoteBinding;
   import org.jboss.annotation.security.SecurityDomain;
  @@ -32,9 +32,9 @@
    * Comment
    *
    * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  - at Stateful(name="Stateless")
  + at Stateless(name="Stateless")
   @Remote(org.jboss.ejb3.test.mdb.Stateless.class)
   @RemoteBinding(jndiBinding = "Stateless")
   @SecurityDomain("other")
  
  
  
  1.1      date: 2006/07/24 21:28:30;  author: bdecoste;  state: Exp;jboss-ejb3/src/test/org/jboss/ejb3/test/mdb/LocalStatelessBean.java
  
  Index: LocalStatelessBean.java
  ===================================================================
  /*
    * JBoss, Home of Professional Open Source
    * Copyright 2005, JBoss Inc., and individual contributors as indicated
    * by the @authors tag. See the copyright.txt in the distribution for a
    * full listing of individual contributors.
    *
    * This is free software; you can redistribute it and/or modify it
    * under the terms of the GNU Lesser General Public License as
    * published by the Free Software Foundation; either version 2.1 of
    * the License, or (at your option) any later version.
    *
    * This software is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    * Lesser General Public License for more details.
    *
    * You should have received a copy of the GNU Lesser General Public
    * License along with this software; if not, write to the Free
    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
    */
  package org.jboss.ejb3.test.mdb;
  
  import javax.ejb.Stateless;
  
  /**
   * Comment
   *
   * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
   * @version $Revision: 1.1 $
   */
  @Stateless(name="LocalStateless")
  public class LocalStatelessBean implements org.jboss.ejb3.test.mdb.Stateless
  {
     private static String state = null;
  
     public String getState()
     {
        return state;
     }
  
     public void setState(String state)
     {
        this.state = state;
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list