1   package net.obsearch.index.pptree.impl;
2   
3   import java.io.File;
4   
5   import junit.framework.TestCase;
6   
7   import net.obsearch.example.OBSlice;
8   import net.obsearch.example.OBSliceFactory;
9   import net.obsearch.index.pptree.impl.PPTreeShort;
10  import net.obsearch.index.utils.Directory;
11  import net.obsearch.index.utils.IndexSmokeTUtil;
12  import net.obsearch.index.utils.TUtils;
13  import net.obsearch.pivots.AcceptAll;
14  import net.obsearch.pivots.bustos.impl.IncrementalBustosNavarroChavezShort;
15  import net.obsearch.storage.bdb.Utils;
16  
17  import net.obsearch.storage.bdb.BDBFactoryJe;
18  import org.apache.log4j.Logger;
19  
20  /*
21   OBSearch: a distributed similarity search engine
22   This project is to similarity search what 'bit-torrent' is to downloads.
23   Copyright (C)  2007 Arnoldo Jose Muller Molina
24  
25   This program is free software: you can redistribute it and/or modify
26   it under the terms of the GNU General Public License as published by
27   the Free Software Foundation, either version 3 of the License, or
28   (at your option) any later version.
29  
30   This program is distributed in the hope that it will be useful,
31   but WITHOUT ANY WARRANTY; without even the implied warranty of
32   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33   GNU General Public License for more details.
34  
35   You should have received a copy of the GNU General Public License
36   along with this program.  If not, see <http://www.gnu.org/licenses/>.
37   */
38  
39  /**
40   * Tests on the P+Tree.
41   * @author Arnoldo Jose Muller Molina
42   * @since 0.7
43   */
44  public class TestPPTree
45          extends TestCase {
46  
47      /**
48       * Logger.
49       */
50      private static transient final Logger logger = Logger
51              .getLogger(TestPPTree.class);
52  
53      /**
54       * Tests on the P+Tree.
55       * @throws Exception If something goes really bad.
56       */
57      public void testPPTree() throws Exception {
58         
59          
60          
61          IncrementalBustosNavarroChavezShort<OBSlice> sel = new IncrementalBustosNavarroChavezShort<OBSlice>(new AcceptAll(),
62                  100, 100);
63          BDBFactoryJe fact = Utils.getFactoryJe();
64          
65          PPTreeShort<OBSlice> d = new PPTreeShort<OBSlice>(OBSlice.class, sel, 20, 12, (short) 0, (short) (OBSliceFactory.maxSliceSize * 2));
66          d.init(fact);
67          IndexSmokeTUtil<OBSlice> t = new IndexSmokeTUtil<OBSlice>(new OBSliceFactory());
68          t.tIndex(d);
69      }
70  
71  }