Search in sources :

Example 6 with Request

use of org.apache.stanbol.commons.testing.http.Request in project stanbol by apache.

the class ReasonersOfflineJobsTest method testSubsequentJobs2.

@Test
public void testSubsequentJobs2() throws Exception {
    log.info("testSubsequentJobs2()");
    // We start all jobs and the we ping all
    List<String> locations = new ArrayList<String>();
    for (String s : allServices()) {
        for (String t : TASKS) {
            StringBuilder sb = new StringBuilder(REASONERS_PATH);
            sb.append(s).append(t).append("/job");
            Request request = buildMultipartRequest(sb.toString(), multiPart);
            String location = createJob(request);
            log.info("Started job {}", location);
            locations.add(location);
        }
    }
    // We ping all in sequence
    for (String l : locations) {
        pingSingleJob(l);
    }
}
Also used : ArrayList(java.util.ArrayList) Request(org.apache.stanbol.commons.testing.http.Request) ReasonersOfflineTest(org.apache.stanbol.reasoners.it.offline.ReasonersOfflineTest) Test(org.junit.Test)

Example 7 with Request

use of org.apache.stanbol.commons.testing.http.Request in project stanbol by apache.

the class ReasonersOfflineJobsTest method testSubsequentJobs.

@Test
public void testSubsequentJobs() throws Exception {
    log.info("testSubsequentJobs()");
    for (String s : allServices()) {
        for (String t : TASKS) {
            StringBuilder sb = new StringBuilder(REASONERS_PATH);
            sb.append(s).append(t).append("/job");
            Request request = buildMultipartRequest(sb.toString(), multiPart);
            executeAndPingSingleJob(request);
        }
    }
}
Also used : Request(org.apache.stanbol.commons.testing.http.Request) ReasonersOfflineTest(org.apache.stanbol.reasoners.it.offline.ReasonersOfflineTest) Test(org.junit.Test)

Example 8 with Request

use of org.apache.stanbol.commons.testing.http.Request in project stanbol by apache.

the class EntityhubTest method testEntityDeleteAll.

private void testEntityDeleteAll() throws IOException {
    Request request = builder.buildOtherRequest(new HttpDelete(builder.buildUrl("/entityhub/entity", "id", "*")));
    RequestExecutor re = executor.execute(request);
    re.assertStatus(200);
}
Also used : HttpDelete(org.apache.http.client.methods.HttpDelete) Request(org.apache.stanbol.commons.testing.http.Request) HttpEntityEnclosingRequest(org.apache.http.HttpEntityEnclosingRequest) RequestExecutor(org.apache.stanbol.commons.testing.http.RequestExecutor)

Aggregations

Request (org.apache.stanbol.commons.testing.http.Request)8 RequestExecutor (org.apache.stanbol.commons.testing.http.RequestExecutor)4 HttpEntityEnclosingRequest (org.apache.http.HttpEntityEnclosingRequest)3 HttpDelete (org.apache.http.client.methods.HttpDelete)2 ReasonersOfflineTest (org.apache.stanbol.reasoners.it.offline.ReasonersOfflineTest)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 Header (org.apache.http.Header)1 HttpGet (org.apache.http.client.methods.HttpGet)1 HttpPost (org.apache.http.client.methods.HttpPost)1 HttpPut (org.apache.http.client.methods.HttpPut)1 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)1 InputStreamEntity (org.apache.http.entity.InputStreamEntity)1 JSONObject (org.codehaus.jettison.json.JSONObject)1