changed the makeList() method to makeEmptyList()

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130581 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Morgan James Delagrange 2002-02-25 23:51:24 +00:00
parent 9e1b45941d
commit 2f293634b9
3 changed files with 39 additions and 39 deletions

View File

@ -1,7 +1,7 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestArrayList.java,v 1.2 2001/07/14 23:33:26 craigmcc Exp $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestArrayList.java,v 1.3 2002/02/25 23:51:24 morgand Exp $
* $Revision: 1.2 $ * $Revision: 1.3 $
* $Date: 2001/07/14 23:33:26 $ * $Date: 2002/02/25 23:51:24 $
* *
* ==================================================================== * ====================================================================
* *
@ -69,7 +69,7 @@ import java.util.List;
/** /**
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a> * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @version $Id: TestArrayList.java,v 1.2 2001/07/14 23:33:26 craigmcc Exp $ * @version $Id: TestArrayList.java,v 1.3 2002/02/25 23:51:24 morgand Exp $
*/ */
public class TestArrayList extends TestList public class TestArrayList extends TestList
{ {
@ -93,10 +93,10 @@ public class TestArrayList extends TestList
public void setUp() public void setUp()
{ {
list = (ArrayList) makeList(); list = (ArrayList) makeEmptyList();
} }
public List makeList() public List makeEmptyList()
{ {
ArrayList al = new ArrayList(); ArrayList al = new ArrayList();
return (al); return (al);

View File

@ -1,7 +1,7 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestCursorableLinkedList.java,v 1.3 2001/07/14 23:33:27 craigmcc Exp $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestCursorableLinkedList.java,v 1.4 2002/02/25 23:51:24 morgand Exp $
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Date: 2001/07/14 23:33:27 $ * $Date: 2002/02/25 23:51:24 $
* *
* ==================================================================== * ====================================================================
* *
@ -66,7 +66,7 @@ import java.util.*;
/** /**
* @author Rodney Waldhoff * @author Rodney Waldhoff
* @version $Id: TestCursorableLinkedList.java,v 1.3 2001/07/14 23:33:27 craigmcc Exp $ * @version $Id: TestCursorableLinkedList.java,v 1.4 2002/02/25 23:51:24 morgand Exp $
*/ */
public class TestCursorableLinkedList extends TestList { public class TestCursorableLinkedList extends TestList {
public TestCursorableLinkedList(String testName) { public TestCursorableLinkedList(String testName) {
@ -88,7 +88,7 @@ public class TestCursorableLinkedList extends TestList {
list = new CursorableLinkedList(); list = new CursorableLinkedList();
} }
public List makeList() { public List makeEmptyList() {
return new CursorableLinkedList(); return new CursorableLinkedList();
} }

View File

@ -1,7 +1,7 @@
/* /*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestList.java,v 1.5 2001/07/14 23:33:27 craigmcc Exp $ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestList.java,v 1.6 2002/02/25 23:51:24 morgand Exp $
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Date: 2001/07/14 23:33:27 $ * $Date: 2002/02/25 23:51:24 $
* *
* ==================================================================== * ====================================================================
* *
@ -80,7 +80,7 @@ import java.util.ListIterator;
* test case (method) your {@link List} fails. * test case (method) your {@link List} fails.
* *
* @author Rodney Waldhoff * @author Rodney Waldhoff
* @version $Id: TestList.java,v 1.5 2001/07/14 23:33:27 craigmcc Exp $ * @version $Id: TestList.java,v 1.6 2002/02/25 23:51:24 morgand Exp $
*/ */
public abstract class TestList extends TestCollection { public abstract class TestList extends TestCollection {
public TestList(String testName) { public TestList(String testName) {
@ -90,14 +90,14 @@ public abstract class TestList extends TestCollection {
/** /**
* Return a new, empty {@link List} to used for testing. * Return a new, empty {@link List} to used for testing.
*/ */
public abstract List makeList(); public abstract List makeEmptyList();
public Collection makeCollection() { public Collection makeCollection() {
return makeList(); return makeEmptyList();
} }
public void testListAddByIndexBoundsChecking() { public void testListAddByIndexBoundsChecking() {
List list = makeList(); List list = makeEmptyList();
try { try {
list.add(Integer.MIN_VALUE,"element"); list.add(Integer.MIN_VALUE,"element");
@ -153,7 +153,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListAddByIndexBoundsChecking2() { public void testListAddByIndexBoundsChecking2() {
List list = makeList(); List list = makeEmptyList();
boolean added = tryToAdd(list,"element"); boolean added = tryToAdd(list,"element");
try { try {
@ -184,7 +184,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListAddByIndex() { public void testListAddByIndex() {
List list = makeList(); List list = makeEmptyList();
assertEquals(0,list.size()); assertEquals(0,list.size());
if(tryToAdd(list,0,"element2")) { if(tryToAdd(list,0,"element2")) {
assertEquals(1,list.size()); assertEquals(1,list.size());
@ -201,7 +201,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListAdd() { public void testListAdd() {
List list = makeList(); List list = makeEmptyList();
if(tryToAdd(list,"1")) { if(tryToAdd(list,"1")) {
assertTrue(list.contains("1")); assertTrue(list.contains("1"));
if(tryToAdd(list,"2")) { if(tryToAdd(list,"2")) {
@ -223,7 +223,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListEqualsSelf() { public void testListEqualsSelf() {
List list = makeList(); List list = makeEmptyList();
assertTrue(list.equals(list)); assertTrue(list.equals(list));
tryToAdd(list,"elt"); tryToAdd(list,"elt");
assertTrue(list.equals(list)); assertTrue(list.equals(list));
@ -232,7 +232,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListEqualsArrayList() { public void testListEqualsArrayList() {
List list1 = makeList(); List list1 = makeEmptyList();
List list2 = new ArrayList(); List list2 = new ArrayList();
assertTrue(list1.equals(list2)); assertTrue(list1.equals(list2));
assertEquals(list1.hashCode(),list2.hashCode()); assertEquals(list1.hashCode(),list2.hashCode());
@ -252,8 +252,8 @@ public abstract class TestList extends TestCollection {
} }
public void testListEquals() { public void testListEquals() {
List list1 = makeList(); List list1 = makeEmptyList();
List list2 = makeList(); List list2 = makeEmptyList();
assertTrue(list1.equals(list2)); assertTrue(list1.equals(list2));
if(tryToAdd(list1,"a") && tryToAdd(list2,"a")) { if(tryToAdd(list1,"a") && tryToAdd(list2,"a")) {
assertTrue(list1.equals(list2)); assertTrue(list1.equals(list2));
@ -270,7 +270,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListGetByIndex() { public void testListGetByIndex() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"a"); tryToAdd(list,"a");
tryToAdd(list,"b"); tryToAdd(list,"b");
tryToAdd(list,"c"); tryToAdd(list,"c");
@ -284,7 +284,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListGetByIndexBoundsChecking() { public void testListGetByIndexBoundsChecking() {
List list = makeList(); List list = makeEmptyList();
try { try {
list.get(Integer.MIN_VALUE); list.get(Integer.MIN_VALUE);
@ -323,7 +323,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListGetByIndexBoundsChecking2() { public void testListGetByIndexBoundsChecking2() {
List list = makeList(); List list = makeEmptyList();
boolean added = tryToAdd(list,"a"); boolean added = tryToAdd(list,"a");
try { try {
@ -356,7 +356,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListIndexOf() { public void testListIndexOf() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"a"); tryToAdd(list,"a");
tryToAdd(list,"b"); tryToAdd(list,"b");
tryToAdd(list,"c"); tryToAdd(list,"c");
@ -371,7 +371,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListLastIndexOf1() { public void testListLastIndexOf1() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"a"); tryToAdd(list,"a");
tryToAdd(list,"b"); tryToAdd(list,"b");
tryToAdd(list,"c"); tryToAdd(list,"c");
@ -386,7 +386,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListLastIndexOf2() { public void testListLastIndexOf2() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"a"); tryToAdd(list,"a");
tryToAdd(list,"b"); tryToAdd(list,"b");
tryToAdd(list,"c"); tryToAdd(list,"c");
@ -434,7 +434,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListSetByIndexBoundsChecking() { public void testListSetByIndexBoundsChecking() {
List list = makeList(); List list = makeEmptyList();
try { try {
list.set(Integer.MIN_VALUE,"a"); list.set(Integer.MIN_VALUE,"a");
@ -503,7 +503,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListSetByIndexBoundsChecking2() { public void testListSetByIndexBoundsChecking2() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element"); tryToAdd(list,"element");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
@ -561,7 +561,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListSetByIndex() { public void testListSetByIndex() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element"); tryToAdd(list,"element");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
tryToAdd(list,"element3"); tryToAdd(list,"element3");
@ -586,7 +586,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListRemoveByIndex() { public void testListRemoveByIndex() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element"); tryToAdd(list,"element");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
tryToAdd(list,"element3"); tryToAdd(list,"element3");
@ -615,7 +615,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListRemoveByValue() { public void testListRemoveByValue() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element1"); tryToAdd(list,"element1");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
tryToAdd(list,"element3"); tryToAdd(list,"element3");
@ -637,7 +637,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListListIteratorNextPrev() { public void testListListIteratorNextPrev() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element1"); tryToAdd(list,"element1");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
tryToAdd(list,"element3"); tryToAdd(list,"element3");
@ -667,7 +667,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListListIteratorNextIndexPrevIndex() { public void testListListIteratorNextIndexPrevIndex() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element1"); tryToAdd(list,"element1");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
tryToAdd(list,"element3"); tryToAdd(list,"element3");
@ -689,7 +689,7 @@ public abstract class TestList extends TestCollection {
} }
public void testListListIteratorSet() { public void testListListIteratorSet() {
List list = makeList(); List list = makeEmptyList();
tryToAdd(list,"element1"); tryToAdd(list,"element1");
tryToAdd(list,"element2"); tryToAdd(list,"element2");
tryToAdd(list,"element3"); tryToAdd(list,"element3");