/** * Invokes the Sauce REST API to update the details of a Sauce job, using the details included in the <code>updates</code> * parameter. * * @param jobId the Sauce job id to update * @param updates Map of attributes to update */ public void updateJobInfo(String jobId, Map<String, Object> updates) { HttpURLConnection postBack = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/jobs/" + jobId); postBack = openConnection(restEndpoint); postBack.setRequestProperty("User-Agent", this.getUserAgent()); postBack.setDoOutput(true); postBack.setRequestMethod("PUT"); addAuthenticationProperty(postBack); postBack.getOutputStream().write(new JSONObject(updates).toString().getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error updating Sauce Results", e); } closeInputStream(postBack); }
/** * Invokes the Sauce REST API to delete a tunnel. * * @param tunnelId Identifier of the tunnel to delete */ public void deleteTunnel(String tunnelId) { HttpURLConnection connection = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/tunnels/" + tunnelId); connection = openConnection(restEndpoint); connection.setRequestProperty("User-Agent", this.getUserAgent()); connection.setDoOutput(true); connection.setRequestMethod("DELETE"); addAuthenticationProperty(connection); connection.getOutputStream().write("".getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error stopping Sauce Job", e); } closeInputStream(connection); }
/** * Invokes the Sauce REST API to delete a completed job from Sauce. * * @param jobId the Sauce Job id */ public void deleteJob(String jobId) { HttpURLConnection postBack = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/jobs/" + jobId); postBack = openConnection(restEndpoint); postBack.setRequestProperty("User-Agent", this.getUserAgent()); postBack.setDoOutput(true); postBack.setRequestMethod("DELETE"); addAuthenticationProperty(postBack); postBack.getOutputStream().write("".getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error stopping Sauce Job", e); } closeInputStream(postBack); }
/** * Invokes the Sauce REST API to delete a tunnel. * * @param tunnelId Identifier of the tunnel to delete */ public void deleteTunnel(String tunnelId) { HttpURLConnection connection = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/tunnels/" + tunnelId); connection = openConnection(restEndpoint); connection.setRequestProperty("User-Agent", this.getUserAgent()); connection.setDoOutput(true); connection.setRequestMethod("DELETE"); addAuthenticationProperty(connection); connection.getOutputStream().write("".getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error stopping Sauce Job", e); } closeInputStream(connection); }
/** * Invokes the Sauce REST API to delete a completed job from Sauce. * * @param jobId the Sauce Job id */ public void deleteJob(String jobId) { HttpURLConnection postBack = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/jobs/" + jobId); postBack = openConnection(restEndpoint); postBack.setRequestProperty("User-Agent", this.getUserAgent()); postBack.setDoOutput(true); postBack.setRequestMethod("DELETE"); addAuthenticationProperty(postBack); postBack.getOutputStream().write("".getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error stopping Sauce Job", e); } closeInputStream(postBack); }
/** * Invokes the Sauce REST API to stop a running job. * * @param jobId the Sauce Job id */ public void stopJob(String jobId) { HttpURLConnection postBack = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/jobs/" + jobId + "/stop"); postBack = openConnection(restEndpoint); postBack.setRequestProperty("User-Agent", this.getUserAgent()); postBack.setDoOutput(true); postBack.setRequestMethod("PUT"); addAuthenticationProperty(postBack); postBack.getOutputStream().write("".getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error stopping Sauce Job", e); } closeInputStream(postBack); }
/** * Invokes the Sauce REST API to stop a running job. * * @param jobId the Sauce Job id */ public void stopJob(String jobId) { HttpURLConnection postBack = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/jobs/" + jobId + "/stop"); postBack = openConnection(restEndpoint); postBack.setRequestProperty("User-Agent", this.getUserAgent()); postBack.setDoOutput(true); postBack.setRequestMethod("PUT"); addAuthenticationProperty(postBack); postBack.getOutputStream().write("".getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error stopping Sauce Job", e); } closeInputStream(postBack); }
/** * Invokes the Sauce REST API to update the details of a Sauce job, using the details included in the <code>updates</code> * parameter. * * @param jobId the Sauce job id to update * @param updates Map of attributes to update */ public void updateJobInfo(String jobId, Map<String, Object> updates) { HttpURLConnection postBack = null; try { URL restEndpoint = this.buildURL("v1/" + username + "/jobs/" + jobId); postBack = openConnection(restEndpoint); postBack.setRequestProperty("User-Agent", this.getUserAgent()); postBack.setDoOutput(true); postBack.setRequestMethod("PUT"); addAuthenticationProperty(postBack); postBack.getOutputStream().write(new JSONObject(updates).toString().getBytes()); } catch (IOException e) { logger.log(Level.WARNING, "Error updating Sauce Results", e); } closeInputStream(postBack); }
logger.log(Level.SEVERE, "Error POSTing to " + url.toString() + ":", e); } finally { closeInputStream(postBack); try { if (reader != null) {
logger.log(Level.SEVERE, "Error POSTing to " + url.toString() + ":", e); } finally { closeInputStream(postBack); try { if (reader != null) {