mirror of https://github.com/apache/lucene.git
spin off NIGHTLY DuelingCodecs into separate test that excludes memory-hungry codecs
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1670546 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c10df8b65
commit
809998adff
|
@ -37,17 +37,17 @@ import java.util.Random;
|
||||||
* Compares one codec against another
|
* Compares one codec against another
|
||||||
*/
|
*/
|
||||||
public class TestDuelingCodecs extends LuceneTestCase {
|
public class TestDuelingCodecs extends LuceneTestCase {
|
||||||
private Directory leftDir;
|
Directory leftDir;
|
||||||
private IndexReader leftReader;
|
IndexReader leftReader;
|
||||||
private Codec leftCodec;
|
Codec leftCodec;
|
||||||
|
|
||||||
private Directory rightDir;
|
Directory rightDir;
|
||||||
private IndexReader rightReader;
|
IndexReader rightReader;
|
||||||
private Codec rightCodec;
|
Codec rightCodec;
|
||||||
private RandomIndexWriter leftWriter;
|
RandomIndexWriter leftWriter;
|
||||||
private RandomIndexWriter rightWriter;
|
RandomIndexWriter rightWriter;
|
||||||
private long seed;
|
long seed;
|
||||||
private String info; // for debugging
|
String info; // for debugging
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
@ -143,8 +143,9 @@ public class TestDuelingCodecs extends LuceneTestCase {
|
||||||
/**
|
/**
|
||||||
* checks the two indexes are equivalent
|
* checks the two indexes are equivalent
|
||||||
*/
|
*/
|
||||||
|
// we use a small amount of docs here, so it works with any codec
|
||||||
public void testEquals() throws IOException {
|
public void testEquals() throws IOException {
|
||||||
int numdocs = TEST_NIGHTLY ? atLeast(2000) : atLeast(100);
|
int numdocs = atLeast(100);
|
||||||
createRandomIndex(numdocs, leftWriter, seed);
|
createRandomIndex(numdocs, leftWriter, seed);
|
||||||
createRandomIndex(numdocs, rightWriter, seed);
|
createRandomIndex(numdocs, rightWriter, seed);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
package org.apache.lucene.index;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import org.apache.lucene.util.LuceneTestCase.Nightly;
|
||||||
|
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Just like TestDuelingCodecs, only with a lot more documents.
|
||||||
|
*/
|
||||||
|
@Nightly
|
||||||
|
@SuppressCodecs({"Memory", "Direct"}) // it can be too much for these codecs
|
||||||
|
public class TestDuelingCodecsAtNight extends TestDuelingCodecs {
|
||||||
|
|
||||||
|
// use a big number of documents
|
||||||
|
public void testBigEquals() throws Exception {
|
||||||
|
int numdocs = atLeast(2000);
|
||||||
|
createRandomIndex(numdocs, leftWriter, seed);
|
||||||
|
createRandomIndex(numdocs, rightWriter, seed);
|
||||||
|
|
||||||
|
leftReader = leftWriter.getReader();
|
||||||
|
rightReader = rightWriter.getReader();
|
||||||
|
|
||||||
|
assertReaderEquals(info, leftReader, rightReader);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue