cfg.setProperty( "hibernate.search.Animal.sharding_strategy.nbr_of_shards", "2" );
cfg.setProperty( "hibernate.search.Animal.0.indexName", "Animal00" );
}
public void testIdShardingStrategy() {
DirectoryProvider[] dps = new DirectoryProvider[] { new RAMDirectoryProvider(), new RAMDirectoryProvider() };
IdHashShardingStrategy shardingStrategy = new IdHashShardingStrategy();
shardingStrategy.initialize( null, dps);
assertTrue( dps[1] == shardingStrategy.getDirectoryProviderForAddition( Animal.class, 1, "1", null) );
assertTrue( dps[0] == shardingStrategy.getDirectoryProviderForAddition( Animal.class, 2, "2", null) );
}