User: starksm 
  Date: 01/06/10 11:28:30

  Modified:    src/main/org/jboss/test/naming/ejb TestENCBean.java
  Log:
  Add tests of bean ENC isolation
  
  Revision  Changes    Path
  1.4       +26 -8     jbosstest/src/main/org/jboss/test/naming/ejb/TestENCBean.java
  
  Index: TestENCBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/naming/ejb/TestENCBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestENCBean.java  2001/05/11 05:11:28     1.3
  +++ TestENCBean.java  2001/06/10 18:28:30     1.4
  @@ -12,11 +12,11 @@
   to test ENC usage.
   
   @author [EMAIL PROTECTED]
  -@version $Revision: 1.3 $
  +@version $Revision: 1.4 $
   */
   public class TestENCBean implements SessionBean
   {
  -    SessionContext sessionContext;
  +    private SessionContext sessionContext;
   
       public void ejbCreate() throws CreateException
       {
  @@ -43,12 +43,30 @@
               // Obtain the enterprise bean�s environment naming context.
               Context initCtx = new InitialContext();
               Context myEnv = (Context) initCtx.lookup("java:comp/env");
  -            testEnvEntries(initCtx, myEnv);
  -            testEjbRefs(initCtx, myEnv);
  -            testJdbcDataSource(initCtx, myEnv);
  -            testMail(initCtx, myEnv);
  -            testJMS(initCtx, myEnv);
  -            testURL(initCtx, myEnv);
  +            Boolean hasFullENC = (Boolean) myEnv.lookup("hasFullENC");
  +            if( hasFullENC == Boolean.TRUE )
  +            {
  +                // This bean should have the full ENC setup of the ENCBean
  +                testEnvEntries(initCtx, myEnv);
  +                testEjbRefs(initCtx, myEnv);
  +                testJdbcDataSource(initCtx, myEnv);
  +                testMail(initCtx, myEnv);
  +                testJMS(initCtx, myEnv);
  +                testURL(initCtx, myEnv);
  +            }
  +            else
  +            {
  +                // This bean should only have the hasFullENC env entry
  +                try
  +                {
  +                    Integer i = (Integer) myEnv.lookup("Ints/i0");
  +                    throw new EJBException("Was able to find java:comp/env/Ints/i0 
in bean with hasFullENC = false");
  +                }
  +                catch(NamingException e)
  +                {
  +                    // This is what we expect
  +                }
  +            }
           }
           catch(NamingException e)
           {
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to