Examples of assertStatus()


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

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

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

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

        //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
       
    }
   
//    @Test
View Full Code Here

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

        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

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

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

                              + 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
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.