You are viewing a plain text version of this content. The canonical link for it is here.
Posted to watchdog-dev@jakarta.apache.org by sa...@locus.apache.org on 2000/10/04 01:59:47 UTC

cvs commit: jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean errorPage.jsp negativeBeanName.jsp negativeBody.jsp negativeDupID.jsp negativeDupIDSession1.jsp negativeDupIDSession2.jsp negativeInvalidClass.jsp negativeNoBody.jsp negativeTypeNonAssignable.jsp positiveBeanNameClass.jsp positiveBeanNameRes.jsp positiveBodyExists.jsp positiveBodyNew.jsp positiveDupIDPage1.jsp positiveDupIDRequest1.jsp positiveNoBody.jsp positivePageScope.jsp positiveSessionScope.jsp positiveTypeAssignable.jsp

santosh     00/10/03 16:59:46

  Added:       src/server/jsp-tests/jsp/core_syntax/beantests/useBean
                        errorPage.jsp negativeBeanName.jsp negativeBody.jsp
                        negativeDupID.jsp negativeDupIDSession1.jsp
                        negativeDupIDSession2.jsp negativeInvalidClass.jsp
                        negativeNoBody.jsp negativeTypeNonAssignable.jsp
                        positiveBeanNameClass.jsp positiveBeanNameRes.jsp
                        positiveBodyExists.jsp positiveBodyNew.jsp
                        positiveDupIDPage1.jsp positiveDupIDRequest1.jsp
                        positiveNoBody.jsp positivePageScope.jsp
                        positiveSessionScope.jsp positiveTypeAssignable.jsp
  Log:
  watchdog 4.0
  
  Revision  Changes    Path
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/errorPage.jsp
  
  Index: errorPage.jsp
  ===================================================================
  <html>
  <title>errorPage</title>
  <body>
  <!-- Declaring the bean with out body -->
  <%@ page isErrorPage="true" %>
  <%
   out.println("errorPage");
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeBeanName.jsp
  
  Index: negativeBeanName.jsp
  ===================================================================
  <html>
  <title>negativeBeanName</title>
  <body>
  <!-- Declaring the bean with out body -->
  <%@ page errorPage="errorPage.jsp" %>
  <jsp:useBean id="myBean"  beanName="core_syntax.beantests.useBean.NCounter" 
  type="core_syntax.beantests.useBean.NewCounter" />
  <!-- accessing the bean thru a scriptlet -->
  <%
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeBody.jsp
  
  Index: negativeBody.jsp
  ===================================================================
  <html>
  <title>negativeBody</title>
  <body>
  <% /** 	Name : negativeBody
  	Description : Try to create an invalid useBean tag with body (i.e. the
                        tag has a body, but the closing tag does not exist)
  	Result :Should return fatal translation error.
  **/ %>	 <!-- Declaring the bean with body -->
  <!-- Here the bean tag is not closed -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean" >
  <jsp:setProperty name="myBean" property="Name" value="APPLE" />
  <jsp:getProperty name="myBean" property="Name" />
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeDupID.jsp
  
  Index: negativeDupID.jsp
  ===================================================================
  <html>
  <title>negativeDupID</title>
  <body>
  <% /** 	Name : negativeDupID
  	Description : Try to create two useBean tags in the same JSP page
                        with same ID.
  	Result :Should return fatal translation error.
  **/ %>	 <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean" />
  <!-- Declaring the bean with out body.Here same name is used for the declaration -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.IntBean2" />
  <!-- accessing the bean thru a scriptlet  -->
  <%
   out.println(myBean.getName());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeDupIDSession1.jsp
  
  Index: negativeDupIDSession1.jsp
  ===================================================================
  <html>
  <title>negativeDupIDSession1</title>
  <body>
  <% /** 	Name : negativeDupIDSession1
  	Description :Try to create two useBean tags on different JSP pages
                       with same ID, but with scope attribute being set to
                       "session". 
  	Result :Fatal Translation Error.
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="session" class="core_syntax.beantests.useBean.TestBean" />
  <!-- accessing the bean thru a scriptlet  -->
  <%
   out.println(myBean.getName());
  %>
  </body>
  </html> 
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeDupIDSession2.jsp
  
  Index: negativeDupIDSession2.jsp
  ===================================================================
  <html>
  <title>negativeDupIDSession2</title>
  <body>
  <% /** 	Name : negativeDupIDSession2
  	Description :Try to create two useBean tags on different JSP pages
                       with same ID, but with scope attribute being set to
                       "session". 
  	Result :Fatal Translation Error.
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="session" class="core_syntax.beantests.useBean.Counter" />
  <!-- accessing the bean thru a scriptlet  -->
  <%
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeInvalidClass.jsp
  
  Index: negativeInvalidClass.jsp
  ===================================================================
  <html>
  <title>negativeInvalidClass</title>
  <body>
  <% /** 	Name : negativeInvalidClass
  	Description : Try to create a JSP with useBean tag that contains a
                        non-implicit class reference and no source file for that
                        class.
  	Result :Fatal Translation Error
  **/ %>	 
  <!-- Declaring the not available bean with out body -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.NotAvbl" />
  <!-- accessing the bean thru a scriptlet -->
  <%
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeNoBody.jsp
  
  Index: negativeNoBody.jsp
  ===================================================================
  <html>
  <title>negativeNoBody</title>
  <body>
  <% /** 	Name : negativeNoBody
  	Description : Try to create an invalid useBean tag 
  	              (i.e. tag that is not closed)
  	Result :Should return a fatal translation error. 
  **/ %>	 <!-- Declaring the bean with body -->
  <!-- Here the tag is not closed. Hence bound for error -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean" >
  <jsp:getProperty name="myBean" property="Name" />
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/negativeTypeNonAssignable.jsp
  
  Index: negativeTypeNonAssignable.jsp
  ===================================================================
  <html>
  <title>negativeTypeNonAssignable</title>
  <body>
  <% /** 	Name : negativeTypeNonAssignable
  	Description : we are using 'class' and 'type' together and 'class' 
  	              is not assignable to 'type'.
  	Result :
  **/ %>	 
  <!-- using 'class' and 'type' together and 'class' is not assignable to type -->
  <% try { %>
  <jsp:useBean id="ncounter"  class="core_syntax.beantests.useBean.NewCounter"
  type="java.util.Properties" />
  <% }catch(java.lang.ClassCastException cle) { out.println("class cast exception");
  } %>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveBeanNameClass.jsp
  
  Index: positiveBeanNameClass.jsp
  ===================================================================
  <html>
  <title>positiveBeanNameClass</title>
  <body>
  <% /** 	Name : positiveBeanNameClass
  	Description : Declaring the bean with bean name as a class file 
  	Result :We should get page output without error
  **/ %>	 
  <!-- Declaring the bean with bean name as a class file -->
  <jsp:useBean id="myBean" scope="request" beanName="core_syntax.beantests.useBean.NewCounter" 
  type="core_syntax.beantests.useBean.NewCounter" />
  <!-- accessing the bean thru a scriptlet -->
  <%
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveBeanNameRes.jsp
  
  Index: positiveBeanNameRes.jsp
  ===================================================================
  <html>
  <title>positiveBeanNameRes</title>
  <body>
  <% /** 	Name : positiveBeanNameRes
  	Description : Declaring the bean with beanName as a resource file
  	Result :We should get page output without error
  **/ %>	 
  <!-- Declaring the bean with beanName as a resource -->
  <jsp:useBean id="myBean" scope="request"
  beanName="core_syntax.beantests.useBean.NewCounter"
  type="core_syntax.beantests.useBean.NewCounter" />
  
  <!-- accessing the bean thru a scriptlet -->
  <%
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveBodyExists.jsp
  
  Index: positiveBodyExists.jsp
  ===================================================================
  <html>
  <title>positiveBodyExists</title>
  <body>
  <% /**  Name : positiveBodyExists
      Description : Try to create a valid useBean tag in the JSP page with a
                        non-empty body and with a class name that has already
                        been created.
      Result :Should return the page contents except what is contained within
                  the body.
  **/ %>
  <!-- Declaring the bean with body -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean">
  <jsp:setProperty name="myBean" property="name" value="APPLE" />
  </jsp:useBean>
  <jsp:getProperty name="myBean" property="name" />
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveBodyNew.jsp
  
  Index: positiveBodyNew.jsp
  ===================================================================
  <html>
  <title>positiveBodyNew</title>
  <body>
  <% /** 	Name : positiveBodyNew
  	Description : Try to create a valid useBean tag in the JSP page with a
                        non-empty body. Ensure that the classname specified
                        does not exist.
  	Result :Should return the contents of the HTML page along with what
                  exists in the body.
  **/ %>	 
  <!-- Declaring the bean with body -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean" >
  <jsp:setProperty name="myBean" property="name" value="APPLE" />
  
  <jsp:getProperty name="myBean" property="name" />
  </jsp:useBean>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveDupIDPage1.jsp
  
  Index: positiveDupIDPage1.jsp
  ===================================================================
  <html>
  <title>positiveDupIDPage1</title>
  <body>
  <% /** 	Name : positiveDupIDPage1
  	Description :Try to create two useBean tags on different JSP pages
                       with the same ID, and the scope attribute of each being
                       set to "page". Access each page one after the other. 
  	Result :Should not return an error
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="page" class="core_syntax.beantests.useBean.String_IntBean" />
  <!-- accessing the bean thru a scriptlet  -->
  <%
   out.println(myBean.getName());
  %>
  </body>
  </html> 
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveDupIDRequest1.jsp
  
  Index: positiveDupIDRequest1.jsp
  ===================================================================
  <html>
  <title>positiveDupIDRequest1</title>
  <body>
  <% /** 	Name : positiveDupIDRequest1
  	Description :Try to create two useBean tags on different JSP pages
                       with same ID, but with scope attribute being set to
                       "request". 
  	Result :Should not return an error.
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean" />
  <!-- accessing the bean thru a scriptlet  -->
  <%
   out.println(myBean.getName());
  %>
  </body>
  </html> 
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveNoBody.jsp
  
  Index: positiveNoBody.jsp
  ===================================================================
  <html>
  <title>positiveNoBody</title>
  <body>
  <% /** 	Name : positiveNoBody
  	Description : Try to create a valid useBean tag in the JSP page with
                        no body.
  	Result :Should return the JSP page as it is to the browser.
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="request" class="core_syntax.beantests.useBean.String_IntBean" />
  <!-- accessing the bean thru a scriptlet -->
  <%
   out.println(myBean.getName());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positivePageScope.jsp
  
  Index: positivePageScope.jsp
  ===================================================================
  <html>
  <title>positivePageScope</title>
  <body>
  <% /** 	Name : positivePageScope
  	Description : Create the JSP page with useBean scope set to page.
                        Load the CounterBean. Try to reload the page multiple
                        times.
  	Result :Should return the initial value of the counter each time page 
  		is loaded.
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <jsp:useBean id="myBean" scope="page" class="core_syntax.beantests.useBean.Counter" />
  <!-- accessing the bean thru a scriptlet -->
  <%
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveSessionScope.jsp
  
  Index: positiveSessionScope.jsp
  ===================================================================
  <html>
  <title>positiveSessionScope</title>
  <body>
  <% /** 	Name : positiveSessionScope
  	Description : Create the JSP page with useBean scope set to session.
                        Load the CounterBean.
  	Result :Counter must increment each time page is loaded.
  **/ %>	 
  <!-- Declaring the bean with out body -->
  <%@ page import="javax.servlet.http.*" %>
  <jsp:useBean id="myBean" scope="session" class="core_syntax.beantests.useBean.Counter" />
  <!-- accessing the bean thru a scriptlet -->
  <% Cookie[] cok=request.getCookies(); 
     for(int j=0;j<cok.length;j++) {
     out.println(cok[j].getName()+ "  "+cok[j].getValue());
     }
     %>
        
  <%
  out.newLine();
   out.println(myBean.getCount());
  %>
  </body>
  </html> 
  
  
  
  1.1                  jakarta-watchdog-4.0/src/server/jsp-tests/jsp/core_syntax/beantests/useBean/positiveTypeAssignable.jsp
  
  Index: positiveTypeAssignable.jsp
  ===================================================================
  <html>
  <title>positiveTypeAssignable</title>
  <body>
  <% /** 	Name : positiveTypeAssignable
  	Description : we are using 'class' and 'type' together and 'class' 
  		      is assignable to 'type'. 
  	Result :we should get the expected page without an error
  **/ %>	 
  <!-- we are using 'class' and 'type' together and 'class' is assignable to type-->
  <jsp:useBean id="ncounter"  class="core_syntax.beantests.useBean.NewCounter"
  type="core_syntax.beantests.useBean.Counter" />
  <% out.println( ncounter.getCount());  %>
  </body>
  </html>