1 package net.obsearch.storage.bdb;
2
3 import java.io.File;
4
5 import junit.framework.TestCase;
6
7
8 import net.obsearch.index.utils.Directory;
9 import net.obsearch.storage.StorageValidationShort;
10 import net.obsearch.storage.OBStorageConfig;
11 import org.junit.Before;
12 import org.junit.Test;
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 public class TestBDBOBStoreJeShort extends TestCase{
38
39 @Before
40 public void setUp() throws Exception {
41 }
42
43
44 @Test
45 public void testAll() throws Exception{
46
47 BDBFactoryJe fact = Utils.getFactoryJe();
48 OBStorageConfig conf = new OBStorageConfig();
49 conf.setTemp(false);
50 conf.setDuplicates(false);
51 conf.setBulkMode(false);
52 StorageValidationShort.validate(fact.createOBStoreShort("testShort1", conf));
53 conf = new OBStorageConfig();
54 conf.setTemp(false);
55 conf.setDuplicates(false);
56 conf.setBulkMode(true);
57 StorageValidationShort.validate(fact.createOBStoreShort("testShort2", conf));
58 conf = new OBStorageConfig();
59 conf.setTemp(true);
60 conf.setDuplicates(false);
61 conf.setBulkMode(false);
62 StorageValidationShort.validate(fact.createOBStoreShort("testShort3", conf));
63 }
64
65
66 public void testDuplicates() throws Exception{
67
68 BDBFactoryJe fact = Utils.getFactoryJe();
69 OBStorageConfig conf = new OBStorageConfig();
70 conf.setTemp(false);
71 conf.setDuplicates(true);
72 conf.setBulkMode(false);
73 conf.setRecordSize(StorageValidationShort.STORAGE_SIZE);
74 StorageValidationShort.validateDuplicates(fact.createOBStoreShort("testShort1D", conf));
75 conf = new OBStorageConfig();
76 conf.setTemp(false);
77 conf.setDuplicates(true);
78 conf.setBulkMode(true);
79 conf.setRecordSize(StorageValidationShort.STORAGE_SIZE);
80 StorageValidationShort.validateDuplicates(fact.createOBStoreShort("testShort2D", conf));
81 conf = new OBStorageConfig();
82 conf.setTemp(true);
83 conf.setDuplicates(true);
84 conf.setBulkMode(false);
85 conf.setRecordSize(StorageValidationShort.STORAGE_SIZE);
86 StorageValidationShort.validateDuplicates(fact.createOBStoreShort("testShort3D", conf));
87 }
88
89
90 }
91