You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Ringo De Smet <ri...@yahoo.co.uk> on 2002/07/08 09:06:43 UTC
[lang][patch] Added CharSetTests to LangTestSuite + unification of suite method
Hello,
Here is another patch for Commons.Lang. The CharSetTests are added to
the LangTestSuite and again I changed some implementations of the suite
method to have a commons structure. It seems that my previous patch was
not applied on all the classes I changed for the previous patch.
Ringo
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Re: [lang][patch] Added CharSetTests to LangTestSuite + unification of suite method
Posted by Stephen Colebourne <sc...@btopenworld.com>.
Patch applied, thanks.
----- Original Message -----
From: "Ringo De Smet" <ri...@yahoo.co.uk>
To: <co...@jakarta.apache.org>
Sent: Monday, July 08, 2002 8:06 AM
Subject: [lang][patch] Added CharSetTests to LangTestSuite + unification of
suite method
> Hello,
>
> Here is another patch for Commons.Lang. The CharSetTests are added to
> the LangTestSuite and again I changed some implementations of the suite
> method to have a commons structure. It seems that my previous patch was
> not applied on all the classes I changed for the previous patch.
>
> Ringo
>
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
----------------------------------------------------------------------------
----
> Index: src/test/org/apache/commons/lang/CharSetTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/CharSetTest.java,v
> retrieving revision 1.1
> diff -u -r1.1 CharSetTest.java
> --- src/test/org/apache/commons/lang/CharSetTest.java 5 Jul 2002
06:58:35 -0000 1.1
> +++ src/test/org/apache/commons/lang/CharSetTest.java 8 Jul 2002
07:00:21 -0000
> @@ -76,8 +76,10 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite() {
> - return new TestSuite(CharSetTest.class);
> + public static Test suite() {
> + TestSuite suite = new TestSuite(CharSetTest.class);
> + suite.setName("CharSet Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception {
> Index: src/test/org/apache/commons/lang/LangTestSuite.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/LangTestSuite.java,v
> retrieving revision 1.2
> diff -u -r1.2 LangTestSuite.java
> --- src/test/org/apache/commons/lang/LangTestSuite.java 4 Jul 2002
19:24:10 -0000 1.2
> +++ src/test/org/apache/commons/lang/LangTestSuite.java 8 Jul 2002
07:00:16 -0000
> @@ -84,6 +84,8 @@
> */
> public static Test suite() {
> TestSuite suite = new TestSuite();
> + suite.setName("Commons-Lang Tests");
> + suite.addTest(CharSetTest.suite());
> suite.addTest(NumberRangeTest.suite());
> suite.addTest(NumbersTest.suite());
> suite.addTest(ObjectsTest.suite());
> Index: src/test/org/apache/commons/lang/NumberRangeTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/NumberRangeTest.java,v
> retrieving revision 1.2
> diff -u -r1.2 NumberRangeTest.java
> --- src/test/org/apache/commons/lang/NumberRangeTest.java 5 Jul 2002
07:03:39 -0000 1.2
> +++ src/test/org/apache/commons/lang/NumberRangeTest.java 8 Jul 2002
07:00:16 -0000
> @@ -94,11 +94,8 @@
>
>
> public static Test suite() {
> - TestSuite suite = new TestSuite();
> - suite.addTest(new NumberRangeTest("testEquals"));
> - suite.addTest(new NumberRangeTest("testIncludesNumber"));
> - suite.addTest(new NumberRangeTest("testIncludesRange"));
> - suite.addTest(new NumberRangeTest("testToString"));
> + TestSuite suite = new TestSuite(NumberRangeTest.class);
> + suite.setName("NumberRange Tests");
> return suite;
> }
>
> Index: src/test/org/apache/commons/lang/NumbersTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/NumbersTest.java,v
> retrieving revision 1.3
> diff -u -r1.3 NumbersTest.java
> --- src/test/org/apache/commons/lang/NumbersTest.java 5 Jul 2002
07:03:39 -0000 1.3
> +++ src/test/org/apache/commons/lang/NumbersTest.java 8 Jul 2002
07:00:20 -0000
> @@ -93,13 +93,8 @@
> }
>
> public static Test suite() {
> - TestSuite suite = new TestSuite();
> - Method m[] = NumbersTest.class.getDeclaredMethods();
> - for (int i = 0; i < m.length; i++) {
> - if (m[i].getName().startsWith("test")) {
> - suite.addTest(new NumbersTest(m[i].getName()));
> - }
> - }
> + TestSuite suite = new TestSuite(NumbersTest.class);
> + suite.setName("Numbers Tests");
> return suite;
> }
>
> Index: src/test/org/apache/commons/lang/ObjectsTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/ObjectsTest.java,v
> retrieving revision 1.5
> diff -u -r1.5 ObjectsTest.java
> --- src/test/org/apache/commons/lang/ObjectsTest.java 5 Jul 2002
07:03:39 -0000 1.5
> +++ src/test/org/apache/commons/lang/ObjectsTest.java 8 Jul 2002
07:00:21 -0000
> @@ -54,6 +54,7 @@
> * <http://www.apache.org/>.
> */
>
> +import junit.framework.Test;
> import junit.framework.TestCase;
> import junit.framework.TestSuite;
> import junit.textui.TestRunner;
> @@ -78,9 +79,11 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite()
> + public static Test suite()
> {
> - return new TestSuite(ObjectsTest.class);
> + TestSuite suite = new TestSuite(ObjectsTest.class);
> + suite.setName("Objects Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception
> Index: src/test/org/apache/commons/lang/RandomStringsTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/RandomStringsTest.java,v
> retrieving revision 1.1
> diff -u -r1.1 RandomStringsTest.java
> --- src/test/org/apache/commons/lang/RandomStringsTest.java 2 Jul 2002
00:18:46 -0000 1.1
> +++ src/test/org/apache/commons/lang/RandomStringsTest.java 8 Jul 2002
07:00:19 -0000
> @@ -71,7 +71,9 @@
> }
>
> public static Test suite() {
> - return new TestSuite(RandomStringsTest.class);
> + TestSuite suite = new TestSuite(RandomStringsTest.class);
> + suite.setName("RandomStrings Tests");
> + return suite;
> }
>
> /**
> Index: src/test/org/apache/commons/lang/SerializationTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/SerializationTest.java,v
> retrieving revision 1.2
> diff -u -r1.2 SerializationTest.java
> --- src/test/org/apache/commons/lang/SerializationTest.java 5 Jul 2002
07:03:39 -0000 1.2
> +++ src/test/org/apache/commons/lang/SerializationTest.java 8 Jul 2002
07:00:17 -0000
> @@ -83,8 +83,10 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite() {
> - return new TestSuite(SerializationTest.class);
> + public static Test suite() {
> + TestSuite suite = new TestSuite(SerializationTest.class);
> + suite.setName("Serialization Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception {
> Index: src/test/org/apache/commons/lang/StringsEqualsIndexOfTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/StringsEqualsIndexOfTest.java,v
> retrieving revision 1.1
> diff -u -r1.1 StringsEqualsIndexOfTest.java
> --- src/test/org/apache/commons/lang/StringsEqualsIndexOfTest.java 2 Jul
2002 22:03:29 -0000 1.1
> +++ src/test/org/apache/commons/lang/StringsEqualsIndexOfTest.java 8 Jul
2002 07:00:18 -0000
> @@ -53,9 +53,11 @@
> */
> 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.Strings} - Substring methods
> *
> @@ -76,8 +78,10 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite() {
> - return new TestSuite(StringsEqualsIndexOfTest.class);
> + public static Test suite() {
> + TestSuite suite = new TestSuite(StringsEqualsIndexOfTest.class);
> + suite.setName("StringsEqualsIndexOf Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception {
> Index: src/test/org/apache/commons/lang/StringsSubstringTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/StringsSubstringTest.java,v
> retrieving revision 1.1
> diff -u -r1.1 StringsSubstringTest.java
> --- src/test/org/apache/commons/lang/StringsSubstringTest.java 2 Jul 2002
22:03:29 -0000 1.1
> +++ src/test/org/apache/commons/lang/StringsSubstringTest.java 8 Jul 2002
07:00:18 -0000
> @@ -53,9 +53,11 @@
> */
> 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.Strings} - Substring methods
> *
> @@ -77,8 +79,10 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite() {
> - return new TestSuite(StringsSubstringTest.class);
> + public static Test suite() {
> + TestSuite suite = new TestSuite(StringsSubstringTest.class);
> + suite.setName("StringsSubstring Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception {
> Index: src/test/org/apache/commons/lang/StringsTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/StringsTest.java,v
> retrieving revision 1.8
> diff -u -r1.8 StringsTest.java
> --- src/test/org/apache/commons/lang/StringsTest.java 5 Jul 2002
18:54:26 -0000 1.8
> +++ src/test/org/apache/commons/lang/StringsTest.java 8 Jul 2002
07:00:21 -0000
> @@ -90,8 +90,10 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite() {
> - return new TestSuite(StringsTest.class);
> + public static Test suite() {
> + TestSuite suite = new TestSuite(StringsTest.class);
> + suite.setName("StringsTest Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception {
> Index: src/test/org/apache/commons/lang/StringsTrimEmptyTest.java
> ===================================================================
> RCS file:
/home/cvspublic/jakarta-commons-sandbox/lang/src/test/org/apache/commons/lan
g/StringsTrimEmptyTest.java,v
> retrieving revision 1.1
> diff -u -r1.1 StringsTrimEmptyTest.java
> --- src/test/org/apache/commons/lang/StringsTrimEmptyTest.java 2 Jul 2002
22:03:29 -0000 1.1
> +++ src/test/org/apache/commons/lang/StringsTrimEmptyTest.java 8 Jul 2002
07:00:19 -0000
> @@ -53,9 +53,11 @@
> */
> 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.Strings} - Trim/Empty
methods
> *
> @@ -73,8 +75,10 @@
> TestRunner.run(suite());
> }
>
> - public static TestSuite suite() {
> - return new TestSuite(StringsTrimEmptyTest.class);
> + public static Test suite() {
> + TestSuite suite = new TestSuite(StringsTrimEmptyTest.class);
> + suite.setName("StringsTrimEmpty Tests");
> + return suite;
> }
>
> protected void setUp() throws Exception {
>
>
----------------------------------------------------------------------------
----
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>