Java Doc for AbstractTestList.java in  » Library » Apache-common-Collections » org » apache » commons » collections » list » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common Collections » org.apache.commons.collections.list 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.commons.collections.collection.AbstractTestCollection
   org.apache.commons.collections.list.AbstractTestList

All known Subclasses:   org.apache.commons.collections.list.TestTypedList,  org.apache.commons.collections.list.TestPredicatedList,  org.apache.commons.collections.list.TestTreeList,  org.apache.commons.collections.TestArrayList,  org.apache.commons.collections.list.TestTransformedList,  org.apache.commons.collections.list.TestSetUniqueList,  org.apache.commons.collections.list.TestSynchronizedList,  org.apache.commons.collections.list.TestFixedSizeList,  org.apache.commons.collections.TestLinkedList,  org.apache.commons.collections.list.TestUnmodifiableList,  org.apache.commons.collections.list.TestGrowthList,  org.apache.commons.collections.TestCursorableLinkedList,  org.apache.commons.collections.list.TestAbstractLinkedList,
AbstractTestList
abstract public class AbstractTestList extends AbstractTestCollection (Code)
Abstract test class for java.util.List methods and contracts.

To use, simply extend this class, and implement the AbstractTestList.makeEmptyList method.

If your List fails one of these tests by design, you may still use this base set of cases. Simply override the test case (method) your List fails or override one of the protected methods from AbstractTestCollection.
version:
   $Revision: 224666 $ $Date: 2005-07-25 00:01:40 +0100 (Mon, 25 Jul 2005) $
author:
   Rodney Waldhoff
author:
   Paul Jack
author:
   Stephen Colebourne
author:
   Neil O'Toole


Inner Class :public static class BulkTestSubList extends AbstractTestList
Inner Class :public class TestListIterator extends AbstractTestListIterator


Constructor Summary
public  AbstractTestList(String testName)
     JUnit constructor.

Method Summary
public  BulkTestbulkTestListIterator()
    
public  BulkTestbulkTestSubList()
     Returns a BulkTest for testing List.subList(intint) .
protected  voidfailFastAll(List list)
     Invokes all the methods on the given sublist to make sure they raise a java.util.ConcurrentModificationException ConcurrentModificationException .
protected  voidfailFastMethod(List list, Method m)
     Invokes the given method on the given sublist to make sure it raises a java.util.ConcurrentModificationException ConcurrentModificationException . Unless the method happens to be the equals() method, in which case the test is skipped.
public  ListgetConfirmedList()
     Returns the AbstractTestList.confirmed field cast to a List .
public  ListgetList()
     Returns the AbstractTestList.collection field cast to a List .
public  booleanisEqualsCheckable()
     List equals method is defined.
public  booleanisSetSupported()
     Returns true if the collections produced by AbstractTestList.makeCollection() and AbstractTestList.makeFullCollection() support the set operation.

Default implementation returns true.

final public  CollectionmakeCollection()
     Returns AbstractTestList.makeEmptyList() .
public  CollectionmakeConfirmedCollection()
     Returns an empty ArrayList .
public  CollectionmakeConfirmedFullCollection()
     Returns a full ArrayList .
abstract public  ListmakeEmptyList()
     Return a new, empty List to be used for testing.
final public  CollectionmakeFullCollection()
     Returns AbstractTestList.makeFullList() .
public  ListmakeFullList()
     Return a new, full List to be used for testing.
public  voidtestEmptyListCompatibility()
     Compare the current serialized form of the List against the canonical version in CVS.
public  voidtestEmptyListSerialization()
    
public  voidtestFullListCompatibility()
     Compare the current serialized form of the List against the canonical version in CVS.
public  voidtestFullListSerialization()
    
public  voidtestListAddByIndex()
     Tests List.add(intObject) .
public  voidtestListAddByIndexBoundsChecking()
     Tests bounds checking for List.add(intObject) on an empty list.
public  voidtestListAddByIndexBoundsChecking2()
     Tests bounds checking for List.add(intObject) on a full list.
public  voidtestListEquals()
     Tests List.equals(Object) .
