Hibernate SVN: r19880 - in core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc: functional and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 14:30:58 -0400 (Wed, 30 Jun 2010)
New Revision: 19880
Modified:
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/AbstractJBossCacheTestCase.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/CacheTestCaseBase.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/DualNodeTestCaseBase.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCConcurrentWriteTest.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCJBossCacheTest.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/OptimisticJBossCacheTest.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/PessimisticJBossCacheTest.java
core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/bulk/PessimisticBulkOperationsTest.java
Log:
change to testing classes package
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/AbstractJBossCacheTestCase.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/AbstractJBossCacheTestCase.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/AbstractJBossCacheTestCase.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -29,8 +29,9 @@
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.jbc.util.CacheHelper;
-import org.hibernate.junit.UnitTestCase;
+import org.hibernate.testing.junit.UnitTestCase;
import org.hibernate.test.util.CacheTestSupport;
+
import org.jboss.cache.Cache;
import org.jboss.cache.Node;
import org.slf4j.Logger;
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/CacheTestCaseBase.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/CacheTestCaseBase.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/CacheTestCaseBase.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -27,7 +27,10 @@
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.Mappings;
import org.hibernate.dialect.Dialect;
-import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.testing.junit.functional.FunctionalTestCase;
+import org.hibernate.testing.tm.ConnectionProviderImpl;
+import org.hibernate.testing.tm.TransactionManagerLookupImpl;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,11 +112,11 @@
protected abstract boolean getUseQueryCache();
protected Class<?> getConnectionProviderClass() {
- return org.hibernate.test.tm.ConnectionProviderImpl.class;
+ return ConnectionProviderImpl.class;
}
protected Class<?> getTransactionManagerLookupClass() {
- return org.hibernate.test.tm.TransactionManagerLookupImpl.class;
+ return TransactionManagerLookupImpl.class;
}
protected Class<?> getTransactionFactoryClass() {
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/DualNodeTestCaseBase.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/DualNodeTestCaseBase.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/DualNodeTestCaseBase.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -20,7 +20,7 @@
import org.hibernate.cfg.Mappings;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.junit.functional.ExecutionEnvironment;
+import org.hibernate.testing.junit.functional.ExecutionEnvironment;
import org.hibernate.test.cache.jbc.functional.util.DualNodeConnectionProviderImpl;
import org.hibernate.test.cache.jbc.functional.util.DualNodeJtaTransactionManagerImpl;
import org.hibernate.test.cache.jbc.functional.util.DualNodeTestUtil;
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCConcurrentWriteTest.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCConcurrentWriteTest.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCConcurrentWriteTest.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -43,7 +43,7 @@
import org.hibernate.cache.jbc.JBossCacheRegionFactory;
import org.hibernate.cache.jbc.builder.SharedCacheInstanceManager;
import org.hibernate.cfg.Configuration;
-import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.hibernate.testing.junit.functional.FunctionalTestClassTestSuite;
import org.hibernate.stat.SecondLevelCacheStatistics;
import org.hibernate.test.cache.jbc.functional.util.DualNodeConnectionProviderImpl;
import org.hibernate.test.cache.jbc.functional.util.DualNodeJtaTransactionManagerImpl;
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCJBossCacheTest.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCJBossCacheTest.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/MVCCJBossCacheTest.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -29,7 +29,7 @@
import org.hibernate.cache.jbc.JBossCacheRegionFactory;
import org.hibernate.cache.jbc.builder.SharedCacheInstanceManager;
import org.hibernate.cfg.Configuration;
-import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.hibernate.testing.junit.functional.FunctionalTestClassTestSuite;
/**
* Basic functional test of a MVCC locking entity + query cache.
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/OptimisticJBossCacheTest.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/OptimisticJBossCacheTest.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/OptimisticJBossCacheTest.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -29,7 +29,7 @@
import org.hibernate.cache.jbc.JBossCacheRegionFactory;
import org.hibernate.cache.jbc.builder.SharedCacheInstanceManager;
import org.hibernate.cfg.Configuration;
-import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.hibernate.testing.junit.functional.FunctionalTestClassTestSuite;
/**
* Basic functional test of a optimistic locking entity + query cache.
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/PessimisticJBossCacheTest.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/PessimisticJBossCacheTest.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/PessimisticJBossCacheTest.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -29,7 +29,7 @@
import org.hibernate.cache.jbc.JBossCacheRegionFactory;
import org.hibernate.cache.jbc.builder.SharedCacheInstanceManager;
import org.hibernate.cfg.Configuration;
-import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
+import org.hibernate.testing.junit.functional.FunctionalTestClassTestSuite;
/**
* Basic functional test of a pessimistic locking entity + query cache.
Modified: core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/bulk/PessimisticBulkOperationsTest.java
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/bulk/PessimisticBulkOperationsTest.java 2010-06-30 18:30:10 UTC (rev 19879)
+++ core/branches/gradle2/hibernate-jbosscache/src/test/java/org/hibernate/test/cache/jbc/functional/bulk/PessimisticBulkOperationsTest.java 2010-06-30 18:30:58 UTC (rev 19880)
@@ -34,7 +34,7 @@
import org.hibernate.test.cache.jbc.functional.CacheTestCaseBase;
import org.hibernate.test.cache.jbc.functional.Contact;
import org.hibernate.test.cache.jbc.functional.Customer;
-import org.hibernate.test.tm.SimpleJtaTransactionManagerImpl;
+import org.hibernate.testing.tm.SimpleJtaTransactionManagerImpl;
import org.hibernate.transaction.CMTTransactionFactory;
/**
14 years, 6 months
Hibernate SVN: r19879 - in core/branches/gradle2: hibernate-infinispan and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 14:30:10 -0400 (Wed, 30 Jun 2010)
New Revision: 19879
Modified:
core/branches/gradle2/build.gradle
core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle
Log:
attempt to set jgroups bind address
Modified: core/branches/gradle2/build.gradle
===================================================================
--- core/branches/gradle2/build.gradle 2010-06-30 17:30:35 UTC (rev 19878)
+++ core/branches/gradle2/build.gradle 2010-06-30 18:30:10 UTC (rev 19879)
@@ -22,6 +22,10 @@
}
apply plugin: 'org.gradle.idea'
+
+// could not get this to work :(
+// // for tests in infinispan and jbosscache modules (override with -P to command line)
+// jgroupsBindAddress = '127.0.0.1'
}
apply plugin: org.hibernate.gradle.testing.database.DatabaseMatrixPlugin
@@ -33,6 +37,7 @@
javaVersion = "1.5"
}
+
// build a map of the dependency artifacts to use. Allows centralized definition of the version of artifacts to
// use. In that respect it serves a role similar to <dependencyManagement> in Maven
slf4jVersion = '1.5.8'
Modified: core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
===================================================================
--- core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 17:30:35 UTC (rev 19878)
+++ core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 18:30:10 UTC (rev 19879)
@@ -54,9 +54,9 @@
environment['jgroups.ping.timeout'] = 500
environment['jgroups.ping.num_initial_members'] = 1
environment['jgroups.udp.enable_bundling'] = false
+// environment['jgroups.bind_addr'] = $jgroupsBindAddress
// quite a few failures and the old maven module disabled these tests as well
enabled = false
}
-// todo : need to account for groups.bind_addr
Modified: core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle
===================================================================
--- core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle 2010-06-30 17:30:35 UTC (rev 19878)
+++ core/branches/gradle2/hibernate-jbosscache/hibernate-jbosscache.gradle 2010-06-30 18:30:10 UTC (rev 19879)
@@ -1,12 +1,19 @@
dependencies {
compile ( project( ':hibernate-core' ) )
compile( [group: 'org.jboss.cache', name: 'jbosscache-core', version: '3.2.1.GA'] )
-// testCompile( project(':hibernate-core').sourceSets.testing.classes )
+ testCompile( project(':hibernate-core').sourceSets.matrix.classes )
testCompile( libraries.jta )
testCompile( [group: 'jgroups', name: 'jgroups', version: '2.6.13.GA'] )
testRuntime( libraries.javassist )
}
-// todo : need to account for skipUnitTests from pom.xml
-// todo : need to account for groups.bind_addr from pom.xml
-// todo : need to account for surefire system-properties from pom.xml
+test {
+ environment['java.net.preferIPv4Stack'] = true
+ environment['jgroups.ping.timeout'] = 500
+ environment['jgroups.ping.num_initial_members'] = 1
+ environment['jgroups.udp.enable_bundling'] = false
+// environment['jgroups.bind_addr'] = $jgroupsBindAddress
+ // quite a few failures and the old maven module disabled these tests as well
+ enabled = false
+}
+
14 years, 6 months
Hibernate SVN: r19877 - core/branches/gradle2/hibernate-infinispan.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 12:12:10 -0400 (Wed, 30 Jun 2010)
New Revision: 19877
Modified:
core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
Log:
cleaned up build script
Modified: core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
===================================================================
--- core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 15:56:26 UTC (rev 19876)
+++ core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 16:12:10 UTC (rev 19877)
@@ -58,7 +58,5 @@
enabled = false
}
-// todo : need to account for skipUnitTests from pom.xml
-// todo : need to account for groups.bind_addr from pom.xml
-// todo : need to account for surefire system-properties from pom.xml
+// todo : need to account for groups.bind_addr
14 years, 6 months
Hibernate SVN: r19876 - core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 11:56:26 -0400 (Wed, 30 Jun 2010)
New Revision: 19876
Added:
core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java
Log:
helps to do a clean build sometimes to ferret out problems :)
Added: core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java (rev 0)
+++ core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/JndiInfinispanRegionFactoryTestCase.java 2010-06-30 15:56:26 UTC (rev 19876)
@@ -0,0 +1,21 @@
+package org.hibernate.test.cache.infinispan;
+
+import junit.framework.TestCase;
+import org.hibernate.cfg.SettingsFactory;
+
+import java.util.Properties;
+
+/**
+ * // TODO: Document this
+ *
+ * @author Galder Zamarreño
+ * @since // TODO
+ */
+public class JndiInfinispanRegionFactoryTestCase extends TestCase {
+
+ public void testConstruction() {
+ Properties p = new Properties();
+ p.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.infinispan.JndiInfinispanRegionFactory");
+ SettingsFactory.createRegionFactory(p, true);
+ }
+}
14 years, 6 months
Hibernate SVN: r19875 - in core/branches/gradle2/hibernate-infinispan: src/main/java/org/hibernate/cache/infinispan and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 11:55:13 -0400 (Wed, 30 Jun 2010)
New Revision: 19875
Modified:
core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java
core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java
core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/AbstractNonFunctionalTestCase.java
core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/cluster/DualNodeTestCase.java
core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java
Log:
helps to do a clean build sometimes to ferret out problems :)
Modified: core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
===================================================================
--- core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 14:35:26 UTC (rev 19874)
+++ core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 15:55:13 UTC (rev 19875)
@@ -21,7 +21,7 @@
type = 'jar'
}
}
-// testCompile( project(':hibernate-core').sourceSets.testing.classes )
+ testCompile( project(':hibernate-core').sourceSets.matrix.classes )
testCompile( [group: 'org.jboss', name: 'jboss-common-core', version: '2.2.14.GA'] )
testCompile( [group: 'org.jboss.naming', name: 'jnp-client', version: jnpVersion] )
testCompile( [group: 'org.jboss.naming', name: 'jnpserver', version: jnpVersion] )
@@ -50,6 +50,12 @@
test {
executable = java6Home.getJavaExecutable()
+ environment['java.net.preferIPv4Stack'] = true
+ environment['jgroups.ping.timeout'] = 500
+ environment['jgroups.ping.num_initial_members'] = 1
+ environment['jgroups.udp.enable_bundling'] = false
+ // quite a few failures and the old maven module disabled these tests as well
+ enabled = false
}
// todo : need to account for skipUnitTests from pom.xml
Modified: core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java 2010-06-30 14:35:26 UTC (rev 19874)
+++ core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/InfinispanRegionFactory.java 2010-06-30 15:55:13 UTC (rev 19875)
@@ -159,7 +159,7 @@
/** {@inheritDoc} */
public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException {
- log.debug("Building collection cache region [" + regionName + "]");
+ if (log.isDebugEnabled()) log.debug("Building collection cache region [" + regionName + "]");
Cache cache = getCache(regionName, COLLECTION_KEY, properties);
CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(cache);
CollectionRegionImpl region = new CollectionRegionImpl(cacheAdapter, regionName, metadata, transactionManager, this);
@@ -182,7 +182,7 @@
*/
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties)
throws CacheException {
- log.debug("Building query results cache region [" + regionName + "]");
+ if (log.isDebugEnabled()) log.debug("Building query results cache region [" + regionName + "]");
String cacheName = typeOverrides.get(QUERY_KEY).getCacheName();
CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(manager.getCache(cacheName));
QueryResultsRegionImpl region = new QueryResultsRegionImpl(cacheAdapter, regionName, properties, transactionManager, this);
@@ -195,7 +195,7 @@
*/
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties)
throws CacheException {
- log.debug("Building timestamps cache region [" + regionName + "]");
+ if (log.isDebugEnabled()) log.debug("Building timestamps cache region [" + regionName + "]");
String cacheName = typeOverrides.get(TIMESTAMPS_KEY).getCacheName();
CacheAdapter cacheAdapter = CacheAdapterImpl.newInstance(manager.getCache(cacheName));
TimestampsRegionImpl region = new TimestampsRegionImpl(cacheAdapter, regionName, transactionManager, this);
Modified: core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java 2010-06-30 14:35:26 UTC (rev 19874)
+++ core/branches/gradle2/hibernate-infinispan/src/main/java/org/hibernate/cache/infinispan/JndiInfinispanRegionFactory.java 2010-06-30 15:55:13 UTC (rev 19875)
@@ -51,7 +51,15 @@
* There is no default value -- the user must specify the property.
*/
public static final String CACHE_MANAGER_RESOURCE_PROP = "hibernate.cache.infinispan.cachemanager";
-
+
+ public JndiInfinispanRegionFactory() {
+ super();
+ }
+
+ public JndiInfinispanRegionFactory(Properties props) {
+ super(props);
+ }
+
@Override
protected CacheManager createCacheManager(Properties properties) throws CacheException {
String name = PropertiesHelper.getString(CACHE_MANAGER_RESOURCE_PROP, properties, null);
Modified: core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/AbstractNonFunctionalTestCase.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/AbstractNonFunctionalTestCase.java 2010-06-30 14:35:26 UTC (rev 19874)
+++ core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/AbstractNonFunctionalTestCase.java 2010-06-30 15:55:13 UTC (rev 19875)
@@ -29,7 +29,6 @@
import org.hibernate.cache.infinispan.util.CacheHelper;
import org.hibernate.testing.junit.UnitTestCase;
import org.hibernate.test.cache.infinispan.util.CacheTestSupport;
-
import org.infinispan.Cache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/cluster/DualNodeTestCase.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/cluster/DualNodeTestCase.java 2010-06-30 14:35:26 UTC (rev 19874)
+++ core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/cluster/DualNodeTestCase.java 2010-06-30 15:55:13 UTC (rev 19875)
@@ -135,7 +135,7 @@
/**
* Apply any node-specific configurations to our first node.
*
- * @param the
+ * @param cfg the
* Configuration to update.
*/
protected void configureFirstNode(Configuration cfg) {
@@ -145,7 +145,7 @@
/**
* Apply any node-specific configurations to our second node.
*
- * @param the
+ * @param cfg the
* Configuration to update.
*/
protected void configureSecondNode(Configuration cfg) {
Modified: core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java 2010-06-30 14:35:26 UTC (rev 19874)
+++ core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java 2010-06-30 15:55:13 UTC (rev 19875)
@@ -34,7 +34,6 @@
import org.hibernate.stat.Statistics;
import org.hibernate.test.cache.infinispan.functional.Item;
import org.hibernate.util.ConfigHelper;
-import org.hibernate.util.PropertiesHelper;
import org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup;
import org.infinispan.util.logging.Log;
@@ -53,7 +52,6 @@
import javax.transaction.Status;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
-import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
@@ -277,7 +275,7 @@
private SessionFactory buildSessionFactory() {
// Extra options located in src/test/resources/hibernate.properties
Configuration cfg = new Configuration();
- cfg.setProperty(Environment.DIALECT, "org.hibernate.dialect.HSQLDialect");
+// cfg.setProperty(Environment.DIALECT, "org.hibernate.dialect.HSQLDialect");
cfg.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
cfg.setProperty(Environment.DATASOURCE, "java:/MyDatasource");
cfg.setProperty(Environment.JNDI_CLASS, "org.jnp.interfaces.NamingContextFactory");
14 years, 6 months
Hibernate SVN: r19874 - core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 10:35:26 -0400 (Wed, 30 Jun 2010)
New Revision: 19874
Modified:
core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java
Log:
got infinispan module tests passing
Modified: core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java 2010-06-30 13:46:13 UTC (rev 19873)
+++ core/branches/gradle2/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/tm/JBossStandaloneJtaExampleTest.java 2010-06-30 14:35:26 UTC (rev 19874)
@@ -33,6 +33,9 @@
import org.hibernate.mapping.PersistentClass;
import org.hibernate.stat.Statistics;
import org.hibernate.test.cache.infinispan.functional.Item;
+import org.hibernate.util.ConfigHelper;
+import org.hibernate.util.PropertiesHelper;
+
import org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
@@ -50,6 +53,8 @@
import javax.transaction.Status;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
+import java.io.IOException;
+import java.io.InputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Iterator;
@@ -218,12 +223,20 @@
bind("UserTransaction", lookup.getUserTransaction(), lookup.getUserTransaction().getClass(), ctx);
}
- private void bindDataSource() throws Exception {
- ExtendedXADataSource xads = new ExtendedXADataSource();
- xads.setDriverName("org.hsqldb.jdbcDriver");
- xads.setUrl("jdbc:hsqldb:mem:/test");
- ctx.bind("java:/MyDatasource", xads);
- }
+ private void bindDataSource() throws Exception {
+ Properties properties = new Properties();
+ InputStream stream = ConfigHelper.getResourceAsStream( "/hibernate.properties" );
+ try {
+ properties.load( stream );
+ }
+ finally {
+ stream.close();
+ }
+ ExtendedXADataSource xads = new ExtendedXADataSource();
+ xads.setDriverName( properties.getProperty( Environment.DRIVER ) );
+ xads.setUrl( properties.getProperty( Environment.URL ) );
+ ctx.bind( "java:/MyDatasource", xads );
+ }
/**
* Helper method that binds the a non serializable object to the JNDI tree.
14 years, 6 months
Hibernate SVN: r19873 - in search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory: generated and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-30 09:46:13 -0400 (Wed, 30 Jun 2010)
New Revision: 19873
Added:
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java
Modified:
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
Log:
HSEARCH-397 Add performance and concurrency tests for mutating search factory
Test on FSDirectory around 20ms per class addition (mainly the index creation)
Test on RAMDirectory not noticeable
Tested on 100 classes, 10 threads adding 10 classes one by one
Modified: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java 2010-06-30 13:45:30 UTC (rev 19872)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java 2010-06-30 13:46:13 UTC (rev 19873)
@@ -1,28 +1,42 @@
package org.hibernate.search.test.configuration.mutablefactory;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ThreadPoolExecutor;
+
import junit.framework.TestCase;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopDocs;
+import org.slf4j.Logger;
-import org.hibernate.search.spi.SearchFactoryIntegrator;
+import org.hibernate.annotations.common.util.ReflectHelper;
import org.hibernate.search.backend.Work;
import org.hibernate.search.backend.WorkType;
+import org.hibernate.search.batchindexing.Executors;
import org.hibernate.search.engine.SearchFactoryImplementor;
import org.hibernate.search.impl.MutableSearchFactory;
import org.hibernate.search.impl.SearchFactoryBuilder;
+import org.hibernate.search.spi.SearchFactoryIntegrator;
import org.hibernate.search.store.DirectoryProvider;
+import org.hibernate.search.store.FSDirectoryProvider;
import org.hibernate.search.store.RAMDirectoryProvider;
import org.hibernate.search.test.SearchTestCase;
+import org.hibernate.search.test.configuration.mutablefactory.generated.Generated;
import org.hibernate.search.test.util.ManualConfiguration;
import org.hibernate.search.test.util.ManualTransactionContext;
+import org.hibernate.search.util.FileHelper;
+import org.hibernate.search.util.LoggerFactory;
/**
* @author Emmanuel Bernard
*/
public class MutableFactoryTest extends TestCase {
+ public static final Logger log = LoggerFactory.make();
+
public void testCreateEmptyFactory() throws Exception {
final ManualConfiguration configuration = new ManualConfiguration();
SearchFactoryImplementor sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
@@ -83,7 +97,6 @@
public void testAddingClassSimpleAPI() throws Exception {
ManualConfiguration configuration = new ManualConfiguration()
.addProperty( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
-
SearchFactoryIntegrator sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
sf.addClasses( A.class );
@@ -135,8 +148,153 @@
sf.close();
}
- private void doIndexWork(Object entity, Integer id, SearchFactoryIntegrator sfi, ManualTransactionContext tc) {
+ private static void doIndexWork(Object entity, Integer id, SearchFactoryIntegrator sfi, ManualTransactionContext tc) {
Work<?> work = new Work<Object>( entity, id, WorkType.INDEX );
sfi.getWorker().performWork( work, tc );
}
+
+ public void testMultiThreadedAddClasses() throws Exception {
+
+ File indexDir = initIndexDirectory();
+ try {
+ doTestMultiThreadedClasses(indexDir);
+ }
+ finally {
+ cleanIndexDir( indexDir );
+ }
+ }
+
+ private void doTestMultiThreadedClasses(File indexDir) throws Exception {
+ QueryParser parser = new QueryParser( SearchTestCase.getTargetLuceneVersion(), "name", SearchTestCase.standardAnalyzer );
+ ManualConfiguration configuration = new ManualConfiguration()
+ .addProperty( "hibernate.search.default.directory_provider", FSDirectoryProvider.class.getName() )
+ .addProperty( "hibernate.search.default.indexBase", indexDir.getAbsolutePath() );
+ SearchFactoryIntegrator sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
+ List<DoAddClasses> runnables = new ArrayList<DoAddClasses>(10);
+ final int nbrOfThread = 10;
+ final int nbrOfClassesPerThread = 10;
+ for (int i = 0 ; i < nbrOfThread; i++) {
+ runnables.add( new DoAddClasses( sf, i, nbrOfClassesPerThread ) );
+ }
+ final ThreadPoolExecutor poolExecutor = Executors.newFixedThreadPool( nbrOfThread, "SFI classes addition" );
+ poolExecutor.prestartAllCoreThreads();
+ for (Runnable runnable : runnables) {
+ poolExecutor.execute( runnable );
+ }
+
+ //poolExecutor.awaitTermination( 1, TimeUnit.MINUTES );
+ boolean inProgress;
+ do {
+ Thread.sleep( 100 );
+ inProgress = false;
+ for ( DoAddClasses runnable : runnables) {
+ inProgress = inProgress || runnable.isFailure() == null;
+ }
+ } while (inProgress);
+
+ for ( DoAddClasses runnable : runnables) {
+ assertNotNull( "Threads not run # " + runnable.getWorkNumber(), runnable.isFailure() );
+ assertFalse( "thread failed #" + runnable.getWorkNumber() + " Failure: " + runnable.getFailureInfo(), runnable.isFailure() );
+ }
+
+ poolExecutor.shutdown();
+
+ for (int i = 0 ; i < nbrOfThread*nbrOfClassesPerThread ; i++) {
+ Query luceneQuery = parser.parse( "Emmanuel" + i);
+ final Class<?> classByNumber = getClassAByNumber( i );
+ DirectoryProvider<?> provider = sf.getDirectoryProviders( classByNumber )[0];
+ IndexSearcher searcher = new IndexSearcher( provider.getDirectory(), true );
+ TopDocs hits = searcher.search( luceneQuery, 1000 );
+ assertEquals( 1, hits.totalHits );
+ }
+ }
+
+ private void cleanIndexDir(File indexDir) {
+ FileHelper.delete( indexDir );
+ }
+
+ private File initIndexDirectory() {
+ String buildDir = System.getProperty( "build.dir" );
+ if ( buildDir == null ) {
+ buildDir = ".";
+ }
+ File current = new File( buildDir );
+ File indexDir = new File( current, "indextemp" );
+ boolean created = indexDir.mkdir();
+ if (!created) {
+ FileHelper.delete( indexDir );
+ indexDir.mkdir();
+ }
+ return indexDir;
+ }
+
+ private static Class<?> getClassAByNumber(int i) throws ClassNotFoundException {
+ final Class<?> aClass = ReflectHelper.classForName(
+ Generated.A0.class.getName().replace(
+ "A0", "A" + i
+ )
+ );
+ return aClass;
+ }
+
+ private static class DoAddClasses implements Runnable {
+ private final SearchFactoryIntegrator factory;
+ private final int factorOfClassesPerThread;
+ private final QueryParser parser;
+ private final int nbrOfClassesPerThread;
+ private volatile Boolean failure;
+ private volatile String failureInfo;
+
+ public String getFailureInfo() {
+ return failureInfo;
+ }
+
+ public Boolean isFailure() {
+ return failure;
+ }
+
+ public int getWorkNumber() {
+ return factorOfClassesPerThread;
+ }
+
+ public DoAddClasses(SearchFactoryIntegrator factory, int factorOfClassesPerThread, int nbrOfClassesPerThread) {
+ this.factory = factory;
+ this.factorOfClassesPerThread = factorOfClassesPerThread;
+ this.parser = new QueryParser( SearchTestCase.getTargetLuceneVersion(), "name", SearchTestCase.standardAnalyzer );
+ this.nbrOfClassesPerThread = nbrOfClassesPerThread;
+ }
+
+ public void run() {
+
+ try {
+ for (int index = 0 ; index < 10 ; index++) {
+ final int i = factorOfClassesPerThread*nbrOfClassesPerThread + index;
+ final Class<?> aClass = MutableFactoryTest.getClassAByNumber( i );
+ factory.addClasses( aClass );
+ Object entity = aClass.getConstructor( Integer.class, String.class ).newInstance(i, "Emmanuel" + i);
+ ManualTransactionContext context = new ManualTransactionContext();
+ MutableFactoryTest.doIndexWork(entity, i, factory, context );
+ context.end();
+
+ Query luceneQuery = parser.parse( "Emmanuel" + i);
+ DirectoryProvider<?> provider = factory.getDirectoryProviders( aClass )[0];
+ IndexSearcher searcher = new IndexSearcher( provider.getDirectory(), true );
+ TopDocs hits = searcher.search( luceneQuery, 1000 );
+ if ( hits.totalHits != 1 ) {
+ failure = true;
+ failureInfo = "failure: Emmanuel" + i + " for " + aClass.getName();
+ return;
+ }
+ //System.out.println("success: Emmanuel" + i + " for " + aClass.getName() );
+ }
+ //System.out.println("success: Emmanuel" + factorOfClassesPerThread );
+ failure = false;
+ }
+ catch ( Exception e ) {
+ this.failure = true;
+ e.printStackTrace( );
+ failureInfo = "failure: Emmanuel" + factorOfClassesPerThread + " exception: " + e.toString();
+ }
+ }
+ }
}
Added: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java (rev 0)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generated.java 2010-06-30 13:46:13 UTC (rev 19873)
@@ -0,0 +1,1508 @@
+package org.hibernate.search.test.configuration.mutablefactory.generated;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Indexed;
+
+/** Class generated container 100 inner classes */public class Generated {
+ @Indexed
+ public static class A0 {
+ public A0(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A1 {
+ public A1(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A2 {
+ public A2(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A3 {
+ public A3(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A4 {
+ public A4(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A5 {
+ public A5(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A6 {
+ public A6(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A7 {
+ public A7(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A8 {
+ public A8(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A9 {
+ public A9(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A10 {
+ public A10(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A11 {
+ public A11(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A12 {
+ public A12(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A13 {
+ public A13(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A14 {
+ public A14(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A15 {
+ public A15(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A16 {
+ public A16(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A17 {
+ public A17(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A18 {
+ public A18(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A19 {
+ public A19(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A20 {
+ public A20(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A21 {
+ public A21(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A22 {
+ public A22(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A23 {
+ public A23(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A24 {
+ public A24(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A25 {
+ public A25(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A26 {
+ public A26(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A27 {
+ public A27(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A28 {
+ public A28(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A29 {
+ public A29(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A30 {
+ public A30(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A31 {
+ public A31(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A32 {
+ public A32(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A33 {
+ public A33(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A34 {
+ public A34(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A35 {
+ public A35(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A36 {
+ public A36(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A37 {
+ public A37(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A38 {
+ public A38(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A39 {
+ public A39(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A40 {
+ public A40(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A41 {
+ public A41(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A42 {
+ public A42(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A43 {
+ public A43(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A44 {
+ public A44(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A45 {
+ public A45(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A46 {
+ public A46(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A47 {
+ public A47(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A48 {
+ public A48(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A49 {
+ public A49(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A50 {
+ public A50(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A51 {
+ public A51(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A52 {
+ public A52(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A53 {
+ public A53(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A54 {
+ public A54(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A55 {
+ public A55(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A56 {
+ public A56(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A57 {
+ public A57(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A58 {
+ public A58(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A59 {
+ public A59(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A60 {
+ public A60(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A61 {
+ public A61(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A62 {
+ public A62(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A63 {
+ public A63(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A64 {
+ public A64(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A65 {
+ public A65(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A66 {
+ public A66(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A67 {
+ public A67(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A68 {
+ public A68(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A69 {
+ public A69(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A70 {
+ public A70(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A71 {
+ public A71(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A72 {
+ public A72(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A73 {
+ public A73(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A74 {
+ public A74(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A75 {
+ public A75(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A76 {
+ public A76(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A77 {
+ public A77(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A78 {
+ public A78(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A79 {
+ public A79(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A80 {
+ public A80(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A81 {
+ public A81(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A82 {
+ public A82(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A83 {
+ public A83(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A84 {
+ public A84(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A85 {
+ public A85(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A86 {
+ public A86(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A87 {
+ public A87(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A88 {
+ public A88(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A89 {
+ public A89(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A90 {
+ public A90(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A91 {
+ public A91(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A92 {
+ public A92(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A93 {
+ public A93(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A94 {
+ public A94(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A95 {
+ public A95(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A96 {
+ public A96(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A97 {
+ public A97(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A98 {
+ public A98(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+ @Indexed
+ public static class A99 {
+ public A99(Integer id, String name) { this.id = id; this.name = name; }
+
+ @DocumentId
+ public Integer getId() {return id;}
+ public void setId(Integer id) { this.id = id; }
+ private Integer id;
+
+ @Field
+ public String getName() {return name;}
+ public void setName(String name) { this.name = name; }
+ private String name;
+ }
+
+}
\ No newline at end of file
Added: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java (rev 0)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/generated/Generator.java 2010-06-30 13:46:13 UTC (rev 19873)
@@ -0,0 +1,52 @@
+package org.hibernate.search.test.configuration.mutablefactory.generated;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * @author Emmanuel Bernard
+ */
+public class Generator {
+
+ public static void main(String[] args) {
+ StringBuilder generated = new StringBuilder( );
+ generated.append( "package org.hibernate.search.test.configuration.mutablefactory.generated;\n\n" )
+ .append("import org.hibernate.search.annotations.DocumentId;\n")
+ .append( "import org.hibernate.search.annotations.Field;\n" )
+ .append( "import org.hibernate.search.annotations.Indexed;\n\n" )
+ .append( "/** Class generated container 100 inner classes */" )
+ .append("public class Generated {\n");
+
+ StringBuilder inner = new StringBuilder( );
+ inner.append("\t").append( "@Indexed").append( "\n" )
+ .append( "\t" ).append( "public static class Ax {" ).append( "\n" )
+ .append("\t").append("\t").append( "public Ax(Integer id, String name) { this.id = id; this.name = name; }" ).append( "\n\n" )
+ .append("\t").append("\t").append( "@DocumentId" ).append( "\n" )
+ .append("\t").append("\t").append( "public Integer getId() {return id;}" ).append( "\n" )
+ .append("\t").append("\t").append( "public void setId(Integer id) { this.id = id; }" ).append( "\n" )
+ .append("\t").append("\t").append( "private Integer id;" ).append( "\n\n" )
+ .append("\t").append("\t").append( "@Field" ).append( "\n" )
+ .append("\t").append("\t").append( "public String getName() {return name;}" ).append( "\n" )
+ .append("\t").append("\t").append( "public void setName(String name) { this.name = name; }" ).append( "\n" )
+ .append("\t").append("\t").append( "private String name;" ).append( "\n" )
+ .append( "\t}\n\n" );
+ String innerString = inner.toString();
+ for (int i = 0 ; i < 100 ; i++) {
+ generated.append( innerString.replace("Ax", "A"+i ) );
+ }
+
+ generated.append( "}" );
+ File f = new File("./Generated.java");
+ try {
+ FileWriter fw = new FileWriter( f );
+ fw.write( generated.toString() );
+ fw.close();
+ }
+ catch ( IOException e ) {
+ System.out.println("Error while generating classes" );
+ e.printStackTrace( );
+ }
+ System.out.println("Generated in :" + f.getAbsolutePath() );
+ }
+}
14 years, 6 months
Hibernate SVN: r19872 - in search/trunk/hibernate-search/src: main/java/org/hibernate/search/engine and 3 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-30 09:45:30 -0400 (Wed, 30 Jun 2010)
New Revision: 19872
Added:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/spi/SearchFactoryIntegrator.java
Removed:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/SearchFactoryImplementor.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/ImmutableSearchFactory.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
Log:
HSEARCH-397 Commit a simplified contract to add new classes to a SearchFactory
Introduce the notion of SearchFactoryIntegrator containing contracts like:
- addClasses
- getWorker (for indexing)
- close
Simplify test based on new SearchFactoryIntegrator contract
Deleted: search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java 2010-06-30 13:44:30 UTC (rev 19871)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java 2010-06-30 13:45:30 UTC (rev 19872)
@@ -1,19 +0,0 @@
-package org.hibernate.search;
-
-/**
- * This contract is considered experimental
- * Allow modifications of the SearchFactory internals
- *
- * As of today allow addition of new indexed classes.
- *
- * @author Emmanuel Bernard
- */
-public interface IncrementalSearchFactory extends SearchFactory {
- /**
- * Add the following classes to the SearchFactory
- *
- */
- void addClasses(Class<?>... classes);
-
- //TODO consider accepting SearchConfiguration or SearchMapping
-}
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/SearchFactoryImplementor.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/SearchFactoryImplementor.java 2010-06-30 13:44:30 UTC (rev 19871)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/engine/SearchFactoryImplementor.java 2010-06-30 13:45:30 UTC (rev 19872)
@@ -36,6 +36,7 @@
import org.hibernate.search.backend.impl.batchlucene.BatchBackend;
import org.hibernate.search.batchindexing.MassIndexerProgressMonitor;
import org.hibernate.search.filter.FilterCachingStrategy;
+import org.hibernate.search.spi.SearchFactoryIntegrator;
import org.hibernate.search.store.DirectoryProvider;
import org.hibernate.search.store.optimization.OptimizerStrategy;
import org.hibernate.search.exception.ErrorHandler;
@@ -46,7 +47,7 @@
* @author Emmanuel Bernard
* @author Hardy Ferentschik
*/
-public interface SearchFactoryImplementor extends SearchFactory {
+public interface SearchFactoryImplementor extends SearchFactoryIntegrator {
BackendQueueProcessorFactory getBackendQueueProcessorFactory();
Map<Class<?>, DocumentBuilderIndexedEntity<?>> getDocumentBuildersIndexedEntities();
@@ -55,8 +56,6 @@
<T> DocumentBuilderContainedEntity<T> getDocumentBuilderContainedEntity(Class<T> entityType);
- Worker getWorker();
-
OptimizerStrategy getOptimizerStrategy(DirectoryProvider<?> provider);
FilterCachingStrategy getFilterCachingStrategy();
@@ -67,8 +66,6 @@
String getIndexingStrategy();
- void close();
-
Set<Class<?>> getClassesInDirectoryProvider(DirectoryProvider<?> directoryProvider);
Set<DirectoryProvider<?>> getDirectoryProviders();
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/ImmutableSearchFactory.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/ImmutableSearchFactory.java 2010-06-30 13:44:30 UTC (rev 19871)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/ImmutableSearchFactory.java 2010-06-30 13:45:30 UTC (rev 19872)
@@ -70,6 +70,8 @@
import org.hibernate.util.StringHelper;
/**
+ * This implementation is never directly exposed to the user, it is always wrapped into a {@link org.hibernate.search.impl.MutableSearchFactory}
+ *
* @author Emmanuel Bernard
*/
public class ImmutableSearchFactory implements StateSearchFactoryImplementor, WorkerBuildContext {
@@ -191,6 +193,10 @@
return this.dirProviderData.keySet();
}
+ public void addClasses(Class<?>... classes) {
+ throw new AssertionFailure( "Cannot add classes to an " + ImmutableSearchFactory.class.getName() );
+ }
+
public Worker getWorker() {
return worker;
}
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java 2010-06-30 13:44:30 UTC (rev 19871)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java 2010-06-30 13:45:30 UTC (rev 19872)
@@ -9,7 +9,7 @@
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.search.Similarity;
-import org.hibernate.search.IncrementalSearchFactory;
+import org.hibernate.search.spi.SearchFactoryIntegrator;
import org.hibernate.search.backend.BackendQueueProcessorFactory;
import org.hibernate.search.backend.LuceneIndexingParameters;
import org.hibernate.search.backend.Worker;
@@ -35,8 +35,12 @@
*
* @author Emmanuel Bernard
*/
-public class MutableSearchFactory implements StateSearchFactoryImplementor, IncrementalSearchFactory {
+public class MutableSearchFactory implements StateSearchFactoryImplementor, SearchFactoryIntegrator {
+ //a reference to the same instance of this class is help by clients and various HSearch services
+ //when changing the SearchFactory internals, only the underlying delegate should be changed.
+ //the volatile ensure that the state is replicated upong underlying factory switch.
private volatile StateSearchFactoryImplementor delegate;
+
//lock to be acquired every time the underlying searchFactory is rebuilt
private final Lock mutating = new ReentrantLock( );
Added: search/trunk/hibernate-search/src/main/java/org/hibernate/search/spi/SearchFactoryIntegrator.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/spi/SearchFactoryIntegrator.java (rev 0)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/spi/SearchFactoryIntegrator.java 2010-06-30 13:45:30 UTC (rev 19872)
@@ -0,0 +1,31 @@
+package org.hibernate.search.spi;
+
+import org.hibernate.search.SearchFactory;
+import org.hibernate.search.backend.Worker;
+
+/**
+ * This contract is considered experimental.
+ *
+ * This contract gives access to lower level APIs of Hibernate Search for
+ * frameworks integrating with it. The piece of code creating the SearchFactory should
+ * use this contract. It should however pass the higherlevel {@link }SearchFactory} contract to
+ * its clients.
+ *
+ * It also allows modification of some of the search factory internals:
+ * - today allow addition of new indexed classes.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface SearchFactoryIntegrator extends SearchFactory {
+ /**
+ * Add the following classes to the SearchFactory
+ *
+ */
+ void addClasses(Class<?>... classes);
+
+ //TODO consider accepting SearchConfiguration or SearchMapping
+
+ Worker getWorker();
+
+ void close();
+}
Modified: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java 2010-06-30 13:44:30 UTC (rev 19871)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java 2010-06-30 13:45:30 UTC (rev 19872)
@@ -6,7 +6,7 @@
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopDocs;
-import org.hibernate.search.IncrementalSearchFactory;
+import org.hibernate.search.spi.SearchFactoryIntegrator;
import org.hibernate.search.backend.Work;
import org.hibernate.search.backend.WorkType;
import org.hibernate.search.engine.SearchFactoryImplementor;
@@ -83,14 +83,14 @@
public void testAddingClassSimpleAPI() throws Exception {
ManualConfiguration configuration = new ManualConfiguration()
.addProperty( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
- //FIXME downcasting of MSF. create a getDelegate() ?
- IncrementalSearchFactory sf = (IncrementalSearchFactory) new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
- SearchFactoryImplementor sfi = (SearchFactoryImplementor) sf;
+
+ SearchFactoryIntegrator sf = new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
+
sf.addClasses( A.class );
ManualTransactionContext tc = new ManualTransactionContext();
- doIndexWork( new A(1, "Emmanuel"), 1, sfi, tc );
+ doIndexWork( new A(1, "Emmanuel"), 1, sf, tc );
tc.end();
@@ -98,7 +98,7 @@
Query luceneQuery = parser.parse( "Emmanuel" );
//we know there is only one DP
- DirectoryProvider provider = sfi
+ DirectoryProvider provider = sf
.getDirectoryProviders( A.class )[0];
IndexSearcher searcher = new IndexSearcher( provider.getDirectory(), true );
TopDocs hits = searcher.search( luceneQuery, 1000 );
@@ -110,32 +110,32 @@
tc = new ManualTransactionContext();
- doIndexWork( new B(1, "Noel"), 1, sfi, tc );
- doIndexWork( new C(1, "Vincent"), 1, sfi, tc );
+ doIndexWork( new B(1, "Noel"), 1, sf, tc );
+ doIndexWork( new C(1, "Vincent"), 1, sf, tc );
tc.end();
luceneQuery = parser.parse( "Noel" );
//we know there is only one DP
- provider = sfi.getDirectoryProviders( B.class )[0];
+ provider = sf.getDirectoryProviders( B.class )[0];
searcher = new IndexSearcher( provider.getDirectory(), true );
hits = searcher.search( luceneQuery, 1000 );
assertEquals( 1, hits.totalHits );
luceneQuery = parser.parse( "Vincent" );
- provider = sfi.getDirectoryProviders( C.class )[0];
+ provider = sf.getDirectoryProviders( C.class )[0];
searcher = new IndexSearcher( provider.getDirectory(), true );
hits = searcher.search( luceneQuery, 1000 );
assertEquals( 1, hits.totalHits );
searcher.close();
- sfi.close();
+ sf.close();
}
- private void doIndexWork(Object entity, Integer id, SearchFactoryImplementor sfi, ManualTransactionContext tc) {
+ private void doIndexWork(Object entity, Integer id, SearchFactoryIntegrator sfi, ManualTransactionContext tc) {
Work<?> work = new Work<Object>( entity, id, WorkType.INDEX );
sfi.getWorker().performWork( work, tc );
}
14 years, 6 months
Hibernate SVN: r19871 - in search/trunk/hibernate-search/src: main/java/org/hibernate/search/impl and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2010-06-30 09:44:30 -0400 (Wed, 30 Jun 2010)
New Revision: 19871
Added:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/C.java
Modified:
search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java
search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/A.java
search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
Log:
HSEARCH-397 Add simpler IncrementalSearchFactory contract
For now, only allow entities addition
Added: search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java (rev 0)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/IncrementalSearchFactory.java 2010-06-30 13:44:30 UTC (rev 19871)
@@ -0,0 +1,19 @@
+package org.hibernate.search;
+
+/**
+ * This contract is considered experimental
+ * Allow modifications of the SearchFactory internals
+ *
+ * As of today allow addition of new indexed classes.
+ *
+ * @author Emmanuel Bernard
+ */
+public interface IncrementalSearchFactory extends SearchFactory {
+ /**
+ * Add the following classes to the SearchFactory
+ *
+ */
+ void addClasses(Class<?>... classes);
+
+ //TODO consider accepting SearchConfiguration or SearchMapping
+}
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java 2010-06-30 13:43:49 UTC (rev 19870)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/MutableSearchFactory.java 2010-06-30 13:44:30 UTC (rev 19871)
@@ -3,11 +3,13 @@
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.search.Similarity;
+import org.hibernate.search.IncrementalSearchFactory;
import org.hibernate.search.backend.BackendQueueProcessorFactory;
import org.hibernate.search.backend.LuceneIndexingParameters;
import org.hibernate.search.backend.Worker;
@@ -33,8 +35,10 @@
*
* @author Emmanuel Bernard
*/
-public class MutableSearchFactory implements StateSearchFactoryImplementor {
+public class MutableSearchFactory implements StateSearchFactoryImplementor, IncrementalSearchFactory {
private volatile StateSearchFactoryImplementor delegate;
+ //lock to be acquired every time the underlying searchFactory is rebuilt
+ private final Lock mutating = new ReentrantLock( );
void setDelegate(StateSearchFactoryImplementor delegate) {
this.delegate = delegate;
@@ -179,4 +183,19 @@
public Map<DirectoryProvider<?>, DirectoryProviderData> getDirectoryProviderData() {
return delegate.getDirectoryProviderData();
}
+
+ public void addClasses(Class<?>... classes) {
+ //todo optimize the list of
+ final SearchFactoryBuilder builder = new SearchFactoryBuilder().rootFactory( this );
+ for (Class<?> type : classes) {
+ builder.addClass( type );
+ }
+ try {
+ mutating.lock();
+ builder.buildSearchFactory();
+ }
+ finally {
+ mutating.unlock();
+ }
+ }
}
Modified: search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java
===================================================================
--- search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java 2010-06-30 13:43:49 UTC (rev 19870)
+++ search/trunk/hibernate-search/src/main/java/org/hibernate/search/impl/SearchFactoryBuilder.java 2010-06-30 13:44:30 UTC (rev 19871)
@@ -5,6 +5,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -122,17 +123,13 @@
}
private SearchFactoryImplementor buildIncrementalSearchFactory() {
+ removeClassesAlreadyManaged();
+ if (classes.size() == 0) {
+ return rootFactory;
+ }
+
BuildContext buildContext = new BuildContext();
copyStateFromOldFactory(rootFactory);
- List<Class<?>> remove = new ArrayList<Class<?>>();
- for (Class<?> entity : classes) {
- if ( documentBuildersIndexedEntities.containsKey( entity ) || documentBuildersContainedEntities.containsKey(entity) ) {
- remove.add( entity );
- }
- }
- for(Class<?> entity : remove) {
- classes.remove( entity );
- }
//TODO we don't keep the reflectionManager. Is that an issue?
IncrementalSearchConfiguration cfg = new IncrementalSearchConfiguration( classes, configurationProperties );
reflectionManager = getReflectionManager( cfg );
@@ -168,6 +165,20 @@
}
+ private void removeClassesAlreadyManaged() {
+ Set<Class<?>> remove = new HashSet<Class<?>>();
+ final Map<Class<?>, DocumentBuilderContainedEntity<?>> containedEntities = rootFactory.getDocumentBuildersContainedEntities();
+ final Map<Class<?>, DocumentBuilderIndexedEntity<?>> indexedEntities = rootFactory.getDocumentBuildersIndexedEntities();
+ for (Class<?> entity : classes) {
+ if ( indexedEntities.containsKey( entity ) || containedEntities.containsKey(entity) ) {
+ remove.add( entity );
+ }
+ }
+ for(Class<?> entity : remove) {
+ classes.remove( entity );
+ }
+ }
+
private void copyStateFromOldFactory(StateSearchFactoryImplementor stateFactory) {
indexingStrategy = stateFactory.getIndexingStrategy();
documentBuildersIndexedEntities = stateFactory.getDocumentBuildersIndexedEntities();
Modified: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/A.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/A.java 2010-06-30 13:43:49 UTC (rev 19870)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/A.java 2010-06-30 13:44:30 UTC (rev 19871)
@@ -16,6 +16,11 @@
private Integer id;
private String name;
+ public A(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
@DocumentId
public Integer getId() {
return id;
Copied: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/C.java (from rev 19869, search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/A.java)
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/C.java (rev 0)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/C.java 2010-06-30 13:44:30 UTC (rev 19871)
@@ -0,0 +1,37 @@
+package org.hibernate.search.test.configuration.mutablefactory;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Field;
+import org.hibernate.search.annotations.Indexed;
+
+/**
+ * @author Emmanuel Bernard
+ */
+@Indexed
+public class C {
+ private Integer id;
+ private String name;
+
+ public C(Integer id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ @DocumentId
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ @Field
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Modified: search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java
===================================================================
--- search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java 2010-06-30 13:43:49 UTC (rev 19870)
+++ search/trunk/hibernate-search/src/test/java/org/hibernate/search/test/configuration/mutablefactory/MutableFactoryTest.java 2010-06-30 13:44:30 UTC (rev 19871)
@@ -6,6 +6,7 @@
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopDocs;
+import org.hibernate.search.IncrementalSearchFactory;
import org.hibernate.search.backend.Work;
import org.hibernate.search.backend.WorkType;
import org.hibernate.search.engine.SearchFactoryImplementor;
@@ -28,7 +29,7 @@
sf.close();
}
- public void testAddingClass() throws Exception {
+ public void testAddingClassFullModel() throws Exception {
ManualConfiguration configuration = new ManualConfiguration()
.addProperty( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
//FIXME downcasting of MSF. create a getDelegate() ?
@@ -38,14 +39,9 @@
.addClass( A.class )
.buildSearchFactory();
- A a = new A();
- a.setId( 1 );
- a.setName( "Emmanuel" );
-
ManualTransactionContext tc = new ManualTransactionContext();
- Work<A> work = new Work<A>( a, 1, WorkType.INDEX );
- sf.getWorker().performWork( work, tc );
+ doIndexWork( new A(1, "Emmanuel"), 1, sf, tc );
tc.end();
@@ -67,8 +63,7 @@
tc = new ManualTransactionContext();
- Work<B> workB = new Work<B>( new B(1, "Noel"), 1, WorkType.INDEX );
- sf.getWorker().performWork( workB, tc );
+ doIndexWork( new B(1, "Noel"), 1, sf, tc );
tc.end();
@@ -84,4 +79,64 @@
sf.close();
}
+
+ public void testAddingClassSimpleAPI() throws Exception {
+ ManualConfiguration configuration = new ManualConfiguration()
+ .addProperty( "hibernate.search.default.directory_provider", RAMDirectoryProvider.class.getName() );
+ //FIXME downcasting of MSF. create a getDelegate() ?
+ IncrementalSearchFactory sf = (IncrementalSearchFactory) new SearchFactoryBuilder().configuration( configuration ).buildSearchFactory();
+ SearchFactoryImplementor sfi = (SearchFactoryImplementor) sf;
+ sf.addClasses( A.class );
+
+ ManualTransactionContext tc = new ManualTransactionContext();
+
+ doIndexWork( new A(1, "Emmanuel"), 1, sfi, tc );
+
+ tc.end();
+
+ QueryParser parser = new QueryParser( SearchTestCase.getTargetLuceneVersion(), "name", SearchTestCase.standardAnalyzer );
+ Query luceneQuery = parser.parse( "Emmanuel" );
+
+ //we know there is only one DP
+ DirectoryProvider provider = sfi
+ .getDirectoryProviders( A.class )[0];
+ IndexSearcher searcher = new IndexSearcher( provider.getDirectory(), true );
+ TopDocs hits = searcher.search( luceneQuery, 1000 );
+ assertEquals( 1, hits.totalHits );
+
+ searcher.close();
+
+ sf.addClasses( B.class, C.class );
+
+ tc = new ManualTransactionContext();
+
+ doIndexWork( new B(1, "Noel"), 1, sfi, tc );
+ doIndexWork( new C(1, "Vincent"), 1, sfi, tc );
+
+ tc.end();
+
+ luceneQuery = parser.parse( "Noel" );
+
+ //we know there is only one DP
+ provider = sfi.getDirectoryProviders( B.class )[0];
+ searcher = new IndexSearcher( provider.getDirectory(), true );
+ hits = searcher.search( luceneQuery, 1000 );
+ assertEquals( 1, hits.totalHits );
+
+ luceneQuery = parser.parse( "Vincent" );
+
+ provider = sfi.getDirectoryProviders( C.class )[0];
+ searcher = new IndexSearcher( provider.getDirectory(), true );
+ hits = searcher.search( luceneQuery, 1000 );
+ assertEquals( 1, hits.totalHits );
+
+ searcher.close();
+
+ sfi.close();
+ }
+
+ private void doIndexWork(Object entity, Integer id, SearchFactoryImplementor sfi, ManualTransactionContext tc) {
+ Work<?> work = new Work<Object>( entity, id, WorkType.INDEX );
+ sfi.getWorker().performWork( work, tc );
+ }
}
14 years, 6 months
Hibernate SVN: r19870 - in core/branches/gradle2/hibernate-infinispan: src/test/resources and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-06-30 09:43:49 -0400 (Wed, 30 Jun 2010)
New Revision: 19870
Modified:
core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
core/branches/gradle2/hibernate-infinispan/src/test/resources/hibernate.properties
Log:
update infinispan module to use h2 for its unit tests
Modified: core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle
===================================================================
--- core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 13:43:35 UTC (rev 19869)
+++ core/branches/gradle2/hibernate-infinispan/hibernate-infinispan.gradle 2010-06-30 13:43:49 UTC (rev 19870)
@@ -28,6 +28,7 @@
testCompile( [group: 'com.experlog', name: 'xapool', version: '1.5.0'] )
testCompile( [group: 'jboss.jbossts', name: 'jbossjta', version: '4.9.0.GA'] )
testCompile( libraries.jta )
+ testCompile( libraries.h2 )
testCompile( [group: 'org.rhq.helpers', name: 'rhq-pluginAnnotations', version: '1.4.0.B01'] )
testRuntime( libraries.javassist )
}
Modified: core/branches/gradle2/hibernate-infinispan/src/test/resources/hibernate.properties
===================================================================
--- core/branches/gradle2/hibernate-infinispan/src/test/resources/hibernate.properties 2010-06-30 13:43:35 UTC (rev 19869)
+++ core/branches/gradle2/hibernate-infinispan/src/test/resources/hibernate.properties 2010-06-30 13:43:49 UTC (rev 19870)
@@ -21,9 +21,9 @@
# 51 Franklin Street, Fifth Floor #
# Boston, MA 02110-1301 USA #
################################################################################
-hibernate.dialect org.hibernate.dialect.HSQLDialect
-hibernate.connection.driver_class org.hsqldb.jdbcDriver
-hibernate.connection.url jdbc:hsqldb:mem:/test
+hibernate.dialect org.hibernate.dialect.H2Dialect
+hibernate.connection.driver_class org.h2.Driver
+hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE
hibernate.connection.username sa
hibernate.connection.password
14 years, 6 months