Return-Path: Delivered-To: apmail-lucene-java-commits-archive@www.apache.org Received: (qmail 60576 invoked from network); 22 Nov 2006 17:02:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2006 17:02:08 -0000 Received: (qmail 48089 invoked by uid 500); 22 Nov 2006 17:02:18 -0000 Delivered-To: apmail-lucene-java-commits-archive@lucene.apache.org Received: (qmail 48070 invoked by uid 500); 22 Nov 2006 17:02:17 -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 48058 invoked by uid 99); 22 Nov 2006 17:02:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 09:02:17 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 09:02:07 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id ABDA21A9846; Wed, 22 Nov 2006 09:01:32 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r478239 - in /lucene/java/trunk/src/test/org/apache/lucene/index: TestBackwardsCompatibility.java TestIndexFileDeleter.java Date: Wed, 22 Nov 2006 17:01:32 -0000 To: java-commits@lucene.apache.org From: mikemccand@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061122170132.ABDA21A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikemccand Date: Wed Nov 22 09:01:31 2006 New Revision: 478239 URL: http://svn.apache.org/viewvc?view=rev&rev=478239 Log: LUCENE-720: fix two new unit tests (with lockless) to dynamically compute field number since this number can vary depending on JRE Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java?view=diff&rev=478239&r1=478238&r2=478239 ============================================================================== --- lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (original) +++ lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java Wed Nov 22 09:01:31 2006 @@ -274,7 +274,7 @@ /* Verifies that the expected file names were produced */ // disable until hardcoded file names are fixes: - public void _testExactFileNames() throws IOException { + public void testExactFileNames() throws IOException { String outputDir = "lucene.backwardscompat0.index"; Directory dir = FSDirectory.getDirectory(outputDir, true); @@ -295,12 +295,30 @@ reader.setNorm(21, "content", (float) 1.5); reader.close(); + // The numbering of fields can vary depending on which + // JRE is in use. On some JREs we see content bound to + // field 0; on others, field 1. So, here we have to + // figure out which field number corresponds to + // "content", and then set our expected file names below + // accordingly: + CompoundFileReader cfsReader = new CompoundFileReader(dir, "_2.cfs"); + FieldInfos fieldInfos = new FieldInfos(cfsReader, "_2.fnm"); + int contentFieldIndex = -1; + for(int i=0;i