Author: hardy.ferentschik
Date: 2009-04-29 11:30:40 -0400 (Wed, 29 Apr 2009)
New Revision: 16479
Modified:
search/trunk/src/test/java/org/hibernate/search/test/SearchTestCase.java
search/trunk/src/test/java/org/hibernate/search/test/TransactionTest.java
Log:
cleanup
Modified: search/trunk/src/test/java/org/hibernate/search/test/SearchTestCase.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/SearchTestCase.java 2009-04-29
15:29:34 UTC (rev 16478)
+++ search/trunk/src/test/java/org/hibernate/search/test/SearchTestCase.java 2009-04-29
15:30:40 UTC (rev 16479)
@@ -11,6 +11,7 @@
import org.hibernate.HibernateException;
import org.hibernate.Transaction;
import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.Dialect;
import org.hibernate.event.PostInsertEventListener;
import org.hibernate.impl.SessionFactoryImpl;
@@ -92,7 +93,7 @@
s.close();
}
- protected void configure(org.hibernate.cfg.Configuration cfg) {
+ protected void configure(Configuration cfg) {
cfg.setProperty( "hibernate.search.default.directory_provider",
RAMDirectoryProvider.class.getName() );
cfg.setProperty( "hibernate.search.default.indexBase",
indexDir.getAbsolutePath() );
cfg.setProperty( Environment.ANALYZER_CLASS, StopAnalyzer.class.getName() );
Modified: search/trunk/src/test/java/org/hibernate/search/test/TransactionTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/TransactionTest.java 2009-04-29
15:29:34 UTC (rev 16478)
+++ search/trunk/src/test/java/org/hibernate/search/test/TransactionTest.java 2009-04-29
15:30:40 UTC (rev 16479)
@@ -3,9 +3,11 @@
import java.io.IOException;
-import org.hibernate.Session;
import org.apache.lucene.index.IndexReader;
+import org.hibernate.Session;
+import org.hibernate.cfg.Configuration;
+
/**
* @author Emmanuel Bernard
*/
@@ -31,19 +33,24 @@
s = getSessions().openSession();
s.getTransaction().begin();
s.persist(
- new Document( "Java Persistence with Hibernate", "Object/relational
mapping with Hibernate", "blah blah blah" )
+ new Document(
+ "Java Persistence with Hibernate", "Object/relational mapping with
Hibernate", "blah blah blah"
+ )
);
s.flush();
s.getTransaction().rollback();
s.close();
assertEquals( "rollback() should not index", 3, getDocumentNumber() );
-
+
s = getSessions().openSession();
+ s.connection().setAutoCommit( true ); //
www.hibernate.org/403.html
s.persist(
- new Document( "Java Persistence with Hibernate", "Object/relational
mapping with Hibernate", "blah blah blah" )
+ new Document(
+ "Java Persistence with Hibernate", "Object/relational mapping with
Hibernate", "blah blah blah"
+ )
);
- s.flush();
+ s.flush();
s.close();
assertEquals( "no transaction should index", 4, getDocumentNumber() );
@@ -60,8 +67,7 @@
}
}
-
protected Class[] getMappings() {
- return new Class[]{Document.class};
+ return new Class[] { Document.class };
}
}