use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.
the class TestRemoteEndpointDriver method remote_driver_graph_uris_01.
/**
* Tests the different ways of specifying multiple values for a parameter
* @throws SQLException
*/
@Test
public void remote_driver_graph_uris_01() throws SQLException {
// May specify key=value pairs multiple times
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&" + RemoteEndpointDriver.PARAM_DEFAULT_GRAPH_URI + "=http://graph/2";
RemoteEndpointDriver driver = (RemoteEndpointDriver) this.getDriver();
try (RemoteEndpointConnection conn = (RemoteEndpointConnection) driver.connect(url, new Properties())) {
Assert.assertEquals(2, conn.getDefaultGraphURIs().size());
}
}
use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.
the class TestRemoteEndpointResultsWithGraphUris method setup.
/**
* Setup for the tests by allocating a Fuseki instance to work with
* @throws SQLException
*/
@BeforeClass
public static void setup() throws SQLException {
FusekiTestServer.ctlBeforeClass();
List<String> defaultGraphUris = Lists.newArrayList(DEFAULT_GRAPH_URI);
connection = new RemoteEndpointConnection(FusekiTestServer.serviceQuery(), FusekiTestServer.serviceUpdate(), defaultGraphUris, null, defaultGraphUris, null, null, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT, null, null);
connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH);
}
use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.
the class TestRemoteEndpointResultsWithResultSetTypes method setup.
/**
* Setup for the tests by allocating a Fuseki instance to work with
* @throws SQLException
*/
@BeforeClass
public static void setup() throws SQLException {
FusekiTestServer.ctlBeforeClass();
connection = new RemoteEndpointConnection(FusekiTestServer.serviceQuery(), FusekiTestServer.serviceUpdate(), null, null, null, null, null, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT, WebContent.contentTypeTextTSV, WebContent.contentTypeRDFJSON);
connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH);
}
use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.
the class TestRemoteEndpointResults method setup.
/**
* Setup for the tests by allocating a Fuseki instance to work with
* @throws SQLException
*/
@BeforeClass
public static void setup() throws SQLException {
FusekiTestServer.ctlBeforeClass();
connection = new RemoteEndpointConnection(FusekiTestServer.serviceQuery(), FusekiTestServer.serviceUpdate(), JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT);
connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH);
}
use of org.apache.jena.jdbc.remote.connections.RemoteEndpointConnection in project jena by apache.
the class TestRemoteEndpointResultsWithAuth method setup.
/**
* Setup for the tests by allocating a Fuseki instance to work with
*
* @throws SQLException
* @throws IOException
*/
@BeforeClass
public static void setup() throws SQLException, IOException {
SecurityHandler sh = FusekiTestAuth.makeSimpleSecurityHandler("/*", USER, PASSWORD);
FusekiTestAuth.setupServer(true, sh);
BasicCredentialsProvider credsProv = new BasicCredentialsProvider();
credsProv.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(USER, PASSWORD));
client = HttpClients.custom().setDefaultCredentialsProvider(credsProv).build();
connection = new RemoteEndpointConnection(FusekiTestAuth.serviceQuery(), FusekiTestAuth.serviceUpdate(), null, null, null, null, client, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT, null, null);
connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH);
}
Aggregations