Search in sources :

Example 6 with RemoteEndpointConnection

use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.

the class TestRemoteEndpointDriver method remote_driver_graph_uris_03.

/**
     * Tests the different ways of specifying multiple values for a parameter
     * @throws SQLException 
     */
@Test
public void remote_driver_graph_uris_03() throws SQLException {
    // May specify combination of multiple key=value pairs and key=value,value comma separated list(s)
    String url = JenaDriver.DRIVER_PREFIX + RemoteEndpointDriver.REMOTE_DRIVER_PREFIX + RemoteEndpointDriver.PARAM_QUERY_ENDPOINT + "=http://example.org/query&" + RemoteEndpointDriver.PARAM_DEFAULT_GRAPH_URI + "=http://graph/1,http://graph/2&" + RemoteEndpointDriver.PARAM_DEFAULT_GRAPH_URI + "=http://graph/3";
    RemoteEndpointDriver driver = (RemoteEndpointDriver) this.getDriver();
    try (RemoteEndpointConnection conn = (RemoteEndpointConnection) driver.connect(url, new Properties())) {
        Assert.assertEquals(3, conn.getDefaultGraphURIs().size());
    }
}
Also used : RemoteEndpointConnection(org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection) Properties(java.util.Properties) Test(org.junit.Test)

Example 7 with RemoteEndpointConnection

use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.

the class TestRemoteEndpointDriver method remote_driver_graph_uris_02.

/**
     * Tests the different ways of specifying multiple values for a parameter
     * @throws SQLException 
     */
@Test
public void remote_driver_graph_uris_02() throws SQLException {
    // May specify key=value,value as comma separated list
    String url = JenaDriver.DRIVER_PREFIX + RemoteEndpointDriver.REMOTE_DRIVER_PREFIX + RemoteEndpointDriver.PARAM_QUERY_ENDPOINT + "=http://example.org/query&" + RemoteEndpointDriver.PARAM_DEFAULT_GRAPH_URI + "=http://graph/1,http://graph/2";
    RemoteEndpointDriver driver = (RemoteEndpointDriver) this.getDriver();
    try (RemoteEndpointConnection conn = (RemoteEndpointConnection) driver.connect(url, new Properties())) {
        Assert.assertEquals(2, conn.getDefaultGraphURIs().size());
    }
}
Also used : RemoteEndpointConnection(org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

RemoteEndpointConnection (org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection)7 BeforeClass (org.junit.BeforeClass)4 Properties (java.util.Properties)3 Test (org.junit.Test)3 UsernamePasswordCredentials (org.apache.http.auth.UsernamePasswordCredentials)1 BasicCredentialsProvider (org.apache.http.impl.client.BasicCredentialsProvider)1 SecurityHandler (org.eclipse.jetty.security.SecurityHandler)1