Skip to content

Commit

Permalink
corrected base method changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigar Parekh committed Aug 10, 2018
1 parent ec5654e commit cf00af2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testHtml() throws Exception {
@Test
public void testShortHtml() throws Exception{
buildNames("start","end");
assertXmlTag("start <td/> end", true,2);
assertXmlTag("start <td/> end", 2);
buildNames("start end");
assertXmlTag("start <td/> end", true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,14 @@ protected void assertXmlTag(String docText, boolean expected) throws Exception {
}
}

protected void assertXmlTag(String docText, boolean expected, int expectedCount) throws Exception {
protected void assertXmlTag(String docText, int expectedCount) throws Exception {
final SolrQueryRequest req = reqDoc(docText);
try { // 5.4 and beyond we can use try-with-resources
final SolrQueryResponse rsp = h.queryAndResponse(req.getParams().get("qt"), req);
final TestTag[] testTags = pullTagsFromResponse(req, rsp);
if (!expected) {
assertEquals(0, testTags.length);
} else {
assertEquals(expectedCount, testTags.length);
final TestTag tag = testTags[0];
validateXml(insertAnchorAtOffsets(docText, tag.startOffset, tag.endOffset, tag.docName));
}
final TestTag[] testTags = pullTagsFromResponse(req, rsp);
assertEquals(expectedCount, testTags.length);
final TestTag tag = testTags[0];
validateXml(insertAnchorAtOffsets(docText, tag.startOffset, tag.endOffset, tag.docName));
} finally {
req.close();
}
Expand Down

0 comments on commit cf00af2

Please sign in to comment.