Author: navssurtani
Date: 2008-08-11 06:41:29 -0400 (Mon, 11 Aug 2008)
New Revision: 15029
Modified:
search/trunk/src/test/org/hibernate/search/test/id/providedId/JBossCachePerson.java
search/trunk/src/test/org/hibernate/search/test/id/providedId/ProvidedIdTest.java
Log:
More ProvidedIdTest stuff
Modified:
search/trunk/src/test/org/hibernate/search/test/id/providedId/JBossCachePerson.java
===================================================================
---
search/trunk/src/test/org/hibernate/search/test/id/providedId/JBossCachePerson.java 2008-08-11
10:01:56 UTC (rev 15028)
+++
search/trunk/src/test/org/hibernate/search/test/id/providedId/JBossCachePerson.java 2008-08-11
10:41:29 UTC (rev 15029)
@@ -4,6 +4,7 @@
import javax.persistence.Entity;
import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
import java.io.Serializable;
@@ -17,6 +18,10 @@
{
@Id
+ @GeneratedValue
+ private long id;
+
+
@Field (index = Index.TOKENIZED, store = Store.YES)
private String name;
@Field (index = Index.TOKENIZED, store = Store.YES)
Modified:
search/trunk/src/test/org/hibernate/search/test/id/providedId/ProvidedIdTest.java
===================================================================
---
search/trunk/src/test/org/hibernate/search/test/id/providedId/ProvidedIdTest.java 2008-08-11
10:01:56 UTC (rev 15028)
+++
search/trunk/src/test/org/hibernate/search/test/id/providedId/ProvidedIdTest.java 2008-08-11
10:41:29 UTC (rev 15029)
@@ -10,8 +10,8 @@
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.List;
@@ -30,7 +30,7 @@
public void testProvidedId() throws ParseException {
- final Log log = LogFactory.getLog(JBossCachePerson.class);
+ final Logger log = LoggerFactory.getLogger(ProvidedIdTest.class);
person1 = new JBossCachePerson();
person1.setName("Navin Surtani");
person1.setBlurb("Likes playing WoW");
@@ -61,7 +61,7 @@
transaction = fullTextSession.beginTransaction();
- QueryParser parser = new QueryParser("Name", new StandardAnalyzer());
+ QueryParser parser = new QueryParser("name", new StandardAnalyzer());
Query luceneQuery = parser.parse("Goat");
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(luceneQuery,
JBossCachePerson.class);
@@ -72,9 +72,8 @@
transaction.commit();
session.close();
- System.out.println("result size is " + results.size());
- if(log.isDebugEnabled()) log.warn("result size is " + results.size());
+ if(log.isDebugEnabled()) log.debug("result size is " + results.size());
}