for now you can use an assume, there is a helper in LuceneTestCase:

String pf = TestUtil.getPostingsFormat("dummy");
boolean supportsOffsets = !doesntSupportOffsets.contains(pf);

another option is to suppress the codecs that don't support it
(anything using Sep layout).

This is annoying though, maybe we should remove Sep layout?
Realistically it was the precursor to the block layout that Lucene41
introduced, which was a big change, but i am unsure if its really
helping us anymore, because it just falls behind on things and i dont
think has any "interesting" qualities for real use or that would be
useful in testing, either..

On Wed, Mar 19, 2014 at 8:53 AM, Allison, Timothy B. <talli...@mitre.org> wrote:
> This is similar to David Smiley's question on Feb 16th, but SuppressCodecs
> would be too broad of a solution, I think.
>
>
>
> I'm using LuceneTestCase's newIndexWriterConfig, and I have a test that
> requires IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS.  The test
> passes quite often (famous last words), but I occasionally get an
> UnsupportedOperationException: this codec cannot index offsets.
>
>
>
> Is there a way to have LuceneTestCase randomly select a codec (with
> particular subcomponents/configurations) that supports indexing offsets?
>
>
>
> The codec that fails:
>
>
>
> codec=Lucene46: {f1:MockVariableIntBlock(baseBlockSize=71)}, docValues:{},
> ...
>
>
>
> Most often, however Lucene46 does not fail.

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

Reply via email to