Examples of RequestExecutor


Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

                    "'value': 'http:\\/\\/www.test.org\\/test#NonExistingValue', "+
                "}]"+
            "}",
            false); //success but no result
        //now execute the test
        RequestExecutor re = executeQuery(test);
        JSONObject jQuery = assertResponseQuery(re.getContent());
        assertTrue("Result Query does not contain offset property",jQuery.has("offset"));
        assertTrue("Returned offset is != 0",jQuery.getInt("offset") == 0);
    }
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

                    "'value': 'http:\\/\\/www.test.org\\/test#NonExistingValue', "+
                "}]"+
            "}",
            false); //success but no result
        //now execute the test
        RequestExecutor re = executeQuery(test);
        //test the of the limit was set correctly set to the default (> 0)
        JSONObject jQuery = assertResponseQuery(re.getContent());
        assertTrue("Result Query does not contain Limit property",jQuery.has("limit"));
        assertTrue("Returned limit is <= 0",jQuery.getInt("limit") > 0);
    }
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

                "'field': 'http:\\/\\/www.test.org\\/test#field'" +
                "}]," +
            "}",
            false); //expect BadRequest
        //now execute the test
        RequestExecutor re = executeQuery(test);
        JSONObject jQuery = assertResponseQuery(re.getContent());
        JSONArray jConstraints = jQuery.optJSONArray("constraints");
        assertNotNull("Result Query does not contain the constraints Array",jConstraints);
        assertTrue("Result Query Constraint Array does not contain the expected Constraint",
            jConstraints.length() == 1);
        JSONObject jConstraint = jConstraints.optJSONObject(0);
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

                "'field': 'http:\\/\\/www.test.org\\/test#field', " +
                "}]" +
            "}",
            false); //expect BadRequest
        //now execute the test
        RequestExecutor re = executeQuery(test);
        JSONObject jQuery = assertResponseQuery(re.getContent());
        JSONArray jConstraints = jQuery.optJSONArray("constraints");
        assertNotNull("Result Query does not contain the constraints Array",jConstraints);
        assertTrue("Result Query Constraint Array does not contain the expected Constraint",
            jConstraints.length() == 1);
        JSONObject jConstraint = jConstraints.optJSONObject(0);
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

                "'inclusive': true," +
                "}]" +
            "}",
            false); //expect BadRequest
        //now execute the test
        RequestExecutor re = executeQuery(test);
        JSONObject jQuery = assertResponseQuery(re.getContent());
        JSONArray jConstraints = jQuery.optJSONArray("constraints");
        assertNotNull("Result Query does not contain the constraints Array",jConstraints);
        assertTrue("Result Query Constraint Array does not contain the expected Constraint",
            jConstraints.length() == 1);
        JSONObject jConstraint = jConstraints.optJSONObject(0);
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

                .assertContentType("text/html");               
                /*  List of expected referencedSites could also be made
                 *  configurable via system properties, but we don't expect it
                 *  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(
                            "http:\\\\/\\\\/.*\\\\/entityhub\\\\/site\\\\/%s\\\\/",
                            referencedSite));
                    }
                }
                log.info("Entityhub services checked, all present");
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

     */
//    @Test
    public void testEntityCreation() throws IOException {
        String singleImportResource = "";
        //create a POST request with a test RDF file
        RequestExecutor test = executor.execute(
            buildImportRdfData(singleImportResource, true, SINGLE_IMPORT_ENTITY_ID));
        //assert that the entity was created
        test.assertStatus(201);
       
        //NOTE: the check for the imported ID(s) is part of the
        // testEntityRetrieval test Method
       
    }
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

    }
//    @Test
    public void testMultipleEntityCreation() throws IOException {
        String multipleImportResource = "";
        //create a POST request with a test RDF file
        RequestExecutor test = executor.execute(
            buildImportRdfData(multipleImportResource, true, null));
        //assert that the entity was created
        test.assertStatus(201);
       
        //NOTE: the check for the imported ID(s) is part of the
        // testEntityRetrieval test Method
       
    }
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

    public void testEntityUpdates() throws IOException {
        String singleUpdateResource = "";
        //create a POST request with a test RDF file that contains updated data
        //of the one used for testEntityCreation
        //create a POST request with a test RDF file
        RequestExecutor test = executor.execute(
            buildImportRdfData(singleUpdateResource, false, SINGLE_IMPORT_ENTITY_ID));
        test.assertStatus(200);
        //TODO: validate that the entity was updated
       
    }
View Full Code Here

Examples of org.apache.stanbol.commons.testing.http.RequestExecutor

//    @Test
    public void testMultipleEntityUpdates() throws IOException {
        String nultipleUpdateResource = "";
        //create a POST request with a test RDF file that contains updated data
        //of the one used for testMultipleEntityCreation
        RequestExecutor test = executor.execute(
            buildImportRdfData(nultipleUpdateResource, false, null));
        test.assertStatus(200);
        //TODO: validate that the entity was updated
       
        //check for the updates to be applied
        //check the metadata to be updated (creation date != modification date)
    }
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.