Package org.apache.stanbol.commons.testing.http

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


    @Test
    public void testCustomFieldParameter() throws IOException, JSONException {
        FindQueryTestCase test = new FindQueryTestCase("non_existant_"+UUID.randomUUID().toString(), false);
        String testField = "http://www.test.org/test#test_"+UUID.randomUUID();
        test.setField(testField);
        RequestExecutor re = executeQuery(test);
        JSONObject jQuery = assertResponseQuery(re.getContent());
        assertSelectedField(jQuery, testField);
    }
View Full Code Here


                    "'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

                    "'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

                "'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

                "'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

                "'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

    @Before
    public void waitForServerReady() throws Exception {
        // initialize instance request builder and HTTP client
        builder = new RequestBuilder(serverBaseUrl);
        httpClient = new DefaultHttpClient();
        executor = new RequestExecutor(httpClient);

        if (serverReady) {
            return;
        }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.testing.http.RequestExecutor$PreemptiveAuthInterceptor

Copyright © 2018 www.massapicom. 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.