Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 74595 invoked from network); 27 Aug 2005 11:20:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Aug 2005 11:20:31 -0000 Received: (qmail 98179 invoked by uid 500); 27 Aug 2005 11:20:31 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 98163 invoked by uid 500); 27 Aug 2005 11:20:31 -0000 Mailing-List: contact java-commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-commits@lucene.apache.org Received: (qmail 98150 invoked by uid 99); 27 Aug 2005 11:20:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Aug 2005 04:20:30 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 27 Aug 2005 04:20:47 -0700 Received: (qmail 74586 invoked by uid 65534); 27 Aug 2005 11:20:29 -0000 Message-ID: <20050827112029.74585.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r240403 - /lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Date: Sat, 27 Aug 2005 11:20:29 -0000 To: java-commits@lucene.apache.org From: dnaber@apache.org X-Mailer: svnmailer-1.0.3 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dnaber Date: Sat Aug 27 04:20:25 2005 New Revision: 240403 URL: http://svn.apache.org/viewcvs?rev=240403&view=rev Log: avoid some deprecation warnings Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Modified: lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=240403&r1=240402&r2=240403&view=diff ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java Sat Aug 27 04:20:25 2005 @@ -482,8 +482,12 @@ q = qp.parse("\"on\"^1.0"); assertNotNull(q); - q = QueryParser.parse("the^3", "field", new StandardAnalyzer()); + QueryParser qp2 = new QueryParser("field", new StandardAnalyzer()); + q = qp2.parse("the^3"); + // "the" is a stop word so the result is an empty query: assertNotNull(q); + assertEquals("", q.toString()); + assertEquals(1.0f, q.getBoost(), 0.01f); } public void testException() throws Exception { @@ -515,7 +519,8 @@ public void testBooleanQuery() throws Exception { BooleanQuery.setMaxClauseCount(2); try { - QueryParser.parse("one two three", "field", new WhitespaceAnalyzer()); + QueryParser qp = new QueryParser("field", new WhitespaceAnalyzer()); + qp.parse("one two three"); fail("ParseException expected due to too many boolean clauses"); } catch (ParseException expected) { // too many boolean clauses, so ParseException is expected @@ -526,8 +531,9 @@ * This test differs from TestPrecedenceQueryParser */ public void testPrecedence() throws Exception { - Query query1 = QueryParser.parse("A AND B OR C AND D", "field", new WhitespaceAnalyzer()); - Query query2 = QueryParser.parse("+A +B +C +D", "field", new WhitespaceAnalyzer()); + QueryParser qp = new QueryParser("field", new WhitespaceAnalyzer()); + Query query1 = qp.parse("A AND B OR C AND D"); + Query query2 = qp.parse("+A +B +C +D"); assertEquals(query1, query2); }