Examples of assertStatus()


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

        assertEntity(re.getContent(), ehUri, "entityhub");
       
        //no try again to lookup the entity without create
        re = executor.execute(builder.buildGetRequest(
            "/entityhub/lookup", "id",uri));
        re.assertStatus(200);
        assertEntity(re.getContent(), ehUri, "entityhub");
       
        //finally delete the entity
        re = executor.execute(builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", ehUri))));
View Full Code Here

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

        assertEntity(re.getContent(), ehUri, "entityhub");
       
        //finally delete the entity
        re = executor.execute(builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", ehUri))));
        re.assertStatus(200);

    }
   
    @Test
    public void testQueries() throws IOException, JSONException {
View Full Code Here

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

        testFindLimitAndOffsetQuery();
        testFieldQueryTextConstraints();
        //finally delete all added entity
        RequestExecutor re = executor.execute(builder.buildOtherRequest(new HttpDelete(
            builder.buildUrl("/entityhub/entity", "id", "*"))));
        re.assertStatus(200);

    }
   
    private void testFindNameQuery() throws IOException, JSONException {
        FindQueryTestCase test = new FindQueryTestCase("Apache Stanbol",
View Full Code Here

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

        String id = "http://dbpedia.org/resource/Paris";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest(DBPEDIA_SITE_PATH+"/entity",
                "id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(200);
        JSONObject jEntity = assertEntity(re.getContent(), id, DBPEDIA_SITE_ID);
        assertRepresentation(jEntity.getJSONObject("representation"),
            DBPEDIA_DEFAULTDATA_REQUIRED_FIELDS,
            DBPEDIA_DEFAULTDATA_OPTIONAL_FIELDS);
View Full Code Here

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

        String id = "http://dbpedia.org/resource/Paris";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest(SITES_MANAGER_PATH+"/entity",
                "id",id)
            .withHeader("Accept", "application/json"));
        re.assertStatus(200);
        //do not check for the site of the entity, because this might change
        JSONObject jEntity = assertEntity(re.getContent(), id, null);
        assertRepresentation(jEntity.getJSONObject("representation"),
            DBPEDIA_DEFAULTDATA_REQUIRED_FIELDS,
            DBPEDIA_DEFAULTDATA_OPTIONAL_FIELDS);
View Full Code Here

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

        String id = "http://dbpedia.org/resource/Paris";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest(DBPEDIA_SITE_PATH+"/entity",
                "id",id)
            .withHeader("Accept", "application/rdf+xml"));
        re.assertStatus(200);
        re.assertContentType("application/rdf+xml");
        re.assertContentContains(
            "<rdf:Description rdf:about=\"http://dbpedia.org/resource/Paris\">",
            "<rdfs:label xml:lang=\"en\">Paris</rdfs:label>");
        //now test the default Accept
View Full Code Here

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

        //now test the default Accept
        re = executor.execute(
            builder.buildGetRequest(DBPEDIA_SITE_PATH+"/entity",
                "id",id));
        re.assertContentType("application/json");
        re.assertStatus(200);
        assertEntity(re.getContent(), id, DBPEDIA_SITE_ID);
    }
    @Test
    public void testSetAccept() throws IOException {
        //first a normal request with application/rdf+xml
View Full Code Here

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

        String id = "http://dbpedia.org/resource/Paris";
        RequestExecutor re = executor.execute(
            builder.buildGetRequest(DBPEDIA_SITE_PATH+"/entity",
                "id",id,
                "header_Accept","text/rdf+nt")); //parse the rdf+nt format as query parameter
        re.assertStatus(200);
        re.assertContentType("text/rdf+nt");
        re.assertContentContains(
            "<http://dbpedia.org/resource/Paris> " +
            "<http://www.w3.org/2000/01/rdf-schema#label> " +
            "\"Paris\"@en .");
View Full Code Here

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

        RequestExecutor re = executor.execute(
            builder.buildGetRequest(DBPEDIA_SITE_PATH+"/entity",
                "id",id,
                "header_Accept","text/rdf+nt") //parse the rdf+nt format as query parameter
            .withHeader("Accept", "application/rdf+xml")); //MUST override the rdf+xml
        re.assertStatus(200);
        re.assertContentType("text/rdf+nt");
        re.assertContentContains(
            "<http://dbpedia.org/resource/Paris> " +
            "<http://www.w3.org/2000/01/rdf-schema#label> " +
            "\"Paris\"@en .");
View Full Code Here

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

                 *  to change often.
                 */
                RequestExecutor re = executor.execute(
                        builder.buildGetRequest("/entityhub/sites/referenced")
                        .withHeader("Accept", "application/json"));
                re.assertStatus(200);
                re.assertContentType("application/json");
                //check if all the required referenced sites are available
                for(String referencedSite : referencedSites){
                    if(referencedSite != null && !referencedSite.isEmpty()){
                        re.assertContentRegexp(String.format(
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.