Examples of assertStatus()


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

        RequestExecutor re = executor.execute(
            builder.buildGetRequest(DBPEDIA_SITE_PATH+"/entity",
                "id",id,
                "header_Accept","") //empty value to remove
            .withHeader("Accept", "application/rdf+xml")); //MUST override the rdf+xml
        re.assertStatus(200);
        //The default format (JSON) is expected
        assertEntity(re.getContent(), id, DBPEDIA_SITE_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()

        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()

        String stanbolProjectUri = "http://stanbol.apache.org";
        //create a POST request with a test RDF file
        RequestExecutor test = executor.execute(
            buildImportRdfData(in ,RDF_XML, true, stanbolProjectUri));
        //assert that the entity was created
        test.assertStatus(201);
    }

    private void testEntityCreated() throws IOException, JSONException {
        String id = "http://stanbol.apache.org";
        RequestExecutor re = executor.execute(
View Full Code Here

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

    private void testEntityCreated() throws IOException, JSONException {
        String id = "http://stanbol.apache.org";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest("/entityhub/entity","id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(200);

        JSONObject jEntity = assertEntity(re.getContent(), id, "entityhub");
        Map<String,Set<List<String>>> data = assertRepresentation(jEntity.getJSONObject("representation"),
            EXPECTED_DOAP_FIELDS, null);
        //test values of two properties we will update in a following test
View Full Code Here

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

        String stanbolProjectUri = "http://stanbol.apache.org";
        //create a POST request with a test RDF file
        RequestExecutor test = executor.execute(
            buildImportRdfData(in ,RDF_XML, false, stanbolProjectUri));
        //assert that the entity was created
        test.assertStatus(200);
        //check that the updated entity was returned
        assertEntity(test.getContent(), stanbolProjectUri, "entityhub");
    }

    private void testEntityUpdated() throws IOException, JSONException {
View Full Code Here

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

    private void testEntityUpdated() throws IOException, JSONException {
        String id = "http://stanbol.apache.org";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest("/entityhub/entity","id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(200);

        JSONObject jEntity = assertEntity(re.getContent(), id, "entityhub");
        Map<String,Set<List<String>>> data = assertRepresentation(jEntity.getJSONObject("representation"),
            EXPECTED_DOAP_FIELDS, null);
        Set<List<String>> pmcValues = data.get("http://projects.apache.org/ns/asfext#pmc");
View Full Code Here

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

    private void testEntityDelete() throws IOException {
        String stanbolProjectUri = "http://stanbol.apache.org";
        Request request = builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", stanbolProjectUri)));
        RequestExecutor re = executor.execute(request);
        re.assertStatus(200);
    }

    private void testEntityDeleted() throws IOException {
        String id = "http://stanbol.apache.org";
        RequestExecutor re = executor.execute(
View Full Code Here

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

                                      + System.currentTimeMillis() + "-inactive";

        // Scopes should not be there
        request = executor.execute(builder.buildGetRequest(tempActiveScopeUri).withHeader("Accept",
            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");
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.