MCPcopy Create free account
hub / github.com/apache/solr / doSingle

Method doSingle

solr/core/src/test/org/apache/solr/search/TestDocSet.java:175–210  ·  view source on GitHub ↗
(int maxSize)

Source from the content-addressed store, hash-verified

173 }
174
175 protected void doSingle(int maxSize) {
176 int sz = rand.nextInt(maxSize + 1);
177 int sz2 = rand.nextInt(maxSize);
178 FixedBitSet bs1 = getRandomSet(sz, rand.nextInt(sz + 1));
179 FixedBitSet bs2 = getRandomSet(sz, rand.nextInt(sz2 + 1));
180
181 DocSet a1 = new BitDocSet(bs1);
182 DocSet a2 = new BitDocSet(bs2);
183 DocSet b1 = getDocSet(bs1);
184 DocSet b2 = getDocSet(bs2);
185
186 checkEqual(bs1, b1);
187 checkEqual(bs2, b2);
188
189 iter(a1, b1);
190 iter(a2, b2);
191
192 collect(a1, maxSize);
193 collect(a2, maxSize);
194
195 FixedBitSet a_and = bs1.clone();
196 a_and.and(bs2);
197 FixedBitSet a_or = bs1.clone();
198 a_or.or(bs2);
199 // FixedBitSet a_xor = bs1.clone(); a_xor.xor(bs2);
200 FixedBitSet a_andn = bs1.clone();
201 a_andn.andNot(bs2);
202
203 checkEqual(a_and, b1.intersection(b2));
204 checkEqual(a_or, b1.union(b2));
205 checkEqual(a_andn, b1.andNot(b2));
206
207 assertEquals(a_and.cardinality(), b1.intersectionSize(b2));
208 assertEquals(a_or.cardinality(), b1.unionSize(b2));
209 assertEquals(a_andn.cardinality(), b1.andNotSize(b2));
210 }
211
212 public void doMany(int maxSz, int iter) {
213 for (int i = 0; i < iter; i++) {

Callers 1

doManyMethod · 0.95

Calls 15

getRandomSetMethod · 0.95
getDocSetMethod · 0.95
checkEqualMethod · 0.95
iterMethod · 0.95
collectMethod · 0.95
andNotMethod · 0.95
intersectionMethod · 0.95
unionMethod · 0.95
intersectionSizeMethod · 0.95
unionSizeMethod · 0.95
andNotSizeMethod · 0.95
nextIntMethod · 0.80

Tested by

no test coverage detected