@Test public void testIOExceptionOnOpenConnection() throws IOException, ODataClientException { URL ioExceptionOnConnectUrl = URLTestUtils.getIOExceptionThrowingUrl(true); Properties properties = new Properties(); properties.setProperty(CLIENT_SERVICE_PROXY_HOST_NAME, "localhost"); properties.setProperty(CLIENT_SERVICE_PROXY_PORT, "9999"); BasicEndpointCaller proxifiedCaller = new BasicEndpointCaller(properties); thrown.expect(ODataClientRuntimeException.class); thrown.expectMessage("Could not open connection to the service endpoint."); thrown.expectCause(isA(IOException.class)); proxifiedCaller.callEndpoint(emptyMap(), ioExceptionOnConnectUrl); }
@Override public String callEndpoint(Map<String, String> requestProperties, URL urlToCall) throws ODataClientException { LOG.debug("Preparing the call endpoint for given url: {}", urlToCall); HttpURLConnection conn = getConnection(populateRequestProperties(requestProperties, -1, null, XML), urlToCall); return getResponse(conn); }
BasicEndpointCaller implements EndpointCaller { @Override public String callEndpoint(Map<String, String> requestProperties, URL urlToCall) throws ODataClientException { LOG.debug("Preparing the call endpoint for given url: {}", urlToCall); HttpURLConnection conn = getConnection(populateRequestProperties(requestProperties, -1, null, XML), urlToCall); return getResponse(conn); } }
BasicEndpointCaller implements EndpointCaller { @Override public String callEndpoint(Map<String, String> requestProperties, URL urlToCall) throws ODataClientException { LOG.debug("Preparing the call endpoint for given url: {}", urlToCall); HttpURLConnection conn = getConnection(populateRequestProperties(requestProperties, -1, null, XML), urlToCall); return getResponse(conn); } BasicEndpointCaller(Properties properties); }
BasicEndpointCaller implements EndpointCaller { @Override public String callEndpoint(Map<String, String> requestProperties, URL urlToCall) throws ODataClientException { LOG.debug("Preparing the call endpoint for given url: {}", urlToCall); HttpURLConnection conn = getConnection(populateRequestProperties(requestProperties, -1, null, XML), urlToCall); return getResponse(conn); } BasicEndpointCaller(Properties properties); @Override String callEndpoint(Map<String, String> requestProperties, URL urlToCall); @Override InputStream getInputStream(Map<String, String> requestProperties, URL url); @Override String doPostEntity(Map<String, String> requestProperties, URL urlToCall, String body,
                               MediaType contentType, MediaType acceptType); @Override String doPutEntity(Map<String, String> requestProperties, URL urlToCall, String body,
                              MediaType type); @Override void doDeleteEntity(Map<String, String> requestProperties, URL urlToCall); }
BasicEndpointCaller implements EndpointCaller { @Override public String callEndpoint(Map<String, String> requestProperties, URL urlToCall) throws ODataClientException { LOG.debug("Preparing the call endpoint for given url: {}", urlToCall); HttpURLConnection conn = getConnection(populateRequestProperties(requestProperties, -1, null, XML), urlToCall); return getResponse(conn); } BasicEndpointCaller(Properties properties); @Override String callEndpoint(Map<String, String> requestProperties, URL urlToCall); @Override InputStream getInputStream(Map<String, String> requestProperties, URL url); @Override String doPostEntity(Map<String, String> requestProperties, URL urlToCall, String body,
                               MediaType contentType, MediaType acceptType); @Override String doPutEntity(Map<String, String> requestProperties, URL urlToCall, String body,
                              MediaType type); @Override void doDeleteEntity(Map<String, String> requestProperties, URL urlToCall);  }