dsmiley commented on code in PR #4721:
URL: https://github.com/apache/solr/pull/4721#discussion_r3746599864
##########
solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java:
##########
@@ -1117,9 +1181,29 @@ public static void assertQEx(
String exceptionMessage,
SolrQueryRequest req,
SolrException.ErrorCode code) {
+ assertQEx(failMessage, exceptionMessage, req, code,
req.getParams().get(CommonParams.QT));
+ }
+
+ /**
+ * Makes sure a query against the named handler throws a SolrException with
the listed response
+ * code and expected message
+ *
+ * @param failMessage The assert message to show when the query doesn't
throw the expected
+ * exception
+ * @param exceptionMessage A substring of the message expected in the
exception
+ * @param req Solr request
+ * @param code expected error code for the query
+ * @param handler the name of the request handler to process the request
+ */
+ public static void assertQEx(
+ String failMessage,
+ String exceptionMessage,
+ SolrQueryRequest req,
+ SolrException.ErrorCode code,
+ String handler) {
Review Comment:
It's a matter of taste but shouldn't the handler & request come first?
##########
solr/core/src/test/org/apache/solr/handler/component/TestMatchedQueriesComponent.java:
##########
@@ -167,8 +168,8 @@ public void testTermsNamedQuery() throws Exception {
@Test
public void testBoolOuterAndInnerNamesComposed() throws Exception {
assertJQ(
+ HANDLER,
Review Comment:
maybe instead of overloading various assertion methods, we add a wrapping
method like `handler(String,SolrQueryRequest)` that puts the handler into the
SQR, like in the context I guess. Could use "qt". The ultimate point is to
get the tests to not use "qt"; it's not wrong if we find it convenient for the
plumbing/infra to maybe use it behind the scenes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]