/** Validates an update XML String failed */ public static void assertFailedU(String update) { assertFailedU(null, update); }
/** * Deletes a resource and then matches some JSON test expressions against the * response using the default double delta tolerance. * @see org.apache.solr.JSONTestUtil#DEFAULT_DELTA * @see #assertJDelete(String,double,String...) */ public static void assertJDelete(String request, String... tests) throws Exception { assertJDelete(request, JSONTestUtil.DEFAULT_DELTA, tests); }
/** * Validates the response from a POST request matches some JSON test expressions * * @see org.apache.solr.JSONTestUtil#DEFAULT_DELTA * @see #assertJQ(String,double,String...) */ public static void assertJPost(String request, String content, String... tests) throws Exception { assertJPost(request, content, JSONTestUtil.DEFAULT_DELTA, tests); }
/** Validates an update XML String is successful */ public static void assertU(String message, String update) { checkUpdateU(message, update, true); }
/** Validates an update XML String is successful */ public static void assertU(String update) { assertU(null, update); }
/** * Validates a query matches some JSON test expressions using the default double delta tolerance. * @see org.apache.solr.JSONTestUtil#DEFAULT_DELTA * @see #assertJQ(String,double,String...) */ public static void assertJQ(String request, String... tests) throws Exception { assertJQ(request, JSONTestUtil.DEFAULT_DELTA, tests); }
/** * Validates the response from a PUT request matches some JSON test expressions * * @see org.apache.solr.JSONTestUtil#DEFAULT_DELTA * @see #assertJQ(String,double,String...) */ public static void assertJPut(String request, String content, String... tests) throws Exception { assertJPut(request, content, JSONTestUtil.DEFAULT_DELTA, tests); }
/** Checks the success or failure of an update message */ private static void checkUpdateU(String message, String update, boolean shouldSucceed) { try { String m = (null == message) ? "" : message + " "; if (shouldSucceed) { String response = restTestHarness.validateUpdate(update); if (response != null) fail(m + "update was not successful: " + response); } else { String response = restTestHarness.validateErrorUpdate(update); if (response != null) fail(m + "update succeeded, but should have failed: " + response); } } catch (SAXException e) { throw new RuntimeException("Invalid XML", e); } }
public static void createJettyAndHarness (String solrHome, String configFile, String schemaFile, String context, boolean stopAtShutdown, SortedMap<ServletHolder,String> extraServlets) throws Exception { createJetty(solrHome, configFile, schemaFile, context, stopAtShutdown, extraServlets); restTestHarness = new RestTestHarness(() -> jetty.getBaseUrl().toString() + "/" + DEFAULT_TEST_CORENAME); }
/** Validates an update XML String failed */ public static void assertFailedU(String message, String update) { checkUpdateU(message, update, false); }