FileDocCategorySizeDatePackage
Test03Distance.javaAPI DocApache Lucene 2.2.07585Sat Jun 16 22:20:44 BST 2007org.apache.lucene.queryParser.surround.query

Test03Distance

public class Test03Distance extends TestCase
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.

Fields Summary
boolean
verbose
int
maxBasicQueries
String[]
exceptionQueries
final String
fieldName
String[]
docs1
SingleFieldTestDb
db1
String[]
docs2
SingleFieldTestDb
db2
Constructors Summary
Methods Summary
public voiddistanceTest1(java.lang.String query, int[] expdnrs)


          
    BooleanQueryTst bqt = new BooleanQueryTst( query, expdnrs, db1, fieldName, this,
                                                new BasicQueryFactory(maxBasicQueries));
    bqt.setVerbose(verbose);
    bqt.doTest();
  
public voiddistanceTest2(java.lang.String query, int[] expdnrs)

    BooleanQueryTst bqt = new BooleanQueryTst( query, expdnrs, db2, fieldName, this,
                                                new BasicQueryFactory(maxBasicQueries));
    bqt.setVerbose(verbose);
    bqt.doTest();
  
public static voidmain(java.lang.String[] args)

    TestRunner.run(new TestSuite(Test03Distance.class));
  
public voidtest00Exceptions()

  
       
    String m = ExceptionQueryTst.getFailQueries(exceptionQueries, verbose);
    if (m.length() > 0) {
      fail("No ParseException for:\n" + m);
    }
  
public voidtest0N01()

    int[] expdnrs = {0}; distanceTest1( "word1 n word2", expdnrs);
  
public voidtest0N01r()

 /* r reverse */
    int[] expdnrs = {0}; distanceTest1( "word2 n word1", expdnrs);
  
public voidtest0N03()

    int[] expdnrs = {0}; distanceTest1( "word2 2N word1", expdnrs);
  
public voidtest0N03r()

    int[] expdnrs = {0}; distanceTest1( "word1 2N word2", expdnrs);
  
public voidtest0N04()

    int[] expdnrs = {0}; distanceTest1( "word2 3n word1", expdnrs);
  
public voidtest0N04r()

    int[] expdnrs = {0}; distanceTest1( "word1 3n word2", expdnrs);
  
public voidtest0W01()

    int[] expdnrs = {0}; distanceTest1( "word1 w word2", expdnrs);
  
public voidtest0W02()

    int[] expdnrs = {}; distanceTest1( "word2 w word1", expdnrs);
  
public voidtest0W03()

    int[] expdnrs = {}; distanceTest1( "word2 2W word1", expdnrs);
  
public voidtest0W04()

    int[] expdnrs = {}; distanceTest1( "word2 3w word1", expdnrs);
  
public voidtest0W05()

    int[] expdnrs = {}; distanceTest1( "orda1 w orda3", expdnrs);
  
public voidtest0W06()

    int[] expdnrs = {3}; distanceTest1( "orda1 2w orda3", expdnrs);
  
public voidtest1Ntrunc02()

    int[] expdnrs = {0,3}; distanceTest1( "word* n word2", expdnrs);
  
public voidtest1Ntrunc02r()

    int[] expdnrs = {0,3}; distanceTest1( "word2 n word*", expdnrs);
  
public voidtest1Ntrunc03()

    int[] expdnrs = {0}; distanceTest1( "word1* N word2*", expdnrs);
  
public voidtest1Ntrunc04()

    int[] expdnrs = {}; distanceTest1( "kxork* 99n kxor*", expdnrs);
  
public voidtest1Ntrunc05()

    int[] expdnrs = {0}; distanceTest1( "word2* 2N word1*", expdnrs);
  
public voidtest1Ntrunc06()

    int[] expdnrs = {3}; distanceTest1( "ord* N word*", expdnrs);
  
public voidtest1Ntrunc06r()

    int[] expdnrs = {3}; distanceTest1( "word* N ord*", expdnrs);
  
public voidtest1Ntrunc09()

    int[] expdnrs = {3}; distanceTest1( "(orda2 OR orda3) 2N (word2 OR worda3)", expdnrs);
  
public voidtest1Wtrunc01()

    int[] expdnrs = {0}; distanceTest1( "word1* w word2", expdnrs);
  
public voidtest1Wtrunc02()

    int[] expdnrs = {0}; distanceTest1( "word* w word2", expdnrs);
  
public voidtest1Wtrunc02r()

    int[] expdnrs = {0,3}; distanceTest1( "word2 w word*", expdnrs);
  
public voidtest1Wtrunc03()

    int[] expdnrs = {0}; distanceTest1( "word1* w word2*", expdnrs);
  
public voidtest1Wtrunc04()

    int[] expdnrs = {}; distanceTest1( "kxork* w kxor*", expdnrs);
  
public voidtest1Wtrunc05()

    int[] expdnrs = {}; distanceTest1( "word2* 2W word1*", expdnrs);
  
public voidtest1Wtrunc06()

    int[] expdnrs = {3}; distanceTest1( "ord* W word*", expdnrs);
  
public voidtest1Wtrunc07()

    int[] expdnrs = {3}; distanceTest1( "(orda2 OR orda3) W word*", expdnrs);
  
public voidtest1Wtrunc08()

    int[] expdnrs = {3}; distanceTest1( "(orda2 OR orda3) W (word2 OR worda3)", expdnrs);
  
public voidtest1Wtrunc09()

    int[] expdnrs = {3}; distanceTest1( "(orda2 OR orda3) 2W (word2 OR worda3)", expdnrs);
  
public voidtest2Nnested01()

    int[] expdnrs = {0}; distanceTest2( "w1 N w2 N w3", expdnrs);
  
public voidtest2Nnested02()

    int[] expdnrs = {0,1}; distanceTest2( "w1 2N w2 2N w3", expdnrs);
  
public voidtest2Nprefix01a()

    int[] expdnrs = {0,1}; distanceTest2( "N(w1, w2, w3)", expdnrs);
  
public voidtest2Nprefix01b()

    int[] expdnrs = {0,1}; distanceTest2( "N(w3, w1, w2)", expdnrs);
  
public voidtest2Nprefix02a()

    int[] expdnrs = {0,1}; distanceTest2( "2N(w1,w2,w3)", expdnrs);
  
public voidtest2Nprefix02b()

    int[] expdnrs = {0,1}; distanceTest2( "2N(w2,w3,w1)", expdnrs);
  
public voidtest2Wnested01()

    int[] expdnrs = {0}; distanceTest2( "w1 W w2 W w3", expdnrs);
  
public voidtest2Wnested02()

    int[] expdnrs = {0,1}; distanceTest2( "w1 2W w2 2W w3", expdnrs);
  
public voidtest2Wprefix01()

    int[] expdnrs = {0}; distanceTest2( "W (w1, w2, w3)", expdnrs);
  
public voidtest2Wprefix02()

    int[] expdnrs = {0,1}; distanceTest2( "2W(w1,w2,w3)", expdnrs);