public  voidtestListGetByIndex()
     Tests List.get(int) .
public  voidtestListGetByIndexBoundsChecking()
     Tests bounds checking for List.get(int) on an empty list.
public  voidtestListGetByIndexBoundsChecking2()
     Tests bounds checking for List.get(int) on a full list.
public  voidtestListHashCode()
     Tests List.hashCode .
public  voidtestListIndexOf()
     Tests List.indexOf .
public  voidtestListIteratorAdd()
     Tests the ListIterator.add(Object) method of the list iterator.
public  voidtestListIteratorSet()
     Tests the ListIterator.set(Object) method of the list iterator.
public  voidtestListLastIndexOf()
     Tests List.lastIndexOf .
public  voidtestListListIterator()
     Tests the read-only bits of List.listIterator .
public  voidtestListListIteratorByIndex()
     Tests the read-only bits of List.listIterator(int) .
public  voidtestListListIteratorNextRemoveNext()
     Tests remove on list iterator is correct.
public  voidtestListListIteratorNextRemovePrevious()
     Tests remove on list iterator is correct.
public  voidtestListListIteratorPreviousRemoveNext()
     Tests remove on list iterator is correct.
public  voidtestListListIteratorPreviousRemovePrevious()
     Tests remove on list iterator is correct.
public  voidtestListRemoveByIndex()
     Tests List.remove(int) .
public  voidtestListRemoveByIndexBoundsChecking()
     Tests bounds checking for List.remove(int) on an empty list.
public  voidtestListRemoveByIndexBoundsChecking2()
     Tests bounds checking for List.remove(int) on a full list.
public  voidtestListSetByIndex()
     Test List.set(intObject) .
public  voidtestListSetByIndexBoundsChecking()
     Tests bounds checking for List.set(intObject) on an empty list.
public  voidtestListSetByIndexBoundsChecking2()
     Tests bounds checking for List.set(intObject) on a full list.
public  voidtestListSubListFailFastOnAdd()
     Tests that a sublist raises a java.util.ConcurrentModificationException ConcurrentModificationException if elements are added to the original list.
public  voidtestListSubListFailFastOnRemove()
     Tests that a sublist raises a java.util.ConcurrentModificationException ConcurrentModificationException if elements are removed from the original list.
public  voidtestUnsupportedSet()
     If AbstractTestList.isSetSupported() returns false, tests that set operation raises UnsupportedOperationException.
public  voidverify()
     Verifies that the test list implementation matches the confirmed list implementation.


Constructor Detail
AbstractTestList
public AbstractTestList(String testName)(Code)
JUnit constructor.
Parameters:
  testName - the test class name




Method Detail
bulkTestListIterator
public BulkTest bulkTestListIterator()(Code)



bulkTestSubList
public BulkTest bulkTestSubList()(Code)
Returns a BulkTest for testing List.subList(intint) . The returned bulk test will run through every TestList method, including another bulkTestSubList. Sublists are tested until the size of the sublist is less than 10. Each sublist is 6 elements smaller than its parent list. (By default this means that two rounds of sublists will be tested). The verify() method is overloaded to test that the original list is modified when the sublist is.



failFastAll
protected void failFastAll(List list)(Code)
Invokes all the methods on the given sublist to make sure they raise a java.util.ConcurrentModificationException ConcurrentModificationException .



failFastMethod
protected void failFastMethod(List list, Method m)(Code)
Invokes the given method on the given sublist to make sure it raises a java.util.ConcurrentModificationException ConcurrentModificationException . Unless the method happens to be the equals() method, in which case the test is skipped. There seems to be a bug in java.util.AbstractList.subList(int,int).equals(Object) -- it never raises a ConcurrentModificationException.
Parameters:
  list - the sublist to test
Parameters:
  m - the method to invoke



getConfirmedList
public List getConfirmedList()(Code)
Returns the AbstractTestList.confirmed field cast to a List . the confirmed field as a List



getList
public List getList()(Code)
Returns the AbstractTestList.collection field cast to a List . the collection field as a List



