Index: topia2/src/test/org/codelutin/topia/TopiaContextTest.java diff -u topia2/src/test/org/codelutin/topia/TopiaContextTest.java:1.15 topia2/src/test/org/codelutin/topia/TopiaContextTest.java:1.16 --- topia2/src/test/org/codelutin/topia/TopiaContextTest.java:1.15 Mon Oct 16 15:38:20 2006 +++ topia2/src/test/org/codelutin/topia/TopiaContextTest.java Tue Oct 17 13:02:52 2006 @@ -23,9 +23,9 @@ * * @author poussin * - * @version $Revision: 1.15 $ + * @version $Revision: 1.16 $ * - * Last update: $Date: 2006/10/16 15:38:20 $ by : $Author: bpoussin $ + * Last update: $Date: 2006/10/17 13:02:52 $ by : $Author: bpoussin $ */ package org.codelutin.topia; @@ -33,16 +33,12 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; -import java.util.List; import java.util.Properties; -import java.util.SortedSet; import junit.framework.TestCase; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.lucene.document.Document; -import org.apache.lucene.search.Hits; import org.codelutin.topia.event.TopiaEntityEvent; import org.codelutin.topia.event.TopiaEntityListener; import org.codelutin.topia.event.TopiaEntityLoadEvent; @@ -52,7 +48,6 @@ import org.codelutin.topia.event.TopiaVetoableEntityLoadEvent; import org.codelutin.topia.event.TopiaVetoableEntityLoadListener; import org.codelutin.topia.framework.TopiaContextImplementor; -import org.codelutin.topia.index.IndexEntry; import org.codelutin.topia.persistence.TopiaDAO; /** @@ -132,47 +127,6 @@ return getH2Properties(); } - protected Properties getIndexProperties() { - Properties result = getProperties(); - result.setProperty("topia.index.engin", "org.codelutin.topia.index.LuceneIndexer"); - result.setProperty("topia.index.lucene.directory", "/tmp/topia-test-index"); - return result; - } - - public void testIndex() throws Exception { - System.out.println("Debut du test index"); - - Properties config = getIndexProperties(); - - TopiaContext context = TopiaContextFactory.getContext(config); - - TopiaContextImplementor childContext = (TopiaContextImplementor) context - .beginTransaction(); - TopiaDAO persons = childContext.getDAO(Person.class); - Person p = persons.create(); - p.setName("poussin de la chapelle"); - p.setFirstname("benjamin"); - - p = persons.create(); - p.setName("poussin"); - p.setFirstname("benjamin"); - - p = persons.create(); - p.setName("poussin informaticien"); - p.setFirstname("benjamin"); - - childContext.commitTransaction(); - childContext.closeContext(); - - TopiaIndexService ie = context.getIndexService(); - SortedSet results = ie.search("poussin"); - - System.out.println("Index result: " + results.size()); - for (IndexEntry result : results) { - System.out.println("Index result: " + result.getScore()+ " topiaId: " + result.getTopiaId()); - } - } - /* * #hibernate.dialect org.hibernate.dialect.DerbyDialect * #hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver