commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang StringUtilsTrimEmptyTest.java StringUtilsTest.java StringUtilsSubstringTest.java
Date Sun, 23 Mar 2003 21:51:19 GMT
scolebourne    2003/03/23 13:51:19

  Modified:    lang/src/test/org/apache/commons/lang
                        StringUtilsTrimEmptyTest.java StringUtilsTest.java
                        StringUtilsSubstringTest.java
  Log:
  Update licence date to 2003
  
  Revision  Changes    Path
  1.6       +2 -2      jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java
  
  Index: StringUtilsTrimEmptyTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StringUtilsTrimEmptyTest.java	27 Sep 2002 06:08:16 -0000	1.5
  +++ StringUtilsTrimEmptyTest.java	23 Mar 2003 21:51:19 -0000	1.6
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.16      +86 -12    jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTest.java
  
  Index: StringUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- StringUtilsTest.java	23 Mar 2003 05:26:23 -0000	1.15
  +++ StringUtilsTest.java	23 Mar 2003 21:51:19 -0000	1.16
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -388,7 +388,32 @@
                        1, StringUtils.getLevenshteinDistance("hello", "hallo") );
       }
   
  -    public void testContainsOnly() {
  +    public void testContainsOnlyString() {
  +        String str1 = "a";
  +        String str2 = "b";
  +        String str3 = "ab";
  +        String chars1= "b";
  +        String chars2= "a";
  +        String chars3= "ab";
  +        String emptyChars = "";
  +        assertEquals("containsOnly(null, null) failed", false, StringUtils.containsOnly(null,
(String) null));
  +        assertEquals("containsOnly(empty-string, null) failed", false, StringUtils.containsOnly("",
(String) null));
  +        assertEquals("containsOnly(null, empty-string) failed", false, StringUtils.containsOnly(null,
emptyChars));
  +        assertEquals("containsOnly(str1, empty-char-array) failed", false, StringUtils.containsOnly(str1,
emptyChars));
  +        assertEquals("containsOnly(empty-string, empty-char-array) failed", true, StringUtils.containsOnly("",
emptyChars));
  +        assertEquals("containsOnly(empty-string, chars1) failed", true, StringUtils.containsOnly("",
chars1));
  +        assertEquals("containsOnly(str1, chars1) failed", false, StringUtils.containsOnly(str1,
chars1));
  +        assertEquals("containsOnly(str1, chars2) success", true, StringUtils.containsOnly(str1,
chars2));
  +        assertEquals("containsOnly(str1, chars3) success", true, StringUtils.containsOnly(str1,
chars3));
  +        assertEquals("containsOnly(str2, chars1) success", true, StringUtils.containsOnly(str2,
chars1));
  +        assertEquals("containsOnly(str2, chars2) failed", false, StringUtils.containsOnly(str2,
chars2));
  +        assertEquals("containsOnly(str2, chars3) success", true, StringUtils.containsOnly(str2,
chars3));
  +        assertEquals("containsOnly(String3, chars1) failed", false, StringUtils.containsOnly(str3,
chars1));
  +        assertEquals("containsOnly(String3, chars2) failed", false, StringUtils.containsOnly(str3,
chars2));
  +        assertEquals("containsOnly(String3, chars3) success", true, StringUtils.containsOnly(str3,
chars3));
  +    }
  +
  +    public void testContainsOnlyCharArray() {
           String str1 = "a";
           String str2 = "b";
           String str3 = "ab";
  @@ -396,22 +421,71 @@
           char[] chars2= {'a'};
           char[] chars3= {'a', 'b'};
           char[] emptyChars = new char[0];
  -        assertEquals("containsOnly(null, null) failed", false, StringUtils.containsOnly(null,
null));
  -        assertEquals("containsOnly(empty-string, null) failed", false, StringUtils.containsOnly("",
null));
  +        assertEquals("containsOnly(null, null) failed", false, StringUtils.containsOnly(null,
(char[]) null));
  +        assertEquals("containsOnly(empty-string, null) failed", false, StringUtils.containsOnly("",
(char[]) null));
           assertEquals("containsOnly(null, empty-string) failed", false, StringUtils.containsOnly(null,
emptyChars));
           assertEquals("containsOnly(str1, empty-char-array) failed", false, StringUtils.containsOnly(str1,
emptyChars));
           assertEquals("containsOnly(empty-string, empty-char-array) failed", true, StringUtils.containsOnly("",
emptyChars));
           assertEquals("containsOnly(empty-string, chars1) failed", true, StringUtils.containsOnly("",
chars1));
           assertEquals("containsOnly(str1, chars1) failed", false, StringUtils.containsOnly(str1,
chars1));
  -        assertEquals("containsOnly(str1, chars1) failed", false, StringUtils.containsOnly(str1,
chars1));
  -        assertEquals("containsOnly(str1, chars1) success", true, StringUtils.containsOnly(str1,
chars2));
  -        assertEquals("containsOnly(str1, chars1) success", true, StringUtils.containsOnly(str1,
chars3));
  -        assertEquals("containsOnly(str2, chars2) success", true, StringUtils.containsOnly(str2,
chars1));
  +        assertEquals("containsOnly(str1, chars2) success", true, StringUtils.containsOnly(str1,
chars2));
  +        assertEquals("containsOnly(str1, chars3) success", true, StringUtils.containsOnly(str1,
chars3));
  +        assertEquals("containsOnly(str2, chars1) success", true, StringUtils.containsOnly(str2,
chars1));
           assertEquals("containsOnly(str2, chars2) failed", false, StringUtils.containsOnly(str2,
chars2));
  -        assertEquals("containsOnly(str2, chars2) success", true, StringUtils.containsOnly(str2,
chars3));
  -        assertEquals("containsOnly(String3, chars3) failed", false, StringUtils.containsOnly(str3,
chars1));
  -        assertEquals("containsOnly(String3, chars3) failed", false, StringUtils.containsOnly(str3,
chars2));
  +        assertEquals("containsOnly(str2, chars3) success", true, StringUtils.containsOnly(str2,
chars3));
  +        assertEquals("containsOnly(String3, chars1) failed", false, StringUtils.containsOnly(str3,
chars1));
  +        assertEquals("containsOnly(String3, chars2) failed", false, StringUtils.containsOnly(str3,
chars2));
           assertEquals("containsOnly(String3, chars3) success", true, StringUtils.containsOnly(str3,
chars3));
  +    }
  +
  +    public void testContainsNoneString() {
  +        String str1 = "a";
  +        String str2 = "b";
  +        String str3 = "ab.";
  +        String chars1= "b";
  +        String chars2= ".";
  +        String chars3= "cd";
  +        String emptyChars = "";
  +        assertEquals("containsNone(null, null) failed", true, StringUtils.containsNone(null,
(String) null));
  +        assertEquals("containsNone(empty-string, null) failed", true, StringUtils.containsNone("",
(String) null));
  +        assertEquals("containsNone(null, empty-string) failed", true, StringUtils.containsNone(null,
emptyChars));
  +        assertEquals("containsNone(str1, empty-char-array) failed", true, StringUtils.containsNone(str1,
emptyChars));
  +        assertEquals("containsNone(empty-string, empty-char-array) failed", true, StringUtils.containsNone("",
emptyChars));
  +        assertEquals("containsNone(empty-string, chars1) failed", true, StringUtils.containsNone("",
chars1));
  +        assertEquals("containsNone(str1, chars1)", true, StringUtils.containsNone(str1,
chars1));
  +        assertEquals("containsNone(str1, chars2)", true, StringUtils.containsNone(str1,
chars2));
  +        assertEquals("containsNone(str1, chars3)", true, StringUtils.containsNone(str1,
chars3));
  +        assertEquals("containsNone(str2, chars1)", false, StringUtils.containsNone(str2,
chars1));
  +        assertEquals("containsNone(str2, chars2)", true, StringUtils.containsNone(str2,
chars2));
  +        assertEquals("containsNone(str2, chars3)", true, StringUtils.containsNone(str2,
chars3));
  +        assertEquals("containsNone(str3, chars1)", false, StringUtils.containsNone(str3,
chars1));
  +        assertEquals("containsNone(str3, chars2)", false, StringUtils.containsNone(str3,
chars2));
  +        assertEquals("containsNone(str3, chars3)", true, StringUtils.containsNone(str3,
chars3));
  +    }
  +
  +    public void testContainsNoneCharArray() {
  +        String str1 = "a";
  +        String str2 = "b";
  +        String str3 = "ab.";
  +        char[] chars1= {'b'};
  +        char[] chars2= {'.'};
  +        char[] chars3= {'c', 'd'};
  +        char[] emptyChars = new char[0];
  +        assertEquals("containsNone(null, null) failed", true, StringUtils.containsNone(null,
(char[]) null));
  +        assertEquals("containsNone(empty-string, null) failed", true, StringUtils.containsNone("",
(char[]) null));
  +        assertEquals("containsNone(null, empty-string) failed", true, StringUtils.containsNone(null,
emptyChars));
  +        assertEquals("containsNone(str1, empty-char-array) failed", true, StringUtils.containsNone(str1,
emptyChars));
  +        assertEquals("containsNone(empty-string, empty-char-array) failed", true, StringUtils.containsNone("",
emptyChars));
  +        assertEquals("containsNone(empty-string, chars1) failed", true, StringUtils.containsNone("",
chars1));
  +        assertEquals("containsNone(str1, chars1)", true, StringUtils.containsNone(str1,
chars1));
  +        assertEquals("containsNone(str1, chars2)", true, StringUtils.containsNone(str1,
chars2));
  +        assertEquals("containsNone(str1, chars3)", true, StringUtils.containsNone(str1,
chars3));
  +        assertEquals("containsNone(str2, chars1)", false, StringUtils.containsNone(str2,
chars1));
  +        assertEquals("containsNone(str2, chars2)", true, StringUtils.containsNone(str2,
chars2));
  +        assertEquals("containsNone(str2, chars3)", true, StringUtils.containsNone(str2,
chars3));
  +        assertEquals("containsNone(str3, chars1)", false, StringUtils.containsNone(str3,
chars1));
  +        assertEquals("containsNone(str3, chars2)", false, StringUtils.containsNone(str3,
chars2));
  +        assertEquals("containsNone(str3, chars3)", true, StringUtils.containsNone(str3,
chars3));
       }
   
       public void testAbbreviate()
  
  
  
  1.3       +2 -2      jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsSubstringTest.java
  
  Index: StringUtilsSubstringTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/StringUtilsSubstringTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StringUtilsSubstringTest.java	27 Nov 2002 22:53:48 -0000	1.2
  +++ StringUtilsSubstringTest.java	23 Mar 2003 21:51:19 -0000	1.3
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  

---------------------------------------------------------------------
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