User: starksm 
  Date: 01/05/23 15:35:01

  Modified:    src/main/org/jboss/test/web/test TestWebIntegration.java
  Log:
  Consider a 400 bad request response to be a valid indication of a
  web server.
  Add test for accessing the EJBOnStartupServlet
  
  Revision  Changes    Path
  1.3       +18 -4     
jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java
  
  Index: TestWebIntegration.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/web/test/TestWebIntegration.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestWebIntegration.java   2001/05/06 04:15:26     1.2
  +++ TestWebIntegration.java   2001/05/23 22:35:01     1.3
  @@ -20,7 +20,7 @@
   with a role of 'AuthorizedUser' in the servlet container.
   
   @author [EMAIL PROTECTED]
  -@version $Revision: 1.2 $
  +@version $Revision: 1.3 $
   */
   public class TestWebIntegration extends TestCase
   {
  @@ -50,23 +50,37 @@
           {
               HttpClient httpConn = new HttpClient(url);
               int responseCode = httpConn.getResponseCode();
  -            if( responseCode != HttpURLConnection.HTTP_OK )
  +            if( responseCode != HttpURLConnection.HTTP_OK &&
  +             responseCode != HttpURLConnection.HTTP_BAD_REQUEST )
               {
                   System.out.println(baseURL+" result="+responseCode+" in HTTP OK, 
skipping tests");
               }
               else
               {
  +                webServerAvailable = true;
                   System.out.println("Found webserver at: "+baseURL);
                   Deploy.deploy("jbosstest-web.ear");
  -                webServerAvailable = true;
               }
           }
           catch(Exception e)
           {
  -            System.out.println("No webserver found at: "+baseURL);
  +         if( webServerAvailable == false )
  +             System.out.println("No webserver found at: "+baseURL);
  +         else
  +             fail("Failed to deploy jbosstest-web.ear");
           }
       }
   
  +    /** Access the http://localhost/jbosstest/EJBOnStartupServlet
  +    */
  +    public void testEJBOnStartupServlet() throws Exception
  +    {
  +        if( webServerAvailable == false )
  +            return;
  +
  +        URL url = new URL(baseURL+"jbosstest/EJBOnStartupServlet");
  +        accessURL(url);
  +    }
       /** Access the http://localhost/jbosstest/ENCServlet
       */
       public void testENCServlet() throws Exception
  
  
  

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

Reply via email to