isEqualsCheckable
public boolean isEqualsCheckable()(Code)
List equals method is defined.



isSetSupported
public boolean isSetSupported()(Code)
Returns true if the collections produced by AbstractTestList.makeCollection() and AbstractTestList.makeFullCollection() support the set operation.

Default implementation returns true. Override if your collection class does not support set.




makeCollection
final public Collection makeCollection()(Code)
Returns AbstractTestList.makeEmptyList() . an empty list to be used for testing



makeConfirmedCollection
public Collection makeConfirmedCollection()(Code)
Returns an empty ArrayList .



makeConfirmedFullCollection
public Collection makeConfirmedFullCollection()(Code)
Returns a full ArrayList .



makeEmptyList
abstract public List makeEmptyList()(Code)
Return a new, empty List to be used for testing. an empty list for testing.



makeFullCollection
final public Collection makeFullCollection()(Code)
Returns AbstractTestList.makeFullList() . a full list to be used for testing



makeFullList
public List makeFullList()(Code)
Return a new, full List to be used for testing. a full list for testing



testEmptyListCompatibility
public void testEmptyListCompatibility() throws IOException, ClassNotFoundException(Code)
Compare the current serialized form of the List against the canonical version in CVS.



testEmptyListSerialization
public void testEmptyListSerialization() throws IOException, ClassNotFoundException(Code)



testFullListCompatibility
public void testFullListCompatibility() throws IOException, ClassNotFoundException(Code)
Compare the current serialized form of the List against the canonical version in CVS.



testFullListSerialization
public void testFullListSerialization() throws IOException, ClassNotFoundException(Code)



testListAddByIndex
public void testListAddByIndex()(Code)
Tests List.add(intObject) .



testListAddByIndexBoundsChecking
public void testListAddByIndexBoundsChecking()(Code)
Tests bounds checking for List.add(intObject) on an empty list.



testListAddByIndexBoundsChecking2
public void testListAddByIndexBoundsChecking2()(Code)
Tests bounds checking for List.add(intObject) on a full list.



testListEquals
public void testListEquals()(Code)
Tests List.equals(Object) .



testListGetByIndex
public void testListGetByIndex()(Code)
Tests List.get(int) .



testListGetByIndexBoundsChecking
public void testListGetByIndexBoundsChecking()(Code)
Tests bounds checking for List.get(int) on an empty list.



testListGetByIndexBoundsChecking2
public void testListGetByIndexBoundsChecking2()(Code)
Tests bounds checking for List.get(int) on a full list.



testListHashCode
public void testListHashCode()(Code)
Tests List.hashCode .



testListIndexOf
public void testListIndexOf()(Code)
Tests List.indexOf .



testListIteratorAdd
public void testListIteratorAdd()(Code)
Tests the ListIterator.add(Object) method of the list iterator.



testListIteratorSet
public void testListIteratorSet()(Code)
Tests the ListIterator.set(Object) method of the list iterator.



testListLastIndexOf
public void testListLastIndexOf()(Code)
Tests List.lastIndexOf .



testListListIterator
public void testListListIterator()(Code)
Tests the read-only bits of List.listIterator .



testListListIteratorByIndex
public void testListListIteratorByIndex()(Code)
Tests the read-only bits of List.listIterator(int) .



testListListIteratorNextRemoveNext
public void testListListIteratorNextRemoveNext()(Code)
Tests remove on list iterator is correct.



testListListIteratorNextRemovePrevious
public void testListListIteratorNextRemovePrevious()(Code)
Tests remove on list iterator is correct.



testListListIteratorPreviousRemoveNext
public void testListListIteratorPreviousRemoveNext()(Code)
Tests remove on list iterator is correct.



testListListIteratorPreviousRemovePrevious
public void testListListIteratorPreviousRemovePrevious()(Code)
Tests remove on list iterator is correct.



testListRemoveByIndex
public void testListRemoveByIndex()(Code)
Tests List.remove(int) .



testListRemoveByIndexBoundsChecking
public void testListRemoveByIndexBoundsChecking()(Code)
Tests bounds checking for List.remove(int) on an empty list.



