Examples of errorCode()


Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        String data;
        data = jsonBuilder().startObject().field("blip", 1).endObject().string();

        HttpClient http = httpClient("server1", "john", "password1");
        HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(201));

        http = httpClient("server1", "jane", "password2");
        resp = http.request("PUT", "/foo/bar/2", data.getBytes());
        assertThat(resp.errorCode(), equalTo(201));
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(201));

        http = httpClient("server1", "jane", "password2");
        resp = http.request("PUT", "/foo/bar/2", data.getBytes());
        assertThat(resp.errorCode(), equalTo(201));

        http = httpClient("server1", "john", "password2");
        resp = http.request("PUT", "/foo/bar/3", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        resp = http.request("PUT", "/foo/bar/2", data.getBytes());
        assertThat(resp.errorCode(), equalTo(201));

        http = httpClient("server1", "john", "password2");
        resp = http.request("PUT", "/foo/bar/3", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));

        http = httpClient("server1", "jane", "password1");
        resp = http.request("PUT", "/foo/bar/4", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        resp = http.request("PUT", "/foo/bar/3", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));

        http = httpClient("server1", "jane", "password1");
        resp = http.request("PUT", "/foo/bar/4", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));

        http = httpClient("server1", "JaNe", "password2");
        resp = http.request("PUT", "/foo/bar/4", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));
    }
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        resp = http.request("PUT", "/foo/bar/4", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));

        http = httpClient("server1", "JaNe", "password2");
        resp = http.request("PUT", "/foo/bar/4", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));
    }

    @Test
    public void testEmptyPassword()  throws Exception {
        publishAuth("server1", "foo", null, "readwrite");
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        String data;
        data = jsonBuilder().startObject().field("blip", 1).endObject().string();

        HttpClient http = httpClient("server1");
        HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));

        http = httpClient("server1", "foo", "");
        resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));
    }
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));

        http = httpClient("server1", "foo", "");
        resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(401));
    }

    @Test
    public void testEmptyRoles()  throws Exception {
        publishAuth("server1", "foo", "bar", null);
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        String data;
        data = jsonBuilder().startObject().field("blip", 1).endObject().string();

        HttpClient http = httpClient("server1", "foo", "bar");
        HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(403));

        http = httpClient("server1", "foo", "bar");
        resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(403));
    }
View Full Code Here

Examples of com.sonian.elasticsearch.http.jetty.HttpClientResponse.errorCode()

        HttpClientResponse resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(403));

        http = httpClient("server1", "foo", "bar");
        resp = http.request("PUT", "/foo/bar/1", data.getBytes());
        assertThat(resp.errorCode(), equalTo(403));
    }

    protected void publishAuth(String server, String user, String pass, String roles) throws IOException {
        final String idx = "auth";
        XContentBuilder contentBuilder =  XContentFactory.jsonBuilder().startObject();
View Full Code Here

Examples of io.crate.action.sql.SQLActionException.errorCode()

        SQLActionException sqlActionException = null;
        builder.field("message", detailedMessage(t));
        if (t instanceof SQLActionException) {
            sqlActionException = (SQLActionException)t;
            builder.field("code", sqlActionException.errorCode());
        } else {
            builder.field("code", 5000);
        }

        builder.endObject();
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.