|
22 | 22 | import java.util.Locale; |
23 | 23 | import org.apache.lucene.search.DocIdSetIterator; |
24 | 24 | import org.apache.lucene.search.Query; |
25 | | -import org.apache.lucene.util.Bits; |
26 | 25 | import org.apache.lucene.util.FixedBitSet; |
27 | 26 | import org.apache.solr.SolrTestCaseJ4; |
28 | 27 | import org.apache.solr.common.SolrInputDocument; |
@@ -93,34 +92,21 @@ public void testLiveDocsSharing() throws Exception { |
93 | 92 | QueryResult res = new QueryResult(); |
94 | 93 | searcher.search(res, cmd); |
95 | 94 | set = res.getDocSet(); |
96 | | - assertEffectivelySame(set.getFixedBitSet(), live.getFixedBitSet()); |
| 95 | + assertSame(set, live); |
97 | 96 |
|
98 | 97 | cmd.setQuery(QParser.getParser(qstr + " OR id:0", null, req).getQuery()); |
99 | 98 | cmd.setFilterList(QParser.getParser(qstr + " OR id:1", null, req).getQuery()); |
100 | 99 | res = new QueryResult(); |
101 | 100 | searcher.search(res, cmd); |
102 | 101 | set = res.getDocSet(); |
103 | | - assertEffectivelySame(set.getFixedBitSet(), live.getFixedBitSet()); |
| 102 | + assertSame(set, live); |
104 | 103 | } |
105 | 104 |
|
106 | 105 | } finally { |
107 | 106 | req.close(); |
108 | 107 | } |
109 | 108 | } |
110 | 109 |
|
111 | | - /** If the a XOR b == 0, then both a & b are effectively the same bitset */ |
112 | | - private void assertEffectivelySame(FixedBitSet a, FixedBitSet b) { |
113 | | - FixedBitSet xor = a.clone(); |
114 | | - xor.xor(b); |
115 | | - assertEquals(new FixedBitSet(xor.length()), xor); |
116 | | - } |
117 | | - |
118 | | - private String bitsString(Bits bits) { |
119 | | - StringBuilder s = new StringBuilder(); |
120 | | - for (int i = 0; i < bits.length(); i++) s.append(bits.get(i) ? 1 : 0); |
121 | | - return s.toString(); |
122 | | - } |
123 | | - |
124 | 110 | public void testCaching() throws Exception { |
125 | 111 | clearIndex(); |
126 | 112 | assertU(adoc("id", "4", "val_i", "1")); |
|
0 commit comments