[hibernate-commits] Hibernate SVN: r20687 - in search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance: reader and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Sep 23 06:46:27 EDT 2010


Author: hardy.ferentschik
Date: 2010-09-23 06:46:26 -0400 (Thu, 23 Sep 2010)
New Revision: 20687

Added:
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest2.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest2.java
Modified:
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Construction.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/IncrementalOptimizerStrategyPerfTest.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/OptimizerPerfTest.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Worker.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/AbstractActivity.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/BufferSharingReaderPerfTest.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Detective.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/IndexFillRunnable.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/InsertActivity.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerfTestCase.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerformance.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SearchActivity.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedBufferedReaderPerfTest.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Suspect.java
   search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/UpdateActivity.java
Log:
HSEARCH-592 Updated copyright statements and formatted code

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Construction.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Construction.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Construction.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,37 +1,36 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.optimizer;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
 
-import org.hibernate.search.annotations.Indexed;
 import org.hibernate.search.annotations.DocumentId;
 import org.hibernate.search.annotations.Field;
 import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
 
 /**
  * @author Emmanuel Bernard

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/IncrementalOptimizerStrategyPerfTest.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/IncrementalOptimizerStrategyPerfTest.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/IncrementalOptimizerStrategyPerfTest.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,33 +1,31 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.optimizer;
 
 /**
  * @author Emmanuel Bernard
  */
