/** * Check codec restrictions. * * @throws AssumptionViolatedException if the class does not work with a given codec. */ private void checkCodecRestrictions(Codec codec) { assumeFalse("Class not allowed to use codec: " + codec.getName() + ".", shouldAvoidCodec(codec.getName())); if (codec instanceof RandomCodec && !avoidCodecs.isEmpty()) { for (String name : ((RandomCodec)codec).formatNames) { assumeFalse("Class not allowed to use postings format: " + name + ".", shouldAvoidCodec(name)); } } PostingsFormat pf = codec.postingsFormat(); assumeFalse("Class not allowed to use postings format: " + pf.getName() + ".", shouldAvoidCodec(pf.getName())); assumeFalse("Class not allowed to use postings format: " + LuceneTestCase.TEST_POSTINGSFORMAT + ".", shouldAvoidCodec(LuceneTestCase.TEST_POSTINGSFORMAT)); }
@Override public void setUp() throws Exception { codec = new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet()); super.setUp(); }
@Override protected Codec getCodec() { return new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet()); }
@Override public void setUp() throws Exception { super.setUp(); codec = new RandomCodec(new Random(random().nextLong()), Collections.<String>emptySet()); }