Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpPost.reset()


           
            HttpResponse response = this.httpClient.execute(post);
           
            //Expect a 4xx response
            int status = response.getStatusLine().getStatusCode();
            post.reset();
            if (status >= 400 && status < 500) {
                //OK
                LOGGER.info("Request failed as expected with HTTP Code " + status);
            } else {
                throw new ValidationError("Query Request with wrong media type did not fail with 4xx status code as expected, got HTTP status code " + status);
View Full Code Here


            HttpResponse response = this.httpClient.execute(update);

            // Expect 2xx or 3xx response
            int status = response.getStatusLine().getStatusCode();
            update.reset();
            if (status >= 200 && status < 400) {
                // OK
                LOGGER.info("Update succeeded with HTTP Code " + status);
            } else {
                throw new ValidationError("Update failed with HTTP Code " + status);
View Full Code Here

            // Expect a 2xx response with a True result
            status = response.getStatusLine().getStatusCode();
            if (status >= 200 && status < 300) {
                LOGGER.info("Query succeeded with HTTP code " + status);
                boolean askResult = XMLInput.booleanFromXML(response.getEntity().getContent());
                query.reset();
                if (askResult) {
                    LOGGER.info("Test update_dataset_default_graph passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
View Full Code Here

                    LOGGER.info("Test update_dataset_default_graph passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
            } else {
                query.reset();
                throw new ValidationError("Query failed with HTTP Code " + status);
            }
        } catch (IOException ioEx) {
            throw new ValidationError("IO Error", ioEx);
        }
View Full Code Here

            HttpResponse response = this.httpClient.execute(update);

            // Expect 2xx or 3xx response
            int status = response.getStatusLine().getStatusCode();
            update.reset();
            if (status >= 200 && status < 400) {
                // OK
                LOGGER.info("Update succeeded with HTTP Code " + status);
            } else {
                throw new ValidationError("Update failed with HTTP Code " + status);
View Full Code Here

            // Expect a 2xx response with a True result
            status = response.getStatusLine().getStatusCode();
            if (status >= 200 && status < 300) {
                LOGGER.info("Query succeeded with HTTP code " + status);
                boolean askResult = XMLInput.booleanFromXML(response.getEntity().getContent());
                query.reset();
                if (askResult) {
                    LOGGER.info("Test update_dataset_default_graphs passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
View Full Code Here

                    LOGGER.info("Test update_dataset_default_graphs passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
            } else {
                query.reset();
                throw new ValidationError("Query failed with HTTP Code " + status);
            }
        } catch (IOException ioEx) {
            throw new ValidationError("IO Error", ioEx);
        }
View Full Code Here

            HttpResponse response = this.httpClient.execute(update);

            // Expect 2xx or 3xx response
            int status = response.getStatusLine().getStatusCode();
            update.reset();
            if (status >= 200 && status < 400) {
                // OK
                LOGGER.info("Update succeeded with HTTP Code " + status);
            } else {
                throw new ValidationError("Update failed with HTTP Code " + status);
View Full Code Here

            // Expect a 2xx response with a True result
            status = response.getStatusLine().getStatusCode();
            if (status >= 200 && status < 300) {
                LOGGER.info("Query succeeded with HTTP code " + status);
                boolean askResult = XMLInput.booleanFromXML(response.getEntity().getContent());
                query.reset();
                if (askResult) {
                    LOGGER.info("Test update_dataset_named_graphs passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
View Full Code Here

                    LOGGER.info("Test update_dataset_named_graphs passed");
                } else {
                    throw new ValidationError("Query returned false when true was expected");
                }
            } else {
                query.reset();
                throw new ValidationError("Query failed with HTTP Code " + status);
            }
        } catch (IOException ioEx) {
            throw new ValidationError("IO Error", ioEx);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.