* Test to insert different objects into one btree. (cdaller)
*/
public void testInsert()
throws IOException
{
RecordManager recman;
BTree tree;
if ( DEBUG )
System.out.println("TestBTree.testInsert");
recman = newRecordManager();
tree = BTree.createInstance( recman);
// insert differnt objects and retrieve them
tree.insert("test1", "value1",false);
tree.insert("test2","value2",false);
tree.insert("one", new Integer(1),false);
tree.insert("two",new Long(2),false);
tree.insert("myownobject",new ObjectTT(new Integer(234)),false);
assertEquals("value2",(String)tree.find("test2"));
assertEquals("value1",(String)tree.find("test1"));
assertEquals(new Integer(1),(Integer)tree.find("one"));
assertEquals(new Long(2),(Long)tree.find("two"));
// what happens here? must not be replaced, does it return anything?
// probably yes!
assertEquals("value1",tree.insert("test1","value11",false));
assertEquals("value1",tree.find("test1")); // still the old value?
assertEquals("value1",tree.insert("test1","value11",true));
assertEquals("value11",tree.find("test1")); // now the new value!
ObjectTT expected_obj = new ObjectTT(new Integer(234));
ObjectTT btree_obj = (ObjectTT)tree.find("myownobject");
assertEquals(expected_obj, btree_obj);
recman.close();
}