-//having name end in *PerfTest disables it from functional tests
 public class IncrementalOptimizerStrategyPerfTest extends OptimizerPerfTest {
 	protected void configure(org.hibernate.cfg.Configuration cfg) {
 		super.configure( cfg );

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/OptimizerPerfTest.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/OptimizerPerfTest.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/OptimizerPerfTest.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.optimizer;
 
@@ -46,7 +45,6 @@
 /**
  * @author Emmanuel Bernard
  */
-//having name end in *PerfTest disables it from functional tests
 public class OptimizerPerfTest extends SearchTestCase {
 	protected void setUp() throws Exception {
 		File sub = getBaseIndexDir();

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Worker.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Worker.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/optimizer/Worker.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,37 +1,36 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.optimizer;
 
-import javax.persistence.Id;
-import javax.persistence.GeneratedValue;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
 
-import org.hibernate.search.annotations.Indexed;
 import org.hibernate.search.annotations.DocumentId;
 import org.hibernate.search.annotations.Field;
 import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
 
 /**
  * @author Emmanuel Bernard

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/AbstractActivity.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/AbstractActivity.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/AbstractActivity.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
@@ -31,6 +30,7 @@
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.search.Query;
+
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 import org.hibernate.Transaction;
@@ -43,29 +43,32 @@
  * @author Sanne Grinovero
  */
 public abstract class AbstractActivity implements Runnable {
-	
-	private final ThreadLocal<QueryParser> parsers = new ThreadLocal<QueryParser>(){
+
+	private final ThreadLocal<QueryParser> parsers = new ThreadLocal<QueryParser>() {
 		@Override
-		protected QueryParser initialValue(){
-			return new MultiFieldQueryParser( SearchTestCase.getTargetLuceneVersion(),
-					new String[] {"name", "physicalDescription", "suspectCharge"},
-					SearchTestCase.standardAnalyzer );
-			}
-		};
-	
+		protected QueryParser initialValue() {
+			return new MultiFieldQueryParser(
+					SearchTestCase.getTargetLuceneVersion(),
+					new String[] { "name", "physicalDescription", "suspectCharge" },
+					SearchTestCase.standardAnalyzer
+			);
+		}
+	};
+
 	private final SessionFactory sf;
 	private final AtomicInteger jobSeed = new AtomicInteger();
 	private final CountDownLatch startSignal;
-	
+
 	AbstractActivity(SessionFactory sf, CountDownLatch startSignal) {
 		this.startSignal = startSignal;
 		this.sf = sf;
 	}
-	
+
 	public final void run() {
 		try {
 			startSignal.await();
-		} catch (InterruptedException e) {
+		}
+		catch ( InterruptedException e ) {
 			e.printStackTrace();
 			return;
 		}
@@ -77,23 +80,27 @@
 			try {
 				doAction( fts, jobSeed.getAndIncrement() );
 				ok = true;
-			} finally {
-				if (ok)
+			}
+			finally {
+				if ( ok ) {
 					tx.commit();
-				else
+				}
+				else {
 					tx.rollback();
+				}
 			}
-		} finally {
+		}
+		finally {
 			s.close();
 		}
 	}
-	
+
 	protected FullTextQuery getQuery(String queryString, FullTextSession s, Class... classes) {
 		Query luceneQuery = null;
 		try {
-			luceneQuery = parsers.get().parse(queryString);
+			luceneQuery = parsers.get().parse( queryString );
 		}
-		catch (ParseException e) {
+		catch ( ParseException e ) {
 			e.printStackTrace();
 		}
 		return s.createFullTextQuery( luceneQuery, classes );

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/BufferSharingReaderPerfTest.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/BufferSharingReaderPerfTest.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/BufferSharingReaderPerfTest.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Detective.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Detective.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Detective.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,37 +1,36 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
 
-import org.hibernate.search.annotations.Indexed;
 import org.hibernate.search.annotations.DocumentId;
 import org.hibernate.search.annotations.Field;
 import org.hibernate.search.annotations.Index;
+import org.hibernate.search.annotations.Indexed;
 
 /**
  * @author Emmanuel Bernard

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/IndexFillRunnable.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/IndexFillRunnable.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/IndexFillRunnable.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/InsertActivity.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/InsertActivity.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/InsertActivity.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
@@ -34,27 +33,29 @@
  * @author Sanne Grinovero
  */
 public class InsertActivity extends AbstractActivity {
-	
+
 	InsertActivity(SessionFactory sf, CountDownLatch startSignal) {
-		super(sf, startSignal);
+		super( sf, startSignal );
 	}
 
 	@Override
 	protected void doAction(FullTextSession s, int jobSeed) {
 		Detective detective = new Detective();
-		detective.setName("John Doe " + jobSeed);
-		detective.setBadge("123455" + jobSeed);
-		detective.setPhysicalDescription("Blond green eye etc etc");
-		s.persist(detective);
+		detective.setName( "John Doe " + jobSeed );
+		detective.setBadge( "123455" + jobSeed );
+		detective.setPhysicalDescription( "Blond green eye etc etc" );
+		s.persist( detective );
 		Suspect suspect = new Suspect();
-		suspect.setName("Jane Doe " + jobSeed);
-		suspect.setPhysicalDescription("brunette, short, 30-ish");
-		if (jobSeed % 20 == 0) {
-			suspect.setSuspectCharge("thief liar ");
-		} else {
-			suspect.setSuspectCharge(" It's 1875 in London. The police have captured career criminal Montmorency. In the process he has been grievously wounded and it is up to a young surgeon to treat his wounds. During his recovery Montmorency learns of the city's new sewer system and sees in it the perfect underground highway for his thievery.  Washington Post columnist John Kelly recommends this title for middle schoolers, especially to be read aloud.");
+		suspect.setName( "Jane Doe " + jobSeed );
+		suspect.setPhysicalDescription( "brunette, short, 30-ish" );
+		if ( jobSeed % 20 == 0 ) {
+			suspect.setSuspectCharge( "thief liar " );
 		}
-		s.persist(suspect);
+		else {
+			suspect.setSuspectCharge(
+					" It's 1875 in London. The police have captured career criminal Montmorency. In the process he has been grievously wounded and it is up to a young surgeon to treat his wounds. During his recovery Montmorency learns of the city's new sewer system and sees in it the perfect underground highway for his thievery.  Washington Post columnist John Kelly recommends this title for middle schoolers, especially to be read aloud."
+			);
+		}
+		s.persist( suspect );
 	}
-
 }

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 

Added: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest2.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest2.java	                        (rev 0)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/NotSharedReaderPerfTest2.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -0,0 +1,37 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
+ */
+package org.hibernate.search.test.performance.reader;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.search.Environment;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class NotSharedReaderPerfTest2 extends ReaderPerfTestCase {
+	protected void configure(Configuration cfg) {
+		super.configure( cfg );
+		cfg.setProperty( Environment.READER_STRATEGY, "not-shared" );
+	}
+}
\ No newline at end of file

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerfTestCase.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerfTestCase.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerfTestCase.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerformance.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerformance.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/ReaderPerformance.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
@@ -37,17 +36,17 @@
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.store.FSDirectory;
 import org.apache.lucene.store.LockObtainFailedException;
+
 import org.hibernate.search.Environment;
 import org.hibernate.search.store.FSDirectoryProvider;
 import org.hibernate.search.test.SearchTestCase;
 import org.hibernate.search.util.FileHelper;
 
 /**
- * To enable performance tests: de-comment buildBigIndex(); in setUp() and rename no_testPerformance
  * @author Sanne Grinovero
  */
 public abstract class ReaderPerformance extends SearchTestCase {
-		
+
 	//more iterations for more reliable measures:
 	private static final int TOTAL_WORK_BATCHES = 10;
 	//the next 3 define the kind of workload mix to test on:
@@ -58,7 +57,7 @@
 	private static final int WORKER_THREADS = 20;
 
 	private static final int WARMUP_CYCLES = 6;
-	
+
 	protected void setUp() throws Exception {
 		File baseIndexDir = getBaseIndexDir();
 		baseIndexDir.mkdir();
@@ -68,15 +67,16 @@
 		}
 		super.setUp();
 	}
-	
-	private void buildBigIndex() throws InterruptedException, CorruptIndexException, LockObtainFailedException, IOException {
+
+	private void buildBigIndex()
+			throws InterruptedException, CorruptIndexException, LockObtainFailedException, IOException {
 		System.out.println( "Going to create fake index..." );
-		FSDirectory directory = FSDirectory.open(new File(getBaseIndexDir(), Detective.class.getCanonicalName()));
+		FSDirectory directory = FSDirectory.open( new File( getBaseIndexDir(), Detective.class.getCanonicalName() ) );
 		IndexWriter.MaxFieldLength fieldLength = new IndexWriter.MaxFieldLength( IndexWriter.DEFAULT_MAX_FIELD_LENGTH );
 		IndexWriter iw = new IndexWriter( directory, new SimpleAnalyzer(), true, fieldLength );
 		IndexFillRunnable filler = new IndexFillRunnable( iw );
-		ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool( WORKER_THREADS );
-		for (int batch=0; batch<=5000000; batch++){
+		ThreadPoolExecutor executor = ( ThreadPoolExecutor ) Executors.newFixedThreadPool( WORKER_THREADS );
+		for ( int batch = 0; batch <= 5000000; batch++ ) {
 			executor.execute( filler );
 		}
 		executor.shutdown();
@@ -99,50 +99,58 @@
 		super.tearDown();
 		FileHelper.delete( getBaseIndexDir() );
 	}
-	
+
 	protected void configure(org.hibernate.cfg.Configuration cfg) {
 		super.configure( cfg );
 		cfg.setProperty( "hibernate.search.default.directory_provider", FSDirectoryProvider.class.getName() );
 		cfg.setProperty( "hibernate.search.default.indexBase", getBaseIndexDir().getAbsolutePath() );
-		cfg.setProperty( "hibernate.search.default.optimizer.transaction_limit.max", "10" ); // workaround too many open files
+		cfg.setProperty(
+				"hibernate.search.default.optimizer.transaction_limit.max", "10"
+		); // workaround too many open files
 		cfg.setProperty( "hibernate.search.default." + Environment.EXCLUSIVE_INDEX_USE, "true" );
 		cfg.setProperty( Environment.ANALYZER_CLASS, StopAnalyzer.class.getName() );
 		cfg.setProperty( Environment.READER_STRATEGY, getReaderStrategyName() );
 	}
 
 	protected abstract String getReaderStrategyName();
-	
-	public final void testPerformance() throws InterruptedException, CorruptIndexException, LockObtainFailedException, IOException {
+
+	public final void testPerformance()
+			throws InterruptedException, CorruptIndexException, LockObtainFailedException, IOException {
 		buildBigIndex();
-		for (int i=0; i<WARMUP_CYCLES; i++) {
+		for ( int i = 0; i < WARMUP_CYCLES; i++ ) {
 			timeMs();
 		}
 	}
-	
+
 	private final void timeMs() throws InterruptedException {
-		ThreadPoolExecutor executor = (ThreadPoolExecutor) Executors.newFixedThreadPool( WORKER_THREADS );
-		CountDownLatch startSignal = new CountDownLatch(1);
+		ThreadPoolExecutor executor = ( ThreadPoolExecutor ) Executors.newFixedThreadPool( WORKER_THREADS );
+		CountDownLatch startSignal = new CountDownLatch( 1 );
 		InsertActivity insertionTask = new InsertActivity( getSessions(), startSignal );
 		SearchActivity searchTask = new SearchActivity( getSessions(), startSignal );
 		UpdateActivity updateTask = new UpdateActivity( getSessions(), startSignal );
 		//we declare needed activities in order, scheduler will "mix":
-		for (int batch=0; batch<=TOTAL_WORK_BATCHES; batch++){
-			for ( int inserters=0; inserters<INSERTIONS_PER_BATCH; inserters++)
+		for ( int batch = 0; batch <= TOTAL_WORK_BATCHES; batch++ ) {
+			for ( int inserters = 0; inserters < INSERTIONS_PER_BATCH; inserters++ ) {
 				executor.execute( insertionTask );
-			for ( int searchers=0; searchers<SEARCHERS_PER_BATCH; searchers++)
+			}
+			for ( int searchers = 0; searchers < SEARCHERS_PER_BATCH; searchers++ ) {
 				executor.execute( searchTask );
-			for ( int updaters=0; updaters<UPDATES_PER_BATCH; updaters++)
+			}
+			for ( int updaters = 0; updaters < UPDATES_PER_BATCH; updaters++ ) {
 				executor.execute( updateTask );
+			}
 		}
 		executor.shutdown();
 		long startTime = System.currentTimeMillis();
 		startSignal.countDown();//start!
 		executor.awaitTermination( 600, TimeUnit.SECONDS );
 		long endTime = System.currentTimeMillis();
-		System.out.println( "Performance test for " + getReaderStrategyName() + ": " + (endTime - startTime) +"ms. (" + 
-				(TOTAL_WORK_BATCHES*SEARCHERS_PER_BATCH) + " searches, " + 
-				(TOTAL_WORK_BATCHES*INSERTIONS_PER_BATCH) + " insertions, " + 
-				(TOTAL_WORK_BATCHES*UPDATES_PER_BATCH) + " updates)" );
+		System.out.println(
+				"Performance test for " + getReaderStrategyName() + ": " + ( endTime - startTime ) + "ms. (" +
+						( TOTAL_WORK_BATCHES * SEARCHERS_PER_BATCH ) + " searches, " +
+						( TOTAL_WORK_BATCHES * INSERTIONS_PER_BATCH ) + " insertions, " +
+						( TOTAL_WORK_BATCHES * UPDATES_PER_BATCH ) + " updates)"
+		);
 	}
-	
+
 }

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SearchActivity.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SearchActivity.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SearchActivity.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
@@ -35,16 +34,16 @@
  * @author Sanne Grinovero
  */
 public class SearchActivity extends AbstractActivity {
-	
+
 	SearchActivity(SessionFactory sf, CountDownLatch startSignal) {
-		super(sf, startSignal);
+		super( sf, startSignal );
 	}
 
 	@Override
 	protected void doAction(FullTextSession s, int jobSeed) {
-		FullTextQuery q = getQuery( "John Doe", s, Detective.class);
+		FullTextQuery q = getQuery( "John Doe", s, Detective.class );
 		q.setMaxResults( 10 );
 		q.getResultSize();
 	}
-	
+
 }

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedBufferedReaderPerfTest.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedBufferedReaderPerfTest.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedBufferedReaderPerfTest.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 

Added: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest2.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest2.java	                        (rev 0)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/SharedReaderPerfTest2.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -0,0 +1,39 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
+ */
+package org.hibernate.search.test.performance.reader;
+
+import org.hibernate.cfg.Configuration;
+import org.hibernate.search.Environment;
+import org.hibernate.search.reader.SharedReaderProvider;
+
+/**
+ * @author Emmanuel Bernard
+ */
+ at SuppressWarnings("deprecation")
+public class SharedReaderPerfTest2 extends ReaderPerfTestCase {
+	protected void configure(Configuration cfg) {
+		super.configure( cfg );
+		cfg.setProperty( Environment.READER_STRATEGY, SharedReaderProvider.class.getCanonicalName() );
+	}
+}
\ No newline at end of file

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Suspect.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Suspect.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/Suspect.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,33 +1,32 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.GeneratedValue;
-import javax.persistence.Column;
+import javax.persistence.Id;
 
 import org.hibernate.search.annotations.DocumentId;
 import org.hibernate.search.annotations.Field;

Modified: search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/UpdateActivity.java
===================================================================
--- search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/UpdateActivity.java	2010-09-23 10:45:22 UTC (rev 20686)
+++ search/trunk/hibernate-search-integrationtest/src/test/java/org/hibernate/search/test/performance/reader/UpdateActivity.java	2010-09-23 10:46:26 UTC (rev 20687)
@@ -1,26 +1,25 @@
-/* $Id$
- * 
+/*
  * Hibernate, Relational Persistence for Idiomatic Java
- * 
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat, Inc.
- * 
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
- * for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA  02110-1301  USA
+ *
+ *  Copyright (c) 2010, Red Hat, Inc. and/or its affiliates or third-party contributors as
+ *  indicated by the @author tags or express copyright attribution
+ *  statements applied by the authors.  All third-party contributions are
+ *  distributed under license by Red Hat, Inc.
+ *
+ *  This copyrighted material is made available to anyone wishing to use, modify,
+ *  copy, or redistribute it subject to the terms and conditions of the GNU
+ *  Lesser General Public License, as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+ *  for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public License
+ *  along with this distribution; if not, write to:
+ *  Free Software Foundation, Inc.
+ *  51 Franklin Street, Fifth Floor
+ *  Boston, MA  02110-1301  USA
  */
 package org.hibernate.search.test.performance.reader;
 
@@ -37,17 +36,16 @@
 public class UpdateActivity extends AbstractActivity {
 
 	UpdateActivity(SessionFactory sf, CountDownLatch startSignal) {
-		super(sf, startSignal);
+		super( sf, startSignal );
 	}
 
 	@Override
 	protected void doAction(FullTextSession s, int jobSeed) {
 		FullTextQuery q = getQuery( "John", s, Detective.class );
 		List list = q.setMaxResults( 1 ).list();
-		for ( Object o : list){
-			Detective detective = (Detective) o;
+		for ( Object o : list ) {
+			Detective detective = ( Detective ) o;
 			detective.setPhysicalDescription( "old" );
 		}
 	}
-
 }



More information about the hibernate-commits mailing list