@Ignore("test fails, exception is not raised at construction time") @Test public void testConstructorThrowsISOException() throws Throwable { try { new XSLTFilter("testXSLTFilterXsltfile", true); fail("Expected ISOException to be thrown"); } catch (ISOException ex) { junitx.framework.StringAssert.assertStartsWith( "javax.xml.transform.TransformerConfigurationException:", ex.getMessage()); } }
private void assertResponseOk(int expectedStatus, String expectedBody) throws JSONException { if (recorder.getHttpStatusCode() == HttpServletResponse.SC_OK) { String body = recorder.getResponseAsString(); assertStartsWith(MakeRequestHandler.UNPARSEABLE_CRUFT, body); body = body.substring(MakeRequestHandler.UNPARSEABLE_CRUFT.length()); JSONObject object = new JSONObject(body); object = object.getJSONObject(REQUEST_URL.toString()); assertEquals(expectedStatus, object.getInt("rc")); assertEquals(expectedBody, object.getString("body")); } else { fail("Invalid response for request."); } }