Update licence date to 2003

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137272 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2003-03-23 21:51:51 +00:00
parent bdf11dfa91
commit 3f8418c654
15 changed files with 137 additions and 63 deletions

View File

@ -60,13 +60,14 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* Unit tests {@link org.apache.commons.lang.ArrayUtils}.
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author Moritz Petersen
* @author Nikolay Metchev
* @version $Id: ArrayUtilsTest.java,v 1.5 2003/02/04 22:06:24 scolebourne Exp $
* @version $Id: ArrayUtilsTest.java,v 1.6 2003/03/23 21:47:30 scolebourne Exp $
*/
public class ArrayUtilsTest extends TestCase {

View File

@ -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
@ -57,11 +57,12 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* Unit tests {@link org.apache.commons.lang.BooleanUtils}.
*
* @author Stephen Colebourne
* @version $Id: BooleanUtilsTest.java,v 1.2 2002/12/22 21:33:12 scolebourne Exp $
* @version $Id: BooleanUtilsTest.java,v 1.3 2003/03/23 21:47:30 scolebourne Exp $
*/
public class BooleanUtilsTest extends TestCase {

View File

@ -1,9 +1,7 @@
package org.apache.commons.lang;
/* ====================================================================
* 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
@ -53,17 +51,19 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.lang;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* Unit tests {@link org.apache.commons.lang.CharSetUtils}.
*
* @author <a href="mailto:bayard@generationjava.com">Henri Yandell</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: CharSetUtilsTest.java,v 1.6 2003/03/23 05:50:51 bayard Exp $
* @version $Id: CharSetUtilsTest.java,v 1.7 2003/03/23 21:47:30 scolebourne Exp $
*/
public class CharSetUtilsTest extends TestCase
{

View File

@ -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
@ -61,11 +61,12 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* Unit tests {@link org.apache.commons.lang.ClassUtils}.
*
* @author Stephen Colebourne
* @version $Id: ClassUtilsTest.java,v 1.2 2002/12/31 22:32:23 scolebourne Exp $
* @version $Id: ClassUtilsTest.java,v 1.3 2003/03/23 21:47:30 scolebourne Exp $
*/
public class ClassUtilsTest extends TestCase {

View File

@ -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
@ -57,12 +57,13 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* Test suite for the Lang package.
*
* @author Stephen Colebourne
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: LangTestSuite.java,v 1.12 2002/12/29 22:09:53 scolebourne Exp $
* @version $Id: LangTestSuite.java,v 1.13 2003/03/23 21:49:13 scolebourne Exp $
*/
public class LangTestSuite extends TestCase {

View File

@ -1,9 +1,7 @@
package org.apache.commons.lang;
/* ====================================================================
* 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
@ -53,18 +51,18 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.lang;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Test cases for the {@link NumberRange} class.
*
* @author <a href="mailto:chrise@esha.com">Christopher Elkins</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Revision: 1.3 $ $Date: 2002/11/07 16:59:44 $
* @version $Revision: 1.4 $ $Date: 2003/03/23 21:49:13 $
*/
public final class NumberRangeTest extends TestCase {

View File

@ -1,9 +1,7 @@
package org.apache.commons.lang;
/* ====================================================================
* 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
@ -53,6 +51,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.lang;
import java.lang.reflect.Method;
import java.math.BigDecimal;
@ -61,12 +60,13 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit tests {@link org.apache.commons.lang.NumberUtils}.
*
* @author <a href="mailto:rand_mcneely@yahoo.com">Rand McNeely</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: NumberUtilsTest.java,v 1.4 2002/12/15 16:53:28 scolebourne Exp $
* @version $Id: NumberUtilsTest.java,v 1.5 2003/03/23 21:49:13 scolebourne Exp $
*/
public class NumberUtilsTest extends TestCase {

View File

@ -1,9 +1,7 @@
package org.apache.commons.lang;
/* ====================================================================
* 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
@ -53,18 +51,20 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.lang;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
/**
* Unit tests {@link org.apache.commons.lang.ObjectUtils}.
*
* @author <a href="mailto:jmcnally@collab.net">John McNally</a>
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: ObjectUtilsTest.java,v 1.3 2002/09/18 20:12:15 scolebourne Exp $
* @version $Id: ObjectUtilsTest.java,v 1.4 2003/03/23 21:49:13 scolebourne Exp $
*/
public class ObjectUtilsTest extends TestCase {
private static final String FOO = "foo";

View File

@ -1,9 +1,7 @@
package org.apache.commons.lang;
/* ====================================================================
* 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
@ -18,21 +16,21 @@
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Commons" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@ -53,6 +51,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.lang;
import java.util.Random;
@ -63,7 +62,7 @@
*
* @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: RandomStringUtilsTest.java,v 1.3 2003/02/02 03:46:13 bayard Exp $
* @version $Id: RandomStringUtilsTest.java,v 1.4 2003/03/23 21:50:58 scolebourne Exp $
*/
public class RandomStringUtilsTest extends junit.framework.TestCase {
/**

View File

@ -1,9 +1,7 @@
package org.apache.commons.lang;
/* ====================================================================
* 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
@ -53,6 +51,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.commons.lang;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -70,7 +69,7 @@
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: SerializationUtilsTest.java,v 1.1 2002/07/19 03:35:55 bayard Exp $
* @version $Id: SerializationUtilsTest.java,v 1.2 2003/03/23 21:50:58 scolebourne Exp $
*/
public class SerializationUtilsTest extends TestCase {
private String iString;

View File

@ -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
@ -63,7 +63,7 @@
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: StringUtilsEqualsIndexOfTest.java,v 1.1 2002/07/19 03:35:55 bayard Exp $
* @version $Id: StringUtilsEqualsIndexOfTest.java,v 1.2 2003/03/23 21:50:58 scolebourne Exp $
*/
public class StringUtilsEqualsIndexOfTest extends TestCase {
private static final String FOO = "foo";

View File

@ -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
@ -62,7 +62,7 @@
* Unit tests {@link org.apache.commons.lang.StringUtils} - Substring methods
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @version $Id: StringUtilsIsTest.java,v 1.4 2002/12/15 16:54:23 scolebourne Exp $
* @version $Id: StringUtilsIsTest.java,v 1.5 2003/03/23 21:51:51 scolebourne Exp $
*/
public class StringUtilsIsTest extends TestCase {

View File

@ -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
@ -63,7 +63,7 @@
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: StringUtilsSubstringTest.java,v 1.2 2002/11/27 22:53:48 bayard Exp $
* @version $Id: StringUtilsSubstringTest.java,v 1.3 2003/03/23 21:51:19 scolebourne Exp $
*/
public class StringUtilsSubstringTest extends TestCase {
private static final String FOO = "foo";

View File

@ -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
@ -69,7 +69,7 @@
* @author <a href="mailto:fredrik@westermarck.com>Fredrik Westermarck</a>
* @author Holger Krauth
* @author <a href="hps@intermeta.de">Henning P. Schmiedehausen</a>
* @version $Id: StringUtilsTest.java,v 1.15 2003/03/23 05:26:23 bayard Exp $
* @version $Id: StringUtilsTest.java,v 1.16 2003/03/23 21:51:19 scolebourne Exp $
*/
public class StringUtilsTest extends TestCase {
@ -388,7 +388,32 @@ public void testGetLevenshteinDistance() {
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,24 +421,73 @@ public void testContainsOnly() {
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()
{
assertEquals("abbreviate(String,int) failed",

View File

@ -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
@ -63,7 +63,7 @@
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: StringUtilsTrimEmptyTest.java,v 1.5 2002/09/27 06:08:16 bayard Exp $
* @version $Id: StringUtilsTrimEmptyTest.java,v 1.6 2003/03/23 21:51:19 scolebourne Exp $
*/
public class StringUtilsTrimEmptyTest extends TestCase {
private static final String FOO = "foo";