KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > nutch > db > TestWebDB


1 /* Copyright (c) 2003 The Nutch Organization. All rights reserved. */
2 /* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */
3
4 package net.nutch.db;
5
6 import net.nutch.fs.*;
7 import net.nutch.util.*;
8
9 import junit.framework.TestCase;
10 import java.io.*;
11
12 /*************************************************
13  * This is the unit test for WebDBWriter and
14  * WebDBReader. It's really not much more than
15  * a nice Junit-compatible wrapper around DBTester.
16  *
17  *************************************************/

18 public class TestWebDB extends TestCase {
19
20     /**
21      * Build the TestWebDB by calling super's constructor.
22      */

23     public TestWebDB(String JavaDoc name) {
24         super(name);
25     }
26
27     /**
28      * The main test method, invoked by Junit.
29      */

30     public void testWebDB() throws Exception JavaDoc {
31         String JavaDoc testDir = System.getProperty("test.build.data",".");
32         File dbDir = new File(testDir, "testDb");
33         dbDir.delete();
34         dbDir.mkdir();
35
36         DBTester tester = new DBTester(new LocalFileSystem(), dbDir, 500);
37         tester.runTest();
38         tester.cleanup();
39         dbDir.delete();
40     }
41 }
42
Popular Tags