Example usage for org.apache.commons.httpclient HttpStatus SC_NOT_FOUND

List of usage examples for org.apache.commons.httpclient HttpStatus SC_NOT_FOUND

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpStatus SC_NOT_FOUND.

Prototype

int SC_NOT_FOUND

To view the source code for org.apache.commons.httpclient HttpStatus SC_NOT_FOUND.

Click Source Link

Document

<tt>404 Not Found</tt> (HTTP/1.0 - RFC 1945)

Usage

From source file:terrastore.integration.IntegrationTest.java

@Test
public void testPutValueAndConditionallyGetNotFound() throws Exception {
    String bucket = UUID.randomUUID().toString();

    TestValue value = new TestValue("value", 1);
    PutMethod putValue = makePutMethod(NODE1_PORT, bucket + "/value");
    putValue.setRequestEntity(new StringRequestEntity(fromObjectToJson(value), "application/json", null));
    HTTP_CLIENT.executeMethod(putValue);
    assertEquals(HttpStatus.SC_NO_CONTENT, putValue.getStatusCode());
    putValue.releaseConnection();/*from   w  w w. j av  a  2  s . c om*/

    GetMethod getValue = makeGetMethodWithPredicate(NODE2_PORT, bucket + "/value",
            "jxpath:/stringField[.='wrong']");
    HTTP_CLIENT.executeMethod(getValue);
    assertEquals(HttpStatus.SC_NOT_FOUND, getValue.getStatusCode());
    getValue.releaseConnection();
}