Example usage for org.apache.lucene.queryparser.classic ParseException ParseException

List of usage examples for org.apache.lucene.queryparser.classic ParseException ParseException

Introduction

In this page you can find the example usage for org.apache.lucene.queryparser.classic ParseException ParseException.

Prototype


public ParseException() 

Source Link

Document

The following constructors are for use by you for whatever purpose you can think of.

Usage

From source file:com.epam.wilma.message.search.lucene.search.LuceneSearchEngineTest.java

License:Open Source License

@Test(expectedExceptions = QueryCannotBeParsedException.class)
public void testSearchForTextWhenCannotParseQueryShouldThrowError() throws IOException, ParseException {
    //GIVEN//w  ww . j  av  a 2  s . co  m
    given(readerFactory.create(true)).willReturn(indexReader);
    given(searcherFactory.create(indexReader)).willReturn(indexSearcher);
    given(queryParser.parse(TEXT)).willThrow(new ParseException());
    //WHEN
    underTest.searchForText(TEXT);
    //THEN it should throw exception
}