+ ITaxonServiceConfigurator configurator = new TaxonServiceConfiguratorImpl();\r
+ configurator.setTitleSearchString("Weiß%");\r
+ configurator.setMatchMode(MatchMode.BEGINNING);\r
+ configurator.setDoTaxa(false);\r
+ configurator.setDoSynonyms(false);\r
+ configurator.setDoNamesWithoutTaxa(false);\r
+ configurator.setDoTaxaByCommonNames(true);\r
+\r
+ Pager<IdentifiableEntity> pager;\r
+\r
+ long startMillis = System.currentTimeMillis();\r
+ for (int indx = 0; indx < BENCHMARK_ROUNDS; indx++) {\r
+ pager = taxonService.findTaxaAndNames(configurator);\r
+ if (logger.isDebugEnabled()) {\r
+ logger.debug("[" + indx + "]" + pager.getRecords().get(0).getTitleCache());\r
+ }\r
+ }\r
+ double duration = ((double) (System.currentTimeMillis() - startMillis)) / BENCHMARK_ROUNDS;\r
+ logger.info("Benchmark result - [find taxon by CommonName via HQL] : " + duration + "ms (" + BENCHMARK_ROUNDS + " benchmark rounds )");\r
+ }\r
+\r
+ @SuppressWarnings("rawtypes")\r
+ @Test\r
+ @Ignore //there seems to be a bug in unitils 1.0 which prevents from adding data to an non blank db. This problem might be fixed in recent versions of unitils version > 3.3\r
+ @DataSet\r
+ public final void testFindByCommonNameLuceneBenchmark() throws CorruptIndexException, IOException, ParseException {\r
+\r
+// printDataSet(System.err, new String[] { "TaxonBase" });\r
+\r
+ createRandomTaxonWithCommonName(NUM_OF_NEW_RADOM_ENTITIES);\r
+\r
+ refreshLuceneIndex();\r
+\r
+ Pager<SearchResult<TaxonBase>> pager;\r
+\r
+ long startMillis = System.currentTimeMillis();\r
+ for (int indx = 0; indx < BENCHMARK_ROUNDS; indx++) {\r
+ pager = taxonService.findByDescriptionElementFullText(CommonTaxonName.class, "Weiß*", null, null, null, null);\r
+ if (logger.isDebugEnabled()) {\r
+ logger.debug("[" + indx + "]" + pager.getRecords().get(0).getEntity().getTitleCache());\r
+ }\r
+ }\r
+ double duration = ((double) (System.currentTimeMillis() - startMillis)) / BENCHMARK_ROUNDS;\r
+ logger.info("Benchmark result - [find taxon by CommonName via lucene] : " + duration + "ms (" + BENCHMARK_ROUNDS + " benchmark rounds )");\r
+ }\r
+\r
+// @Test\r