@Test public void testErrorHandling() throws Exception { final TexQueryGenerator t = new TexQueryGenerator(); t.setLaTeXMLURL("http://example.com"); assertEquals("http://example.com", t.getLaTeXMLURL()); try { t.request("E=mc^2"); } catch (final IOException expected) { assertEquals( "com.fasterxml.jackson.core.JsonParseException", expected.getClass().getCanonicalName()); } t.setLaTeXMLURL("xxy://invalid"); try { t.request("E=mc^2"); } catch (final IOException expected) { assertEquals( "org.apache.http.client.ClientProtocolException", expected.getClass().getCanonicalName()); } }