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