Made the TestCases for primitive lists extend TestList,

so the full suite of List tests is performed on them.
Used BulkTest.makeSuite to pick up the sublist tests.

There should probably be additional work for testing the
primitive operations.

Submitted by: Paul Jack ( pjack at sfaf dot org )


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130735 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Smith 2002-06-21 04:01:31 +00:00
parent c3a859c1ce
commit 9752389b61
10 changed files with 255 additions and 51 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/primitives/Attic/TestAbstractIntArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractIntArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -68,10 +68,10 @@ import org.apache.commons.collections.TestList;
import java.util.List;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public abstract class TestAbstractIntArrayList extends /* TestList */ TestCase {
public abstract class TestAbstractIntArrayList extends TestList {
//------------------------------------------------------------ Conventional
@ -130,5 +130,56 @@ public abstract class TestAbstractIntArrayList extends /* TestList */ TestCase {
assertEquals("Should get entry back", i, list.getInt(i));
}
}
/**
* Returns small Integer objects for testing.
*/
protected Object[] getFullElements() {
Integer[] result = new Integer[19];
for (int i = 0; i < result.length; i++) {
result[i] = new Integer(i + 19);
}
return result;
}
/**
* Returns small Integer objects for testing.
*/
protected Object[] getOtherElements() {
Integer[] result = new Integer[16];
for (int i = 0; i < result.length; i++) {
result[i] = new Integer(i + 48);
}
return result;
}
// TODO: Create canonical collections in CVS
public void testCanonicalEmptyCollectionExists() {
}
public void testCanonicalFullCollectionExists() {
}
public void testEmptyListCompatibility() {
}
public void testFullListCompatibility() {
}
// TODO: Fix primitive lists to be fail fast
public void testCollectionIteratorFailFast() {
}
public void testListSubListFailFastOnAdd() {
}
public void testListSubListFailFastOnRemove() {
}
}

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/primitives/Attic/TestAbstractLongArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractLongArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -68,10 +68,10 @@ import org.apache.commons.collections.TestList;
import java.util.List;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public abstract class TestAbstractLongArrayList extends /* TestList */ TestCase {
public abstract class TestAbstractLongArrayList extends TestList {
//------------------------------------------------------------ Conventional
@ -115,5 +115,57 @@ public abstract class TestAbstractLongArrayList extends /* TestList */ TestCase
}
}
/**
* Returns an array of Long objects for testing.
*/
protected Object[] getFullElements() {
Long[] result = new Long[19];
for (int i = 0; i < result.length; i++) {
result[i] = new Long(i + 19);
}
return result;
}
/**
* Returns an array of Long objects for testing.
*/
protected Object[] getOtherElements() {
Long[] result = new Long[16];
for (int i = 0; i < result.length; i++) {
result[i] = new Long(i + 48);
}
return result;
}
// TODO: Create canonical primitive lists in CVS
public void testCanonicalEmptyCollectionExists() {
}
public void testCanonicalFullCollectionExists() {
}
public void testEmptyListCompatibility() {
}
public void testFullListCompatibility() {
}
// TODO: Make primitive lists fail-fast
public void testCollectionIteratorFailFast() {
}
public void testListSubListFailFastOnAdd() {
}
public void testListSubListFailFastOnRemove() {
}
}

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/primitives/Attic/TestAbstractShortArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestAbstractShortArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -68,10 +68,10 @@ import org.apache.commons.collections.TestList;
import java.util.List;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public abstract class TestAbstractShortArrayList extends /* TestList */ TestCase {
public abstract class TestAbstractShortArrayList extends TestList {
//------------------------------------------------------------ Conventional
@ -110,5 +110,58 @@ public abstract class TestAbstractShortArrayList extends /* TestList */ TestCase
assertEquals((short)(i+128),list.getShort(i));
}
}
/**
* Returns an array of Short objects for testing.
*/
protected Object[] getFullElements() {
Short[] result = new Short[19];
for (int i = 0; i < result.length; i++) {
result[i] = new Short((short)(i + 19));
}
return result;
}
/**
* Returns an array of Short objects for testing.
*/
protected Object[] getOtherElements() {
Short[] result = new Short[16];
for (int i = 0; i < result.length; i++) {
result[i] = new Short((short)(i + 48));
}
return result;
}
// TODO: Create canonical primitive lists in CVS
public void testCanonicalEmptyCollectionExists() {
}
public void testCanonicalFullCollectionExists() {
}
public void testEmptyListCompatibility() {
}
public void testFullListCompatibility() {
}
// TODO: Make primitive lists fail fast
public void testCollectionIteratorFailFast() {
}
public void testListSubListFailFastOnAdd() {
}
public void testListSubListFailFastOnRemove() {
}
}

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/primitives/Attic/TestFloatArrayList.java,v 1.1 2002/06/04 16:50:09 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:50:09 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestFloatArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -68,10 +68,10 @@ import org.apache.commons.collections.TestList;
import java.util.List;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:50:09 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestFloatArrayList extends /* TestList */ TestCase {
public class TestFloatArrayList extends TestList {
//------------------------------------------------------------ Conventional
@ -80,7 +80,7 @@ public class TestFloatArrayList extends /* TestList */ TestCase {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestFloatArrayList.class);
TestSuite suite = TestList.makeSuite(TestFloatArrayList.class);
return suite;
}
@ -107,5 +107,47 @@ public class TestFloatArrayList extends /* TestList */ TestCase {
assertEquals((float)i,list.getFloat(i),Float.MAX_VALUE);
}
}
protected Object[] getFullElements() {
Float[] result = new Float[19];
for (int i = 0; i < result.length; i++) {
result[i] = new Float((float)(i + 19));
}
return result;
}
protected Object[] getOtherElements() {
Float[] result = new Float[16];
for (int i = 0; i < result.length; i++) {
result[i] = new Float((float)(i + 48));
}
return result;
}
public void testCanonicalEmptyCollectionExists() {
}
public void testCanonicalFullCollectionExists() {
}
public void testEmptyListCompatibility() {
}
public void testFullListCompatibility() {
}
public void testCollectionIteratorFailFast() {
}
public void testListSubListFailFastOnAdd() {
}
public void testListSubListFailFastOnRemove() {
}
}

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/primitives/Attic/TestIntArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestIntArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -64,9 +64,10 @@ package org.apache.commons.collections.primitives;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.collections.BulkTest;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestIntArrayList extends TestAbstractIntArrayList {
@ -78,7 +79,7 @@ public class TestIntArrayList extends TestAbstractIntArrayList {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestIntArrayList.class);
TestSuite suite = BulkTest.makeSuite(TestIntArrayList.class);
return suite;
}

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/primitives/Attic/TestLongArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestLongArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -64,9 +64,10 @@ package org.apache.commons.collections.primitives;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.collections.BulkTest;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestLongArrayList extends TestAbstractLongArrayList {
@ -78,7 +79,7 @@ public class TestLongArrayList extends TestAbstractLongArrayList {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestLongArrayList.class);
TestSuite suite = BulkTest.makeSuite(TestLongArrayList.class);
return suite;
}

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/primitives/Attic/TestShortArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestShortArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -64,9 +64,10 @@ package org.apache.commons.collections.primitives;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.collections.BulkTest;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestShortArrayList extends TestAbstractShortArrayList {
@ -78,7 +79,7 @@ public class TestShortArrayList extends TestAbstractShortArrayList {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestShortArrayList.class);
TestSuite suite = BulkTest.makeSuite(TestShortArrayList.class);
return suite;
}

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/primitives/Attic/TestUnsignedByteArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedByteArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -64,9 +64,10 @@ package org.apache.commons.collections.primitives;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.collections.BulkTest;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestUnsignedByteArrayList extends TestAbstractShortArrayList {
@ -78,7 +79,7 @@ public class TestUnsignedByteArrayList extends TestAbstractShortArrayList {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestUnsignedByteArrayList.class);
TestSuite suite = BulkTest.makeSuite(TestUnsignedByteArrayList.class);
return suite;
}

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/primitives/Attic/TestUnsignedIntArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedIntArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -64,9 +64,10 @@ package org.apache.commons.collections.primitives;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.collections.BulkTest;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestUnsignedIntArrayList extends TestAbstractLongArrayList {
@ -78,7 +79,7 @@ public class TestUnsignedIntArrayList extends TestAbstractLongArrayList {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestUnsignedIntArrayList.class);
TestSuite suite = BulkTest.makeSuite(TestUnsignedIntArrayList.class);
return suite;
}

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/primitives/Attic/TestUnsignedShortArrayList.java,v 1.1 2002/06/04 16:01:28 rwaldhoff Exp $
* $Revision: 1.1 $
* $Date: 2002/06/04 16:01:28 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedShortArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $
* $Revision: 1.2 $
* $Date: 2002/06/21 04:01:31 $
*
* ====================================================================
*
@ -64,9 +64,10 @@ package org.apache.commons.collections.primitives;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.commons.collections.BulkTest;
/**
* @version $Revision: 1.1 $ $Date: 2002/06/04 16:01:28 $
* @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $
* @author Rodney Waldhoff
*/
public class TestUnsignedShortArrayList extends TestAbstractIntArrayList {
@ -78,7 +79,7 @@ public class TestUnsignedShortArrayList extends TestAbstractIntArrayList {
}
public static Test suite() {
TestSuite suite = new TestSuite(TestUnsignedShortArrayList.class);
TestSuite suite = BulkTest.makeSuite(TestUnsignedShortArrayList.class);
return suite;
}