Skip to content

Commit 03e4b2b

Browse files
author
James Leigh
authored
Merge pull request #820 from infgeoax/infgeoax/issues/#819-missing-repo-type
issue #819: Missing type for SPARQL repo config
2 parents 0b76c9d + 112d8c7 commit 03e4b2b

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/config/SPARQLRepositoryConfig.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public SPARQLRepositoryConfig() {
4141
}
4242

4343
public SPARQLRepositoryConfig(String queryEndpointUrl) {
44+
this();
4445
setQueryEndpointUrl(queryEndpointUrl);
4546
}
4647

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.eclipse.rdf4j.repository.sparql.config;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.assertEquals;
6+
import static org.junit.Assert.assertNull;
7+
8+
/**
9+
* Tests for {@link SPARQLRepositoryConfig}.
10+
*
11+
* @author infgeoax
12+
*/
13+
public class SPARQLRepositoryConfigTest {
14+
15+
private static final String QUERY_ENDPOINT_URL = "http://example.com/sparql";
16+
17+
private static final String UPDATE_ENDPOINT_URL = "http://example.com/update";
18+
19+
@Test public void testConstructorWithSPARQLEndpoint() {
20+
SPARQLRepositoryConfig config = new SPARQLRepositoryConfig(QUERY_ENDPOINT_URL);
21+
assertEquals(QUERY_ENDPOINT_URL, config.getQueryEndpointUrl());
22+
assertNull(config.getUpdateEndpointUrl());
23+
assertEquals(SPARQLRepositoryFactory.REPOSITORY_TYPE, config.getType());
24+
}
25+
26+
@Test public void testConstructorWithQueryAndUpdateEndpoints() {
27+
SPARQLRepositoryConfig config = new SPARQLRepositoryConfig(QUERY_ENDPOINT_URL, UPDATE_ENDPOINT_URL);
28+
assertEquals(QUERY_ENDPOINT_URL, config.getQueryEndpointUrl());
29+
assertEquals(UPDATE_ENDPOINT_URL, config.getUpdateEndpointUrl());
30+
assertEquals(SPARQLRepositoryFactory.REPOSITORY_TYPE, config.getType());
31+
}
32+
}

0 commit comments

Comments
 (0)