kstaken 2003/02/05 20:56:39
Modified: java/tests/src/org/apache/xindice UnitTests.java java/tests/src/org/apache/xindice/core/filer FilerTestCase.java Log: Enabling tests for HashFiler Revision Changes Path 1.10 +4 -3 xml-xindice/java/tests/src/org/apache/xindice/UnitTests.java Index: UnitTests.java =================================================================== RCS file: /home/cvs/xml-xindice/java/tests/src/org/apache/xindice/UnitTests.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- UnitTests.java 27 Dec 2002 23:21:42 -0000 1.9 +++ UnitTests.java 6 Feb 2003 04:56:39 -0000 1.10 @@ -89,7 +89,8 @@ suite.addTest(new FilerTestSetup(new TestSuite(FilerTestCase.class), new BTreeFiler())); suite.addTest(new FilerTestSetup(new TestSuite(FilerTestCase.class), new FSFiler())); - // todo see what to do with the HashFiler suite.addTest(new FilerTestSetup(new TestSuite(FilerTestCase.class), new HashFiler())); + // todo see what to do with the HashFiler + suite.addTest(new FilerTestSetup(new TestSuite(FilerTestCase.class), new HashFiler())); suite.addTest(new FilerTestSetup(new TestSuite(FilerTestCase.class), new MemFiler())); // If the Berkeley filer was built in then test it too. 1.5 +17 -2 xml-xindice/java/tests/src/org/apache/xindice/core/filer/FilerTestCase.java Index: FilerTestCase.java =================================================================== RCS file: /home/cvs/xml-xindice/java/tests/src/org/apache/xindice/core/filer/FilerTestCase.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FilerTestCase.java 15 Dec 2002 19:42:51 -0000 1.4 +++ FilerTestCase.java 6 Feb 2003 04:56:39 -0000 1.5 @@ -283,4 +283,19 @@ assertTrue(!result.hasMoreRecords()); } + public void testInsertManyDocuments() throws Exception { + int iterations = 1000; + for (int i = 0; i < iterations; i++) { + assertTrue(filer.writeRecord(new Key("key" + i), TEST_VALUE)); + } + + assertTrue(filer.getRecordCount() == iterations); + + for (int i = 0; i < iterations; i++) { + assertTrue(filer.deleteRecord(new Key("key" + i))); + } + + assertTrue(filer.getRecordCount() == 0); + } + }