@@ -0,0 +1,3073 @@
+package org.apache.lucene.index;%0A%0A/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Aimport org.apache.lucene.analysis.MockAnalyzer;%0Aimport org.apache.lucene.document.Document;%0Aimport org.apache.lucene.document.NumericDocValuesField;%0Aimport org.apache.lucene.store.BaseDirectoryWrapper;%0Aimport org.apache.lucene.store.MockDirectoryWrapper;%0Aimport org.apache.lucene.util.LuceneTestCase;%0Aimport org.apache.lucene.util.TimeUnits;%0Aimport org.apache.lucene.util._TestUtil;%0Aimport org.junit.Ignore;%0A%0Aimport com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;%0A%0A@TimeoutSuite(millis = 80 * TimeUnits.HOUR)%0A@Ignore(%22probably very slow%22)%0Apublic class Test2BDocValues extends LuceneTestCase %7B%0A  %0A  // indexes Integer.MAX_VALUE docs with an increasing dv field%0A  public void testNumerics() throws Exception %7B%0A    BaseDirectoryWrapper dir = newFSDirectory(_TestUtil.getTempDir(%222BNumerics%22));%0A    if (dir instanceof MockDirectoryWrapper) %7B%0A      ((MockDirectoryWrapper)dir).setThrottling(MockDirectoryWrapper.Throttling.NEVER);%0A    %7D%0A    %0A    IndexWriter w = new IndexWriter(dir,%0A        new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()))%0A        .setMaxBufferedDocs(IndexWriterConfig.DISABLE_AUTO_FLUSH)%0A        .setRAMBufferSizeMB(256.0)%0A        .setMergeScheduler(new ConcurrentMergeScheduler())%0A        .setMergePolicy(newLogMergePolicy(false, 10))%0A        .setOpenMode(IndexWriterConfig.OpenMode.CREATE));%0A%0A    Document doc = new Document();%0A    NumericDocValuesField dvField = new NumericDocValuesField(%22dv%22, 0);%0A    doc.add(dvField);%0A    %0A    for (int i = 0; i %3C Integer.MAX_VALUE; i++) %7B%0A      dvField.setLongValue(i);%0A      w.addDocument(doc);%0A      if (i %25 100000 == 0) %7B%0A        System.out.println(%22indexed: %22 + i);%0A        System.out.flush();%0A      %7D%0A    %7D%0A    %0A    w.forceMerge(1);%0A    w.close();%0A    %0A    System.out.println(%22verifying...%22);%0A    System.out.flush();%0A    %0A    DirectoryReader r = DirectoryReader.open(dir);%0A    long expectedValue = 0;%0A    for (AtomicReaderContext context : r.leaves()) %7B%0A      AtomicReader reader = context.reader();%0A      NumericDocValues dv = reader.getNumericDocValues(%22dv%22);%0A      for (int i = 0; i %3C reader.maxDoc(); i++) %7B%0A        assertEquals(expectedValue, dv.get(i));%0A        expectedValue++;%0A      %7D%0A    %7D%0A    %0A    r.close();%0A    dir.close();%0A  %7D%0A%7D%0A

add test