commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roxspr...@apache.org
Subject cvs commit: jakarta-commons/cli/src/test/org/apache/commons/cli2/validation UrlValidatorTest.java EnumValidatorTest.java FileValidatorTest.java NumberValidatorTest.java
Date Tue, 20 Apr 2004 23:18:58 GMT
roxspring    2004/04/20 16:18:58

  Modified:    cli/src/test/org/apache/commons/cli2/validation Tag:
                        RESEARCH_CLI_2_ROXSPRING NumberValidatorTest.java
  Added:       cli/src/test/org/apache/commons/cli2/validation Tag:
                        RESEARCH_CLI_2_ROXSPRING UrlValidatorTest.java
                        EnumValidatorTest.java FileValidatorTest.java
  Log:
  Added validator test cases for Enum File Url and an additional test for Number
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.7   +14 -0     jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/NumberValidatorTest.java
  
  Index: NumberValidatorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/NumberValidatorTest.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- NumberValidatorTest.java	26 Mar 2004 00:24:56 -0000	1.1.2.6
  +++ NumberValidatorTest.java	20 Apr 2004 23:18:58 -0000	1.1.2.7
  @@ -100,6 +100,20 @@
           assertFalse(i.hasNext());
       }
   
  +    public void testValidate_ExcessChars() throws InvalidArgumentException {
  +        final Object[] array = new Object[] { "10DowningStreet"};
  +        final List list = Arrays.asList(array);
  +        final Validator validator = NumberValidator.getIntegerInstance();
  +
  +        try{
  +            validator.validate(list);
  +            fail("InvalidArgumentException");
  +        }
  +        catch(InvalidArgumentException e){
  +            assertEquals("10DowningStreet",e.getMessage());
  +        }
  +    }
  +
       public void testValidate_Maximum() {
           final Object[] array = new Object[] { "1", "107" };
           final List list = Arrays.asList(array);
  
  
  
  No                   revision
  
  Index: NumberValidatorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/NumberValidatorTest.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- NumberValidatorTest.java	26 Mar 2004 00:24:56 -0000	1.1.2.6
  +++ NumberValidatorTest.java	20 Apr 2004 23:18:58 -0000	1.1.2.7
  @@ -100,6 +100,20 @@
           assertFalse(i.hasNext());
       }
   
  +    public void testValidate_ExcessChars() throws InvalidArgumentException {
  +        final Object[] array = new Object[] { "10DowningStreet"};
  +        final List list = Arrays.asList(array);
  +        final Validator validator = NumberValidator.getIntegerInstance();
  +
  +        try{
  +            validator.validate(list);
  +            fail("InvalidArgumentException");
  +        }
  +        catch(InvalidArgumentException e){
  +            assertEquals("10DowningStreet",e.getMessage());
  +        }
  +    }
  +
       public void testValidate_Maximum() {
           final Object[] array = new Object[] { "1", "107" };
           final List list = Arrays.asList(array);
  
  
  
  No                   revision
  
  Index: NumberValidatorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/NumberValidatorTest.java,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- NumberValidatorTest.java	26 Mar 2004 00:24:56 -0000	1.1.2.6
  +++ NumberValidatorTest.java	20 Apr 2004 23:18:58 -0000	1.1.2.7
  @@ -100,6 +100,20 @@
           assertFalse(i.hasNext());
       }
   
  +    public void testValidate_ExcessChars() throws InvalidArgumentException {
  +        final Object[] array = new Object[] { "10DowningStreet"};
  +        final List list = Arrays.asList(array);
  +        final Validator validator = NumberValidator.getIntegerInstance();
  +
  +        try{
  +            validator.validate(list);
  +            fail("InvalidArgumentException");
  +        }
  +        catch(InvalidArgumentException e){
  +            assertEquals("10DowningStreet",e.getMessage());
  +        }
  +    }
  +
       public void testValidate_Maximum() {
           final Object[] array = new Object[] { "1", "107" };
           final List list = Arrays.asList(array);
  
  
  
  1.1.2.1   +55 -0     jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/UrlValidatorTest.java
  
  
  
  
  1.1.2.1   +58 -0     jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/EnumValidatorTest.java
  
  
  
  
  1.1.2.1   +82 -0     jakarta-commons/cli/src/test/org/apache/commons/cli2/validation/Attic/FileValidatorTest.java
  
  
  
  

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


Mime
View raw message