[hibernate-commits] Hibernate SVN: r11236 - branches/Branch_3_2/HibernateExt/search/src/test/org/hibernate/search/test/session.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Fri Feb 23 17:53:25 EST 2007


Author: epbernard
Date: 2007-02-23 17:53:24 -0500 (Fri, 23 Feb 2007)
New Revision: 11236

Modified:
   branches/Branch_3_2/HibernateExt/search/src/test/org/hibernate/search/test/session/MassIndexTest.java
Log:
More tests on session.index

Modified: branches/Branch_3_2/HibernateExt/search/src/test/org/hibernate/search/test/session/MassIndexTest.java
===================================================================
--- branches/Branch_3_2/HibernateExt/search/src/test/org/hibernate/search/test/session/MassIndexTest.java	2007-02-23 22:49:14 UTC (rev 11235)
+++ branches/Branch_3_2/HibernateExt/search/src/test/org/hibernate/search/test/session/MassIndexTest.java	2007-02-23 22:53:24 UTC (rev 11236)
@@ -37,7 +37,16 @@
 		tx.commit();
 		s.close();
 
+		//check non created object does get found!!1
 		s = new FullTextSessionImpl( openSession() );
+		tx = s.beginTransaction();
+		QueryParser parser = new QueryParser("id", new StopAnalyzer() );
+		List result = s.createFullTextQuery( parser.parse( "body:create" ) ).list();
+		assertEquals( 0, result.size() );
+		tx.commit();
+		s.close();
+
+		s = new FullTextSessionImpl( openSession() );
 		s.getTransaction().begin();
 		s.connection().createStatement().executeUpdate( "update Email set body='Meet the guys who write the software'");
 		//insert an object never indexed
@@ -48,8 +57,8 @@
 
 		s = new FullTextSessionImpl( openSession() );
 		tx = s.beginTransaction();
-		QueryParser parser = new QueryParser("id", new StopAnalyzer() );
-		List result = s.createFullTextQuery( parser.parse( "body:write" ) ).list();
+		parser = new QueryParser("id", new StopAnalyzer() );
+		result = s.createFullTextQuery( parser.parse( "body:write" ) ).list();
 		assertEquals( 0, result.size() );
 		result = s.createCriteria( Email.class ).list();
 		for (int i = 0 ; i < loop/2 ; i++)
@@ -70,7 +79,7 @@
 		tx.commit();
 		s.close();
 
-		//check
+		//check non indexed object get indexed by s.index
 		s = new FullTextSessionImpl( openSession() );
 		tx = s.beginTransaction();
 		result = s.createFullTextQuery( parser.parse( "body:create" ) ).list();




More information about the hibernate-commits mailing list