Examples of assertStatus()


Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

    private void testEntityDeleted() throws IOException {
        String id = "http://stanbol.apache.org";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest("/entityhub/entity","id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(404);
    }
    private void testEntityDeleteAll() throws IOException {
        Request request = builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", "*")));
        RequestExecutor re = executor.execute(request);
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

            KRFormat.TURTLE));
        request.assertStatus(404);
        log.info("Request: " + tempActiveScopeUri + " (should return 404) ... DONE");
        request = executor.execute(builder.buildGetRequest(tempInactiveScopeUri).withHeader("Accept",
            KRFormat.TURTLE));
        request.assertStatus(404);
        log.info("Request: " + tempInactiveScopeUri + " (should return 404) ... DONE");

        // Create scopes, only activate one
        executor.execute(builder.buildOtherRequest(new HttpPut(builder.buildUrl(tempActiveScopeUri
                                                                                + "?activate=true"))));
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

    }
    private void testEntityDeleteAll() throws IOException {
        Request request = builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", "*")));
        RequestExecutor re = executor.execute(request);
        re.assertStatus(200);
    }
    private void testAllEntitiesDeleted() throws IOException {
        String id = "http://xml.apache.org/xerces-c/";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest("/entityhub/entity","id",id)
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

                              + System.currentTimeMillis();

        // Scope should not be there
        request = executor.execute(builder.buildGetRequest(tempScopeUri)
                .withHeader("Accept", KRFormat.TURTLE));
        request.assertStatus(404);
        log.info("Request: " + tempScopeUri + " (should return 404) ... DONE");

        // Create scope
        executor.execute(builder.buildOtherRequest(new HttpPut(builder.buildUrl(tempScopeUri))));
        log.info("PUT Request: " + tempScopeUri + " ... DONE");
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

        log.info("PUT Request: " + tempScopeUri + " ... DONE");

        // Scope should be there now
        request = executor.execute(builder.buildGetRequest(tempScopeUri)
                .withHeader("Accept", KRFormat.TURTLE));
        request.assertStatus(200).assertContentContains(tempScopeUri);
        log.info("Request: " + tempScopeUri + " ... DONE");
       
        // TODO the U of CRUD

        // Delete scope
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

    private void testAllEntitiesDeleted() throws IOException {
        String id = "http://xml.apache.org/xerces-c/";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest("/entityhub/entity","id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(404);
    }
    @Test
    public void testEntityLookup() throws IOException, JSONException {
        String uri = "http://dbpedia.org/resource/Paris";
        //first check that lookup without create returns 404
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

        log.info("DELETE Request: " + tempScopeUri + " ... DONE");

        // Scope should not be there
        request = executor.execute(builder.buildGetRequest(tempScopeUri)
                .withHeader("Accept", KRFormat.TURTLE));
        request.assertStatus(404);
        log.info("Request: " + tempScopeUri + " (should return 404) ... DONE");
    }

    @Test
    public void testLocking() throws Exception {
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

    public void testEntityLookup() throws IOException, JSONException {
        String uri = "http://dbpedia.org/resource/Paris";
        //first check that lookup without create returns 404
        RequestExecutor re = executor.execute(builder.buildGetRequest(
            "/entityhub/lookup", "id",uri));
        re.assertStatus(404);
        //Now check that lookup with create does work
        re = executor.execute(builder.buildGetRequest(
            "/entityhub/lookup", "id",uri,"create","true"));
        re.assertStatus(200);
        JSONObject entity = assertEntity(re.getContent(), null, "entityhub");
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

            "/entityhub/lookup", "id",uri));
        re.assertStatus(404);
        //Now check that lookup with create does work
        re = executor.execute(builder.buildGetRequest(
            "/entityhub/lookup", "id",uri,"create","true"));
        re.assertStatus(200);
        JSONObject entity = assertEntity(re.getContent(), null, "entityhub");
        String ehUri = entity.optString("id", null);
       
        //try to retrieve the entity with the generated id
        re = executor.execute(builder.buildGetRequest(
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor.assertStatus()

        String ehUri = entity.optString("id", null);
       
        //try to retrieve the entity with the generated id
        re = executor.execute(builder.buildGetRequest(
            "/entityhub/entity", "id",ehUri));
        re.assertStatus(200);
        assertEntity(re.getContent(), ehUri, "entityhub");
       
        //no try again to lookup the entity without create
        re = executor.execute(builder.buildGetRequest(
            "/entityhub/lookup", "id",uri));
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.