testListRemoveByIndexBoundsChecking2
public void testListRemoveByIndexBoundsChecking2()(Code)
Tests bounds checking for List.remove(int) on a full list.



testListSetByIndex
public void testListSetByIndex()(Code)
Test List.set(intObject) .



testListSetByIndexBoundsChecking
public void testListSetByIndexBoundsChecking()(Code)
Tests bounds checking for List.set(intObject) on an empty list.



testListSetByIndexBoundsChecking2
public void testListSetByIndexBoundsChecking2()(Code)
Tests bounds checking for List.set(intObject) on a full list.



testListSubListFailFastOnAdd
public void testListSubListFailFastOnAdd()(Code)
Tests that a sublist raises a java.util.ConcurrentModificationException ConcurrentModificationException if elements are added to the original list.



testListSubListFailFastOnRemove
public void testListSubListFailFastOnRemove()(Code)
Tests that a sublist raises a java.util.ConcurrentModificationException ConcurrentModificationException if elements are removed from the original list.



testUnsupportedSet
public void testUnsupportedSet()(Code)
If AbstractTestList.isSetSupported() returns false, tests that set operation raises UnsupportedOperationException.



verify
public void verify()(Code)
Verifies that the test list implementation matches the confirmed list implementation.



Fields inherited from org.apache.commons.collections.collection.AbstractTestCollection
public Collection collection(Code)(Java Doc)
public Collection confirmed(Code)(Java Doc)

Methods inherited from org.apache.commons.collections.collection.AbstractTestCollection
public boolean areEqualElementsDistinguishable()(Code)(Java Doc)
public Map.Entry cloneMapEntry(Map.Entry entry)(Code)(Java Doc)
public Object[] getFullElements()(Code)(Java Doc)
public Object[] getFullNonNullElements()(Code)(Java Doc)
public Object[] getFullNonNullStringElements()(Code)(Java Doc)
public Object[] getOtherElements()(Code)(Java Doc)
public Object[] getOtherNonNullElements()(Code)(Java Doc)
public Object[] getOtherNonNullStringElements()(Code)(Java Doc)
public boolean isAddSupported()(Code)(Java Doc)
public boolean isEqualsCheckable()(Code)(Java Doc)
public boolean isFailFastSupported()(Code)(Java Doc)
public boolean isNullSupported()(Code)(Java Doc)
public boolean isRemoveSupported()(Code)(Java Doc)
abstract public Collection makeCollection()(Code)(Java Doc)
abstract public Collection makeConfirmedCollection()(Code)(Java Doc)
abstract public Collection makeConfirmedFullCollection()(Code)(Java Doc)
public Collection makeFullCollection()(Code)(Java Doc)
public Object makeObject()(Code)(Java Doc)
public void resetEmpty()(Code)(Java Doc)
public void resetFull()(Code)(Java Doc)
public void testCollectionAdd()(Code)(Java Doc)
public void testCollectionAddAll()(Code)(Java Doc)
public void testCollectionClear()(Code)(Java Doc)
public void testCollectionContains()(Code)(Java Doc)
public void testCollectionContainsAll()(Code)(Java Doc)
public void testCollectionIsEmpty()(Code)(Java Doc)
public void testCollectionIterator()(Code)(Java Doc)
public void testCollectionIteratorFailFast()(Code)(Java Doc)
public void testCollectionIteratorRemove()(Code)(Java Doc)
public void testCollectionRemove()(Code)(Java Doc)
public void testCollectionRemoveAll()(Code)(Java Doc)
public void testCollectionRetainAll()(Code)(Java Doc)
public void testCollectionSize()(Code)(Java Doc)
public void testCollectionToArray()(Code)(Java Doc)
public void testCollectionToArray2()(Code)(Java Doc)
public void testCollectionToString()(Code)(Java Doc)
public void testSerializeDeserializeThenCompare() throws Exception(Code)(Java Doc)
public void testUnsupportedAdd()(Code)(Java Doc)
public void testUnsupportedRemove()(Code)(Java Doc)
public void verify()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.