Examples of UpdateProcessRemoteBase


Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test(expected = HttpException.class)
    public void update_with_auth_04() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, serviceUpdate);
        // Auth credentials for valid user with correct password BUT not in
        // correct role
        ue.setAuthentication("forbidden", "password".toCharArray());
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test(expected = HttpException.class)
    public void update_with_auth_05() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemoteForm(updates, serviceUpdate);
        // No auth credentials should result in an error
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test(expected = HttpException.class)
    public void update_with_auth_06() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemoteForm(updates, serviceUpdate);
        // Auth credentials for valid user with bad password
        ue.setAuthentication("allowed", "incorrect".toCharArray());
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test
    public void update_with_auth_07() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemoteForm(updates, serviceUpdate);
        // Auth credentials for valid user with correct password
        ue.setAuthentication("allowed", "password".toCharArray());
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test(expected = HttpException.class)
    public void update_with_auth_08() {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemoteForm(updates, serviceUpdate);
        // Auth credentials for valid user with correct password BUT not in
        // correct role
        ue.setAuthentication("forbidden", "password".toCharArray());
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test(expected = HttpException.class)
    public void update_with_auth_09() throws URISyntaxException {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, serviceUpdate);

        // Auth credentials for valid user with correct password but scoped to
        // wrong URI
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI("http://example"), "allowed",
                "password".toCharArray());
        ue.setAuthenticator(authenticator);
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test
    public void update_with_auth_10() throws URISyntaxException {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, serviceUpdate);

        // Auth credentials for valid user with correct password scoped to
        // correct URI
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceUpdate), "allowed", "password".toCharArray());
        ue.setAuthenticator(authenticator);
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

    }

    @Test
    public void update_with_auth_11() throws URISyntaxException {
        UpdateRequest updates = UpdateFactory.create("CREATE SILENT GRAPH <http://graph>");
        UpdateProcessRemoteBase ue = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, serviceUpdate);

        // Auth credentials for valid user with correct password scoped to
        // correct URI
        // Also using pre-emptive auth
        ScopedAuthenticator authenticator = new ScopedAuthenticator(new URI(serviceUpdate), "allowed", "password".toCharArray());
        ue.setAuthenticator(new PreemptiveBasicAuthenticator(authenticator));
        ue.execute();
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

        if (serviceContextMap != null) {
            serviceContextMap.remove(SERVICE);
        }

        UpdateRequest updates = UpdateFactory.create("CREATE GRAPH <http://example>");
        UpdateProcessRemoteBase engine = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, SERVICE);
        Assert.assertNotNull(engine);

        // Check that no settings were changed
        Assert.assertFalse(engine.isUsingAuthentication());
    }
View Full Code Here

Examples of com.hp.hpl.jena.sparql.modify.UpdateProcessRemoteBase

        try {
            serviceContext.put(Service.queryAuthUser, "user");
            serviceContext.put(Service.queryAuthPwd, "password");

            UpdateRequest updates = UpdateFactory.create("CREATE GRAPH <http://example>");
            UpdateProcessRemoteBase engine = (UpdateProcessRemoteBase) UpdateExecutionFactory.createRemote(updates, SERVICE);
            Assert.assertNotNull(engine);

            // Check that auth settings were changed
            Assert.assertTrue(engine.isUsingAuthentication());

        } finally {
            serviceContext.remove(Service.queryAuthUser);
            serviceContext.remove(Service.queryAuthPwd);
        }
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.