Examples of execAsk()


Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_01() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
        // No auth credentials should result in an error
        qe.execAsk();
    }

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_02() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_02() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
        // Auth credentials for valid user with bad password
        qe.setBasicAuthentication("allowed", "incorrect".toCharArray());
        qe.execAsk();
    }

    @Test
    public void query_with_auth_03() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

    @Test
    public void query_with_auth_03() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
        // Auth credentials for valid user with correct password
        qe.setBasicAuthentication("allowed", "password".toCharArray());
        Assert.assertTrue(qe.execAsk());
    }

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_04() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

    public void query_with_auth_04() {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
        // Auth credentials for valid user with correct password BUT not in
        // correct role
        qe.setBasicAuthentication("forbidden", "password".toCharArray());
        qe.execAsk();
    }

    @Test
    public void query_with_auth_05() {
        // Uses auth and enables compression
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        qe.setAllowDeflate(true);
        qe.setAllowGZip(true);

        // Auth credentials for valid user with correct password
        qe.setBasicAuthentication("allowed", "password".toCharArray());
        Assert.assertTrue(qe.execAsk());
    }

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_06() {
        // Uses auth and enables compression
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        qe.setAllowDeflate(true);
        qe.setAllowGZip(true);

        // Auth credentials for valid user with bad password
        qe.setBasicAuthentication("allowed", "incorrect".toCharArray());
        qe.execAsk();
    }

    @Test(expected = QueryExceptionHTTP.class)
    public void query_with_auth_07() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password but scoped to
        // wrong URI
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI("http://example"), "allowed",
                "password".toCharArray());
        qe.setAuthenticator(authenticator);
        qe.execAsk();
    }

    @Test
    public void query_with_auth_08() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password and scoped to
        // correct URI
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceQuery), "allowed", "password".toCharArray());
        qe.setAuthenticator(authenticator);
        Assert.assertTrue(qe.execAsk());
    }

    @Test
    public void query_with_auth_09() throws URISyntaxException {
        QueryEngineHTTP qe = (QueryEngineHTTP) QueryExecutionFactory.sparqlService(serviceQuery, "ASK { }");
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

        // Auth credentials for valid user with correct password using
        // pre-emptive auth
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceQuery), "allowed", "password".toCharArray());
        qe.setAuthenticator(new PreemptiveBasicAuthenticator(authenticator));
        Assert.assertTrue(qe.execAsk());
    }

    @Test
    public void query_with_auth_10() {
        Context ctx = ARQ.getContext();
View Full Code Here

Examples of com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk()

            authContext.put(Service.queryAuthPwd, "password");
            serviceContext.put(serviceQuery, authContext);
            ctx.put(Service.serviceContext, serviceContext);

            qe.setAuthenticator(new ServiceAuthenticator());
            Assert.assertTrue(qe.execAsk());
        } finally {
            ctx.remove(Service.serviceContext);
        }
    }
   
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.