You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2001/04/07 01:40:36 UTC

cvs commit: jakarta-tomcat-4.0/tester/src/tester/org/apache/tester Jndi01.java

remm        01/04/06 16:40:36

  Modified:    tester/src/tester/org/apache/tester Jndi01.java
  Log:
  - Add additional operations during init and destroy to test bug #1202.
  
  Revision  Changes    Path
  1.3       +15 -1     jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/Jndi01.java
  
  Index: Jndi01.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/tester/org/apache/tester/Jndi01.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Jndi01.java	2001/04/05 00:06:31	1.2
  +++ Jndi01.java	2001/04/06 23:40:35	1.3
  @@ -74,7 +74,7 @@
    * should succeed.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2001/04/05 00:06:31 $
  + * @version $Revision: 1.3 $ $Date: 2001/04/06 23:40:35 $
    */
   
   public class Jndi01 extends HttpServlet {
  @@ -83,10 +83,24 @@
           Context ctx = null;
           try {
               ctx = new InitialContext();
  +            ctx.lookup("java:/comp");
               log("initialized successfully");
           } catch (NamingException e) {
  +            e.printStackTrace();
               log("Cannot create context", e);
               throw new ServletException(e);
  +        }
  +    }
  +
  +    public void destroy() {
  +        Context ctx = null;
  +        try {
  +            ctx = new InitialContext();
  +            ctx.lookup("java:/comp");
  +            log("initialized successfully");
  +        } catch (NamingException e) {
  +            e.printStackTrace();
  +            log("Cannot create context", e);
           }
       }