| jdbm.btree.TestBTree
TestBTree | public class TestBTree extends TestCase (Code) | | This class contains all Unit tests for
BTree .
author: Alex Boisvert version: $Id: TestBTree.java,v 1.8 2003/09/21 15:49:02 boisvert Exp $ |
Inner Class :class TestThread extends Thread | |
Method Summary | |
protected static boolean | contains(Map.Entry entry, BTree btree) Helper method to 'simulate' the methods of an entry set of the btree. | protected static boolean | containsKey(Object key, BTree btree) Helper method to 'simulate' the methods of an entry set of the btree. | protected static boolean | containsValue(Object value, BTree btree) Helper method to 'simulate' the methods of an entry set of the btree. | protected void | handleThreadException(Throwable t) Handles the exceptions from other threads, so they are not ignored
in the junit test result. | public static void | main(String[] args) | public void | run(TestResult result) Overrides TestCase.run(TestResult), so the errors from threads
started from this thread can be added to the testresult. | public void | setUp() | public void | tearDown() | public void | testBasics() | public void | testBasics2() | public void | testClose() Test what happens after the recmanager has been closed but the
btree is accessed. | public void | testFind() Test to find differents objects in the btree. | public void | testInsert() Test to insert different objects into one btree. | public void | testLargeDataAmount() Test to insert, retrieve and remove a large amount of data. | public void | testMultithreadAccess() Test access from multiple threads. | public void | testRemove() Test to remove objects from the btree. |
DEBUG | final static boolean DEBUG(Code) | | |
THREAD_CONTENT_SIZE | final static int THREAD_CONTENT_SIZE(Code) | | |
THREAD_NUMBER | final static int THREAD_NUMBER(Code) | | |
THREAD_RUNTIME | final static int THREAD_RUNTIME(Code) | | |
result_ | protected TestResult result_(Code) | | |
contains | protected static boolean contains(Map.Entry entry, BTree btree) throws IOException(Code) | | Helper method to 'simulate' the methods of an entry set of the btree.
|
containsKey | protected static boolean containsKey(Object key, BTree btree) throws IOException(Code) | | Helper method to 'simulate' the methods of an entry set of the btree.
|
containsValue | protected static boolean containsValue(Object value, BTree btree) throws IOException(Code) | | Helper method to 'simulate' the methods of an entry set of the btree.
|
handleThreadException | protected void handleThreadException(Throwable t)(Code) | | Handles the exceptions from other threads, so they are not ignored
in the junit test result. This method must be called from every
thread's run() method, if any throwables were throws.
Parameters: t - the throwable (either from an assertEquals, assertTrue,fail, ... method, or an uncaught exception to be added to the testresult of the junit test. |
main | public static void main(String[] args)(Code) | | Runs all tests in this class
|
run | public void run(TestResult result)(Code) | | Overrides TestCase.run(TestResult), so the errors from threads
started from this thread can be added to the testresult. This is
shown in
http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit.html
Parameters: result - the testresult |
setUp | public void setUp()(Code) | | |
tearDown | public void tearDown()(Code) | | |
testBasics2 | public void testBasics2() throws IOException(Code) | | Basic tests, just use the simple test possibilities of junit (cdaller)
|
testClose | public void testClose() throws IOException(Code) | | Test what happens after the recmanager has been closed but the
btree is accessed. WHAT SHOULD HAPPEN???????????
(cdaller)
|
testFind | public void testFind() throws IOException(Code) | | Test to find differents objects in the btree. (cdaller)
|
testInsert | public void testInsert() throws IOException(Code) | | Test to insert different objects into one btree. (cdaller)
|
testLargeDataAmount | public void testLargeDataAmount() throws IOException(Code) | | Test to insert, retrieve and remove a large amount of data. (cdaller)
|
testMultithreadAccess | public void testMultithreadAccess() throws IOException(Code) | | Test access from multiple threads. Assertions only work, when the
run() method is overridden and the exceptions of the threads are
added to the resultset of the TestCase. see run() and
handleException().
|
testRemove | public void testRemove() throws IOException(Code) | | Test to remove objects from the btree. (cdaller)
|
|
|