commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/latka/src/java/org/apache/commons/latka/validators RegexpValidator.java
Date Fri, 03 May 2002 19:50:25 GMT
morgand     02/05/03 12:50:25

  Modified:    latka/src/java/org/apache/commons/latka/validators
                        RegexpValidator.java
  Log:
  now regexp validator will always fail on null response bodies
  
  Revision  Changes    Path
  1.10      +4 -10     jakarta-commons/latka/src/java/org/apache/commons/latka/validators/RegexpValidator.java
  
  Index: RegexpValidator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/validators/RegexpValidator.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RegexpValidator.java	3 May 2002 19:08:02 -0000	1.9
  +++ RegexpValidator.java	3 May 2002 19:50:25 -0000	1.10
  @@ -75,11 +75,12 @@
    * of the test indicates whether or not a match 
    * is expected.  If the server returns a <i>null</i> 
    * (e.g. in the case of an empty HEAD response), the 
  - * match will always return false.
  + * validator will always fail, regardless of the setting
  + * of the "condition" attribute.
    * 
    * @author Morgan Delagrange
    * @author dIon Gillard
  - * @version $Id: RegexpValidator.java,v 1.9 2002/05/03 19:08:02 morgand Exp $
  + * @version $Id: RegexpValidator.java,v 1.10 2002/05/03 19:50:25 morgand Exp $
    */
   public class RegexpValidator extends BaseConditionalValidator implements Validator {
   
  @@ -87,7 +88,6 @@
   
       protected String _pattern = null;
       protected boolean _ignoreCase = false;
  -    protected boolean _wasResponseBodyNull = false;
   
       protected static final String BARE_EXCEPTION_MESSAGE = " TO MATCH PATTERN: ";
   
  @@ -122,8 +122,7 @@
   
           String responseBody = response.getResource();
           if (responseBody == null) {
  -            _wasResponseBodyNull = true;
  -            return false;
  +            fail("HTTP RESPONSE BODY WAS NULL");
           }
   
           RE r = null;
  @@ -145,11 +144,6 @@
       }
   
       public String generateBareExceptionMessage() {
  -        if (_wasResponseBodyNull == true) {
  -            return BARE_EXCEPTION_MESSAGE + _pattern +
  -                " (HTTP response body was null.)";
  -        }
  -
           return BARE_EXCEPTION_MESSAGE + _pattern;
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message