lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: svn commit: r1399923 - /lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
Date Thu, 18 Oct 2012 23:39:48 GMT
Thanks :)

Mike McCandless

http://blog.mikemccandless.com


On Thu, Oct 18, 2012 at 7:29 PM,  <rmuir@apache.org> wrote:
> Author: rmuir
> Date: Thu Oct 18 23:29:29 2012
> New Revision: 1399923
>
> URL: http://svn.apache.org/viewvc?rev=1399923&view=rev
> Log:
> use _TestUtil helper instead of lots of coe
>
> Modified:
>     lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
>
> Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java?rev=1399923&r1=1399922&r2=1399923&view=diff
> ==============================================================================
> --- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
(original)
> +++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
Thu Oct 18 23:29:29 2012
> @@ -25,9 +25,6 @@ import java.util.Set;
>  import java.util.concurrent.ConcurrentLinkedQueue;
>  import java.util.concurrent.CountDownLatch;
>
> -import org.apache.lucene.codecs.Codec;
> -import org.apache.lucene.codecs.PostingsFormat;
> -import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
>  import org.apache.lucene.document.Document;
>  import org.apache.lucene.document.Field;
>  import org.apache.lucene.store.Directory;
> @@ -47,17 +44,7 @@ public class TestBagOfPostings extends L
>      int numTerms = atLeast(300);
>      final int maxTermsPerDoc = _TestUtil.nextInt(random(), 10, 20);
>
> -    boolean isSimpleText = false;
> -    Codec defaultCodec = Codec.getDefault();
> -
> -    if (defaultCodec.getName().equals("SimpleText")) {
> -      isSimpleText = true;
> -    } else {
> -      PostingsFormat defaultPostingsFormat = defaultCodec.postingsFormat();
> -      if (defaultPostingsFormat instanceof PerFieldPostingsFormat) {
> -        isSimpleText = ((PerFieldPostingsFormat) defaultPostingsFormat).getPostingsFormatForField("field").getName().equals("SimpleText");
> -      }
> -    }
> +    boolean isSimpleText = "SimpleText".equals(_TestUtil.getPostingsFormat("field"));
>
>      if (isSimpleText && TEST_NIGHTLY) {
>        // Otherwise test can take way too long (> 2 hours)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message