Project

General

Profile

Revision d4547dee

IDd4547dee7347b38b64d07a0f6f1784800edd25e5
Parent ad2424dc
Child 3ca8a283

Added by Patrick Plitzner over 4 years ago

ref #5752 wrap specific exception to avoid dependency on lucene library

View differences:

cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/TaxonListController.java
42 42
import eu.etaxonomy.cdm.api.service.dto.MarkedEntityDTO;
43 43
import eu.etaxonomy.cdm.api.service.pager.Pager;
44 44
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
45
import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
45 46
import eu.etaxonomy.cdm.api.service.search.SearchResult;
46 47
import eu.etaxonomy.cdm.model.common.CdmBase;
47 48
import eu.etaxonomy.cdm.model.common.DefinedTerm;
......
174 175
            HttpServletRequest request,
175 176
            HttpServletResponse response
176 177
            )
177
             throws IOException, ParseException, LuceneMultiSearchException {
178
             throws IOException, LuceneParseException, LuceneMultiSearchException {
178 179

  
179 180

  
180 181
        logger.info("search : " + requestPathAndQuery(request) );
......
326 327
            HttpServletRequest request,
327 328
            HttpServletResponse response
328 329
            )
329
             throws IOException, ParseException {
330
             throws IOException, LuceneParseException {
330 331

  
331 332
         logger.info("findByDescriptionElementFullText : " + requestPathAndQuery(request) );
332 333

  
......
369 370
            HttpServletRequest request,
370 371
            HttpServletResponse response
371 372
            )
372
             throws IOException, ParseException {
373
             throws IOException, LuceneParseException {
373 374

  
374 375
         logger.info("findByFullText : " + requestPathAndQuery(request)  );
375 376

  
......
403 404
            HttpServletRequest request,
404 405
            HttpServletResponse response
405 406
            )
406
             throws IOException, ParseException, LuceneMultiSearchException {
407
             throws IOException, LuceneParseException, LuceneMultiSearchException {
407 408

  
408 409
         logger.info("findByEverythingFullText : " + requestPathAndQuery(request) );
409 410

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java
15 15
import java.util.Set;
16 16
import java.util.UUID;
17 17

  
18
import org.apache.lucene.index.CorruptIndexException;
19
import org.apache.lucene.queryparser.classic.ParseException;
20

  
21 18
import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
22 19
import eu.etaxonomy.cdm.api.service.config.IncludedTaxonConfiguration;
23 20
import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator;
......
30 27
import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
31 28
import eu.etaxonomy.cdm.api.service.pager.Pager;
32 29
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
30
import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
33 31
import eu.etaxonomy.cdm.api.service.search.SearchResult;
34 32
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
35 33
import eu.etaxonomy.cdm.model.common.DefinedTerm;
......
512 510
     * @return a paged list of instances of type T matching the queryString and
513 511
     *         the additional filter criteria
514 512
     * @return
515
     * @throws CorruptIndexException
513
     * @throws LuceneCorruptIndexException
516 514
     * @throws IOException
517
     * @throws ParseException
515
     * @throws LuceneParseException
518 516
     * @throws LuceneMultiSearchException
519 517
     * @deprecated this search should fully be covered by the new method
520 518
     *      {@link #findTaxaAndNamesByFullText(EnumSet, String, Classification, Set, List, boolean, Integer, Integer, List, List)}
......
523 521
    @Deprecated
524 522
    public Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString,
525 523
            Classification classification, List<Language> languages, boolean highlightFragments,
526
            Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException;
524
            Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException, LuceneMultiSearchException;
527 525

  
528 526
    /**
529 527
     * Searches for TaxonBase instances using the TaxonBase free text index.
......
563 561
     *            {@link IBeanInitializer#initialize(Object, List)}
564 562
     * @return a paged list of instances of type T matching the queryString and
565 563
     *         the additional filter criteria
566
     * @throws CorruptIndexException
564
     * @throws LuceneCorruptIndexException
567 565
     * @throws IOException
568
     * @throws ParseException
566
     * @throws LuceneParseException
569 567
     */
570 568
    public Pager<SearchResult<TaxonBase>> findByFullText(Class<? extends TaxonBase> clazz, String queryString, Classification classification,
571 569
            List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
572
            List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException;
570
            List<String> propertyPaths) throws IOException, LuceneParseException;
573 571

  
574 572

  
575 573
    /**
......
596 594
     *            this method can return - see {@link IBeanInitializer#initialize(Object, List)}
597 595
     * @return a paged list of instances of {@link Taxon} instances
598 596
     * @throws IOException
599
     * @throws ParseException
597
     * @throws LuceneParseException
600 598
     */
601 599
    public Pager<SearchResult<TaxonBase>> findByDistribution(List<NamedArea> areaFilter, List<PresenceAbsenceTerm> statusFilter,
602 600
            Classification classification,
603 601
            Integer pageSize, Integer pageNumber,
604
            List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, ParseException;
602
            List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException;
605 603

  
606 604
    /**
607 605
     * Searches for TaxonBase instances using the TaxonBase free text index.
......
643 641
     *            this method can return - see {@link IBeanInitializer#initialize(Object, List)}
644 642
     * @return a paged list of instances of {@link Taxon}, {@link Synonym}, matching the queryString and
645 643
     *         the additional filter criteria
646
     * @throws CorruptIndexException
644
     * @throws LuceneCorruptIndexException
647 645
     * @throws IOException
648
     * @throws ParseException
646
     * @throws LuceneParseException
649 647
     * @throws LuceneMultiSearchException
650 648
     */
651 649
    public Pager<SearchResult<TaxonBase>> findTaxaAndNamesByFullText(
652 650
            EnumSet<TaxaAndNamesSearchMode> searchModes,
653 651
            String queryString, Classification classification, Set<NamedArea> namedAreas, Set<PresenceAbsenceTerm> distributionStatus,
654 652
            List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
655
            List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException;
653
            List<String> propertyPaths) throws IOException, LuceneParseException, LuceneMultiSearchException;
656 654

  
657 655
    /**
658 656
     * Searches for TaxonBase instances by using the DescriptionElement free text index.
......
694 692
     * @return a paged list of instances of type T matching the queryString and
695 693
     *         the additional filter criteria
696 694
     * @throws IOException
697
     * @throws CorruptIndexException
698
     * @throws ParseException
695
     * @throws LuceneCorruptIndexException
696
     * @throws LuceneParseException
699 697
     */
700
    public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz, String queryString, Classification classification, List<Feature> features, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException;
698
    public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz, String queryString, Classification classification, List<Feature> features, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException;
701 699

  
702 700

  
703 701
    /**
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
24 24

  
25 25
import org.apache.commons.lang.StringUtils;
26 26
import org.apache.log4j.Logger;
27
import org.apache.lucene.index.CorruptIndexException;
28 27
import org.apache.lucene.queryparser.classic.ParseException;
29 28
import org.apache.lucene.sandbox.queries.DuplicateFilter;
30 29
import org.apache.lucene.search.BooleanClause.Occur;
......
58 57
import eu.etaxonomy.cdm.api.service.search.ISearchResultBuilder;
59 58
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearch;
60 59
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
60
import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
61 61
import eu.etaxonomy.cdm.api.service.search.LuceneSearch;
62 62
import eu.etaxonomy.cdm.api.service.search.QueryFactory;
63 63
import eu.etaxonomy.cdm.api.service.search.SearchResult;
......
1434 1434
    public Pager<SearchResult<TaxonBase>> findByFullText(
1435 1435
            Class<? extends TaxonBase> clazz, String queryString,
1436 1436
            Classification classification, List<Language> languages,
1437
            boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
1437
            boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException {
1438 1438

  
1439 1439

  
1440 1440
        LuceneSearch luceneSearch = prepareFindByFullTextSearch(clazz, queryString, classification, languages, highlightFragments, null);
1441 1441

  
1442 1442
        // --- execute search
1443
        TopGroups<BytesRef> topDocsResultSet = luceneSearch.executeSearch(pageSize, pageNumber);
1443
        TopGroups<BytesRef> topDocsResultSet;
1444
        try {
1445
            topDocsResultSet = luceneSearch.executeSearch(pageSize, pageNumber);
1446
        } catch (ParseException e) {
1447
            LuceneParseException luceneParseException = new LuceneParseException(e.getMessage());
1448
            luceneParseException.setStackTrace(e.getStackTrace());
1449
            throw luceneParseException;
1450
        }
1444 1451

  
1445 1452
        Map<CdmBaseType, String> idFieldMap = new HashMap<CdmBaseType, String>();
1446 1453
        idFieldMap.put(CdmBaseType.TAXON, "id");
......
1458 1465
    public Pager<SearchResult<TaxonBase>> findByDistribution(List<NamedArea> areaFilter, List<PresenceAbsenceTerm> statusFilter,
1459 1466
            Classification classification,
1460 1467
            Integer pageSize, Integer pageNumber,
1461
            List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, ParseException {
1468
            List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException {
1462 1469

  
1463 1470
        LuceneSearch luceneSearch = prepareByDistributionSearch(areaFilter, statusFilter, classification);
1464 1471

  
1465 1472
        // --- execute search
1466
        TopGroups<BytesRef> topDocsResultSet = luceneSearch.executeSearch(pageSize, pageNumber);
1473
        TopGroups<BytesRef> topDocsResultSet;
1474
        try {
1475
            topDocsResultSet = luceneSearch.executeSearch(pageSize, pageNumber);
1476
        } catch (ParseException e) {
1477
            LuceneParseException luceneParseException = new LuceneParseException(e.getMessage());
1478
            luceneParseException.setStackTrace(e.getStackTrace());
1479
            throw luceneParseException;
1480
        }
1467 1481

  
1468 1482
        Map<CdmBaseType, String> idFieldMap = new HashMap<CdmBaseType, String>();
1469 1483
        idFieldMap.put(CdmBaseType.TAXON, "id");
......
1599 1613
            Set<NamedArea> namedAreas, Set<PresenceAbsenceTerm> distributionStatus, List<Language> languages,
1600 1614
            boolean highlightFragments, Integer pageSize,
1601 1615
            Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
1602
            throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
1616
            throws IOException, LuceneParseException, LuceneMultiSearchException {
1603 1617

  
1604 1618
        // FIXME: allow taxonomic ordering
1605 1619
        //  hql equivalent:  order by t.name.genusOrUninomial, case when t.name.specificEpithet like '\"%\"' then 1 else 0 end, t.name.specificEpithet, t.name.rank desc, t.name.nameCache";
......
1853 1867

  
1854 1868

  
1855 1869
        // --- execute search
1856
        TopGroups<BytesRef> topDocsResultSet = multiSearch.executeSearch(pageSize, pageNumber);
1870
        TopGroups<BytesRef> topDocsResultSet;
1871
        try {
1872
            topDocsResultSet = multiSearch.executeSearch(pageSize, pageNumber);
1873
        } catch (ParseException e) {
1874
            LuceneParseException luceneParseException = new LuceneParseException(e.getMessage());
1875
            luceneParseException.setStackTrace(e.getStackTrace());
1876
            throw luceneParseException;
1877
        }
1857 1878

  
1858 1879
        // --- initialize taxa, highlight matches ....
1859 1880
        ISearchResultBuilder searchResultBuilder = new SearchResultBuilder(multiSearch, multiSearch.getQuery());
......
1959 1980
    public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(
1960 1981
            Class<? extends DescriptionElementBase> clazz, String queryString,
1961 1982
            Classification classification, List<Feature> features, List<Language> languages,
1962
            boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
1983
            boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException {
1963 1984

  
1964 1985

  
1965 1986
        LuceneSearch luceneSearch = prepareByDescriptionElementFullTextSearch(clazz, queryString, classification, features, languages, highlightFragments);
1966 1987

  
1967 1988
        // --- execute search
1968
        TopGroups<BytesRef> topDocsResultSet = luceneSearch.executeSearch(pageSize, pageNumber);
1989
        TopGroups<BytesRef> topDocsResultSet;
1990
        try {
1991
            topDocsResultSet = luceneSearch.executeSearch(pageSize, pageNumber);
1992
        } catch (ParseException e) {
1993
            LuceneParseException luceneParseException = new LuceneParseException(e.getMessage());
1994
            luceneParseException.setStackTrace(e.getStackTrace());
1995
            throw luceneParseException;
1996
        }
1969 1997

  
1970 1998
        Map<CdmBaseType, String> idFieldMap = new HashMap<CdmBaseType, String>();
1971 1999
        idFieldMap.put(CdmBaseType.DESCRIPTION_ELEMENT, "inDescription.taxon.id");
......
1985 2013
    @Override
1986 2014
    public Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString,
1987 2015
            Classification classification, List<Language> languages, boolean highlightFragments,
1988
            Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
2016
            Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException, LuceneMultiSearchException {
1989 2017

  
1990 2018
        LuceneSearch luceneSearchByDescriptionElement = prepareByDescriptionElementFullTextSearch(null, queryString, classification, null, languages, highlightFragments);
1991 2019
        LuceneSearch luceneSearchByTaxonBase = prepareFindByFullTextSearch(null, queryString, classification, languages, highlightFragments, null);
......
1993 2021
        LuceneMultiSearch multiSearch = new LuceneMultiSearch(luceneIndexToolProvider, luceneSearchByDescriptionElement, luceneSearchByTaxonBase);
1994 2022

  
1995 2023
        // --- execute search
1996
        TopGroups<BytesRef> topDocsResultSet = multiSearch.executeSearch(pageSize, pageNumber);
2024
        TopGroups<BytesRef> topDocsResultSet;
2025
        try {
2026
            topDocsResultSet = multiSearch.executeSearch(pageSize, pageNumber);
2027
        } catch (ParseException e) {
2028
            LuceneParseException luceneParseException = new LuceneParseException(e.getMessage());
2029
            luceneParseException.setStackTrace(e.getStackTrace());
2030
            throw luceneParseException;
2031
        }
1997 2032

  
1998 2033
        // --- initialize taxa, highlight matches ....
1999 2034
        ISearchResultBuilder searchResultBuilder = new SearchResultBuilder(multiSearch, multiSearch.getQuery());
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/search/LuceneParseException.java
1
/**
2
* Copyright (C) 2017 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.api.service.search;
10

  
11
/**
12
 * Wrapper class for org.apache.lucene.queryparser.classic.ParseException
13
 * @author pplitzner
14
 * @since Apr 7, 2017
15
 *
16
 */
17
@SuppressWarnings("serial")
18
public class LuceneParseException extends Exception {
19

  
20
    /**
21
     * @param message
22
     */
23
    public LuceneParseException(String message) {
24
        super(message);
25
        // TODO Auto-generated constructor stub
26
    }
27

  
28
}
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/TaxonServiceSearchTest.java
26 26
import org.apache.log4j.Level;
27 27
import org.apache.log4j.Logger;
28 28
import org.apache.lucene.document.Document;
29
import org.apache.lucene.index.CorruptIndexException;
30
import org.apache.lucene.queryparser.classic.ParseException;
31 29
import org.junit.Assert;
32 30
import org.junit.Before;
33 31
import org.junit.Ignore;
......
40 38
import eu.etaxonomy.cdm.api.service.pager.Pager;
41 39
import eu.etaxonomy.cdm.api.service.search.ICdmMassIndexer;
42 40
import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
41
import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
43 42
import eu.etaxonomy.cdm.api.service.search.SearchResult;
44 43
import eu.etaxonomy.cdm.common.UTF8;
45 44
import eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor;
......
160 159
    @SuppressWarnings("rawtypes")
161 160
    @Test
162 161
    @DataSet
163
    public final void testPurgeAndReindex() throws CorruptIndexException, IOException, ParseException {
162
    public final void testPurgeAndReindex() throws IOException, LuceneParseException {
164 163

  
165 164
        refreshLuceneIndex();
166 165

  
......
186 185
    @SuppressWarnings("rawtypes")
187 186
    @Test
188 187
    @DataSet
189
    public final void testFindByDescriptionElementFullText_CommonName() throws CorruptIndexException, IOException,
190
            ParseException {
188
    public final void testFindByDescriptionElementFullText_CommonName() throws IOException,
189
            LuceneParseException {
191 190

  
192 191
        refreshLuceneIndex();
193 192

  
......
217 216
    @SuppressWarnings("rawtypes")
218 217
    @Test
219 218
    @DataSet
220
    public final void testFindByDescriptionElementFullText_Distribution() throws CorruptIndexException, IOException, ParseException {
219
    public final void testFindByDescriptionElementFullText_Distribution() throws IOException, LuceneParseException {
221 220

  
222 221
        refreshLuceneIndex();
223 222

  
......
233 232
    @SuppressWarnings("rawtypes")
234 233
    @Test
235 234
    @DataSet
236
    public final void testFindByDescriptionElementFullText_wildcard() throws CorruptIndexException, IOException, ParseException {
235
    public final void testFindByDescriptionElementFullText_wildcard() throws IOException, LuceneParseException {
237 236

  
238 237
        refreshLuceneIndex();
239 238

  
......
246 245
    /**
247 246
     * Regression test for #3113 (hibernate search: wildcard query can cause BooleanQuery$TooManyClauses: maxClauseCount is set to 1024)
248 247
     *
249
     * @throws CorruptIndexException
250 248
     * @throws IOException
251
     * @throws ParseException
249
     * @throws LuceneParseException
252 250
     */
253 251
    @SuppressWarnings("rawtypes")
254 252
    @Test
255 253
    @DataSet
256
    public final void testFindByDescriptionElementFullText_TooManyClauses() throws CorruptIndexException, IOException, ParseException {
254
    public final void testFindByDescriptionElementFullText_TooManyClauses() throws IOException, LuceneParseException {
257 255

  
258 256
        // generate 1024 terms to reproduce the bug
259 257
        TaxonDescription description = (TaxonDescription) descriptionService.find(UUID.fromString(D_ABIES_ALBA_UUID));
......
278 276
    /**
279 277
     * Regression test for #3116 (fulltext search: always only one page of results)
280 278
     *
281
     * @throws CorruptIndexException
282 279
     * @throws IOException
283
     * @throws ParseException
280
     * @throws LuceneParseException
284 281
     */
285 282
    @SuppressWarnings("rawtypes")
286 283
    @Test
287 284
    @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class)
288 285
    @Ignore
289
    public final void testFullText_Paging() throws CorruptIndexException, IOException, ParseException {
286
    public final void testFullText_Paging() throws IOException, LuceneParseException {
290 287

  
291 288
        Reference sec = ReferenceFactory.newDatabase();
292 289
        referenceService.save(sec);
......
330 327
     * see {@link #testFullText_ScoreAndOrder_2()} for the complement
331 328
     * test with matches in multiple TextData per taxon
332 329
     *
333
     * @throws CorruptIndexException
334 330
     * @throws IOException
335
     * @throws ParseException
331
     * @throws LuceneParseException
336 332
     */
337 333
    @SuppressWarnings("rawtypes")
338 334
    @Test
339 335
    @DataSet
340 336
    @Ignore // test fails, maybe the assumptions made here are not compatible with the lucene scoring mechanism see http://lucene.apache.org/core/3_6_1/scoring.html
341
    public final void testFullText_ScoreAndOrder_1() throws CorruptIndexException, IOException, ParseException {
337
    public final void testFullText_ScoreAndOrder_1() throws IOException, LuceneParseException {
342 338

  
343 339
        int numOfTaxa = 3;
344 340

  
......
376 372
     * see {@link #testFullText_ScoreAndOrder_1()} for the complement
377 373
     * test with matches in a single TextData per taxon
378 374
     *
379
     * @throws CorruptIndexException
380 375
     * @throws IOException
381
     * @throws ParseException
376
     * @throws LuceneParseException
382 377
     */
383 378
    @SuppressWarnings("rawtypes")
384 379
    @Test
385 380
    @DataSet
386 381
    @Ignore // test fails, maybe the assumptions made here are not compatible with the lucene scoring mechanism see http://lucene.apache.org/core/3_6_1/scoring.html
387
    public final void testFullText_ScoreAndOrder_2() throws CorruptIndexException, IOException, ParseException {
382
    public final void testFullText_ScoreAndOrder_2() throws IOException, LuceneParseException {
388 383

  
389 384
        int numOfTaxa = 3;
390 385

  
......
418 413

  
419 414

  
420 415
    /**
421
     * @throws CorruptIndexException
422 416
     * @throws IOException
423
     * @throws ParseException
417
     * @throws LuceneParseException
424 418
     * @throws LuceneMultiSearchException
425 419
     */
426 420
    @Test
427 421
    @DataSet
428
    public final void testFullText_Grouping() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
422
    public final void testFullText_Grouping() throws IOException, LuceneParseException, LuceneMultiSearchException {
429 423

  
430 424
        TaxonDescription description = (TaxonDescription) descriptionService.find(UUID.fromString(D_ABIES_ALBA_UUID));
431 425
        Set<String> uniqueRandomStrs = new HashSet<String>(1024);
......
473 467
    @Test
474 468
    @DataSet
475 469
    @Ignore
476
    public final void testFindByDescriptionElementFullText_TextData() throws CorruptIndexException, IOException, ParseException {
470
    public final void testFindByDescriptionElementFullText_TextData() throws IOException, LuceneParseException {
477 471

  
478 472
        refreshLuceneIndex();
479 473

  
......
520 514
    @SuppressWarnings("rawtypes")
521 515
    @Test
522 516
    @DataSet
523
    public final void testFindByDescriptionElementFullText_MultipleWords() throws CorruptIndexException, IOException, ParseException {
517
    public final void testFindByDescriptionElementFullText_MultipleWords() throws IOException, LuceneParseException {
524 518

  
525 519
        refreshLuceneIndex();
526 520

  
......
554 548
    @SuppressWarnings("rawtypes")
555 549
    @Test
556 550
    @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class)
557
    public final void testFindByDescriptionElementFullText_modify_DescriptionElement() throws CorruptIndexException, IOException, ParseException {
551
    public final void testFindByDescriptionElementFullText_modify_DescriptionElement() throws IOException, LuceneParseException {
558 552

  
559 553
        refreshLuceneIndex();
560 554

  
......
608 602
    @SuppressWarnings("rawtypes")
609 603
    @Test
610 604
    @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class)
611
    public final void testFindByDescriptionElementFullText_modify_Taxon() throws CorruptIndexException, IOException, ParseException {
605
    public final void testFindByDescriptionElementFullText_modify_Taxon() throws IOException, LuceneParseException {
612 606

  
613 607
        refreshLuceneIndex();
614 608

  
......
658 652
    @SuppressWarnings("rawtypes")
659 653
    @Test
660 654
    @DataSet
661
    public final void testFindByDescriptionElementFullText_modify_Classification() throws CorruptIndexException, IOException, ParseException {
655
    public final void testFindByDescriptionElementFullText_modify_Classification() throws IOException, LuceneParseException {
662 656

  
663 657
        refreshLuceneIndex();
664 658

  
......
709 703
    @SuppressWarnings("rawtypes")
710 704
    @Test
711 705
    @DataSet
712
    public final void testFindByDescriptionElementFullText_CategoricalData() throws CorruptIndexException, IOException, ParseException {
706
    public final void testFindByDescriptionElementFullText_CategoricalData() throws IOException, LuceneParseException {
713 707

  
714 708
        // add CategoricalData
715 709
        DescriptionBase d_abies_balsamea = descriptionService.find(UUID.fromString(D_ABIES_BALSAMEA_UUID));
......
761 755
    @SuppressWarnings("rawtypes")
762 756
    @Test
763 757
    @DataSet
764
    public final void testFindByDescriptionElementFullText_Highlighting() throws CorruptIndexException, IOException, ParseException {
758
    public final void testFindByDescriptionElementFullText_Highlighting() throws IOException, LuceneParseException {
765 759

  
766 760
        refreshLuceneIndex();
767 761

  
......
801 795

  
802 796
    @Test
803 797
    @DataSet(loadStrategy=CleanSweepInsertLoadStrategy.class)
804
    public final void testFindByFullText() throws CorruptIndexException, IOException, ParseException {
798
    public final void testFindByFullText() throws IOException, LuceneParseException {
805 799

  
806 800
        refreshLuceneIndex();
807 801

  
......
833 827

  
834 828
    @Test
835 829
    @DataSet
836
    public final void testPrepareByAreaSearch() throws IOException, ParseException {
830
    public final void testPrepareByAreaSearch() throws IOException, LuceneParseException {
837 831

  
838 832
        List<PresenceAbsenceTerm> statusFilter = new ArrayList<PresenceAbsenceTerm>();
839 833
        List<NamedArea> areaFilter = new ArrayList<NamedArea>();
......
848 842

  
849 843
    @Test
850 844
    @DataSet
851
    public final void testFindTaxaAndNamesByFullText() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
845
    public final void testFindTaxaAndNamesByFullText() throws IOException, LuceneParseException, LuceneMultiSearchException {
852 846

  
853 847
        refreshLuceneIndex();
854 848

  
......
906 900

  
907 901
    @Test
908 902
    @DataSet
909
    public final void testFindTaxaAndNamesByFullText_PhraseQuery() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
903
    public final void testFindTaxaAndNamesByFullText_PhraseQuery() throws IOException, LuceneParseException, LuceneMultiSearchException {
910 904

  
911 905
        refreshLuceneIndex();
912 906

  
......
935 929

  
936 930
    @Test
937 931
    @DataSet
938
    public final void testFindTaxaAndNamesByFullText_Sort() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
932
    public final void testFindTaxaAndNamesByFullText_Sort() throws IOException, LuceneParseException, LuceneMultiSearchException {
939 933

  
940 934
        refreshLuceneIndex();
941 935

  
......
985 979

  
986 980
    @Test
987 981
    @DataSet
988
    public final void testFindTaxaAndNamesByFullText_AreaFilter() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
982
    public final void testFindTaxaAndNamesByFullText_AreaFilter() throws IOException, LuceneParseException, LuceneMultiSearchException {
989 983

  
990 984
        refreshLuceneIndex();
991 985

  
......
1086 1080
    @Test
1087 1081
    @DataSet
1088 1082
    @Ignore // remove once http://dev.e-taxonomy.eu/trac/ticket/5477 is solved
1089
    public final void testFindTaxaAndNamesByFullText_AreaFilter_issue5477() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
1083
    public final void testFindTaxaAndNamesByFullText_AreaFilter_issue5477() throws IOException, LuceneParseException, LuceneMultiSearchException {
1090 1084

  
1091 1085
        Set<NamedArea> a_germany_canada_russia = new HashSet<NamedArea>();
1092 1086
        a_germany_canada_russia.add(germany);
......
1121 1115
    /**
1122 1116
     * Regression test for #3119: fulltext search: Entity always null whatever search
1123 1117
     *
1124
     * @throws CorruptIndexException
1125 1118
     * @throws IOException
1126
     * @throws ParseException
1119
     * @throws LuceneParseException
1127 1120
     * @throws LuceneMultiSearchException
1128 1121
     */
1129 1122
    @Test
1130 1123
    @DataSet
1131
    public final void testFindByEverythingFullText() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
1124
    public final void testFindByEverythingFullText() throws IOException, LuceneParseException, LuceneMultiSearchException {
1132 1125

  
1133 1126
        refreshLuceneIndex();
1134 1127

  
......
1153 1146

  
1154 1147
    @Test
1155 1148
    @DataSet
1156
    public final void findByEveryThingFullText() throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
1149
    public final void findByEveryThingFullText() throws IOException, LuceneParseException, LuceneMultiSearchException {
1157 1150

  
1158 1151
        refreshLuceneIndex();
1159 1152

  
......
1178 1171
//    @SuppressWarnings("rawtypes")
1179 1172
//    @Test
1180 1173
//    @DataSet
1181
//    public final void benchmarkFindTaxaAndNamesHql() throws CorruptIndexException, IOException, ParseException {
1174
//    public final void benchmarkFindTaxaAndNamesHql() throws IOException, LuceneParseException {
1182 1175
//
1183 1176
//        createRandomTaxonWithCommonName(NUM_OF_NEW_RADOM_ENTITIES);
1184 1177
//
......
1206 1199
    @SuppressWarnings("rawtypes")
1207 1200
    @Test
1208 1201
    @DataSet
1209
    public final void benchmarkFindByCommonNameHql() throws CorruptIndexException, IOException, ParseException {
1202
    public final void benchmarkFindByCommonNameHql() throws IOException, LuceneParseException {
1210 1203

  
1211 1204
//        printDataSet(System.err, new String[] { "TaxonBase" });
1212 1205

  
......
1236 1229
    @SuppressWarnings("rawtypes")
1237 1230
    @Test
1238 1231
    @DataSet
1239
    public final void benchmarkFindByCommonNameLucene() throws CorruptIndexException, IOException, ParseException {
1232
    public final void benchmarkFindByCommonNameLucene() throws IOException, LuceneParseException {
1240 1233

  
1241 1234
        createRandomTaxonWithCommonName(NUM_OF_NEW_RADOM_ENTITIES);
1242 1235

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)