summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Padgett2011-11-08 15:59:48 (EST)
committer Michael Fiedler2011-11-08 16:45:14 (EST)
commite310a2806aa11fc7d9d9a04885a2198deb6ef3be (patch)
tree60721a67b338b9577e72952c16b6f5271d52e6aa
parent574caf72a920ab26e9d4bdcaafc1bd57ad429ae0 (diff)
downloadorg.eclipse.lyo.testsuite-e310a2806aa11fc7d9d9a04885a2198deb6ef3be.zip
org.eclipse.lyo.testsuite-e310a2806aa11fc7d9d9a04885a2198deb6ef3be.tar.gz
org.eclipse.lyo.testsuite-e310a2806aa11fc7d9d9a04885a2198deb6ef3be.tar.bz2
Bug 363223 - Test suite does not properly set base URI when reading
RDF/XML using Jena
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestRdfXmlTests.java6
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/CreationAndUpdateBaseTests.java2
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderCatalogRdfXmlTests.java6
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderRdfXmlTests.java4
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryRdfXmlTests.java4
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/TestsBase.java6
6 files changed, 19 insertions, 9 deletions
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestRdfXmlTests.java
index aa15827..68938e1 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestRdfXmlTests.java
@@ -78,7 +78,9 @@ public class ChangeRequestRdfXmlTests extends TestsBase {
// Make sure the request succeeded before continuing.
assertEquals(HttpStatus.SC_OK, sc);
- fRdfModel.read(response.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ fRdfModel.read(response.getEntity().getContent(),
+ OSLCUtils.absoluteUrlFromRelative(setupBaseUrl, currentUrl),
+ OSLCConstants.JENA_RDF_XML);
fResource = (Resource) fRdfModel.getResource(currentUrl);
assumeNotNull(fResource);
}
@@ -113,7 +115,7 @@ public class ChangeRequestRdfXmlTests extends TestsBase {
HttpResponse resp = OSLCUtils.getResponseFromUrl(setupBaseUrl, queryBaseUri + query, basicCreds,
OSLCConstants.CT_RDF, headers);
Model queryModel = ModelFactory.createDefaultModel();
- queryModel.read(resp.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ queryModel.read(resp.getEntity().getContent(), queryBaseUri, OSLCConstants.JENA_RDF_XML);
Property member = queryModel.createProperty(OSLCConstants.RDFS_MEMBER);
Resource queryBase = queryModel.getResource(queryBaseUri);
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/CreationAndUpdateBaseTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/CreationAndUpdateBaseTests.java
index b1634f5..c009a4d 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/CreationAndUpdateBaseTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/CreationAndUpdateBaseTests.java
@@ -68,7 +68,7 @@ public class CreationAndUpdateBaseTests extends TestsBase {
@SuppressWarnings("rawtypes")
public static String[] getCreateTemplateTypes() throws FileNotFoundException {
Model m = ModelFactory.createDefaultModel();
- m.read(new StringReader(rdfXmlUpdateTemplate), "http://base.url", "RDF/XML");
+ m.read(new StringReader(rdfXmlUpdateTemplate), "http://base.url", OSLCConstants.JENA_RDF_XML);
Property rdfType = m.getProperty(OSLCConstants.RDF_TYPE_PROP);
RDFUtils.printModel(m);
Selector select = new SimpleSelector(null, rdfType, (RDFNode)null);
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderCatalogRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderCatalogRdfXmlTests.java
index a73a266..836665a 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderCatalogRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderCatalogRdfXmlTests.java
@@ -71,7 +71,9 @@ public class ServiceProviderCatalogRdfXmlTests extends
assertEquals("Did not successfully retrieve catalog at: "
+ currentUrl, HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
- rdfModel.read(response.getEntity().getContent(), currentUrl);
+ rdfModel.read(response.getEntity().getContent(),
+ OSLCUtils.absoluteUrlFromRelative(setupBaseUrl, currentUrl),
+ OSLCConstants.JENA_RDF_XML);
catalog = (Resource) rdfModel.getResource(currentUrl);
assertNotNull("Failed to read Catalog resource at URI: "+currentUrl, catalog);
@@ -100,7 +102,7 @@ public class ServiceProviderCatalogRdfXmlTests extends
data.add(new Object[] { base });
Model rdfModel = ModelFactory.createDefaultModel();
- rdfModel.read(resp.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ rdfModel.read(resp.getEntity().getContent(), base, OSLCConstants.JENA_RDF_XML);
Property catPredicate = rdfModel.createProperty(OSLCConstants.SERVICE_PROVIDER_CATALOG_PROP);
Selector select = new SimpleSelector(null, catPredicate, (RDFNode)null);
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderRdfXmlTests.java
index b82bd1f..9c0ecef 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ServiceProviderRdfXmlTests.java
@@ -76,7 +76,9 @@ public class ServiceProviderRdfXmlTests extends TestsBase {
headers);
assertEquals("Did not successfully retrieve ServiceProvider at: "+currentUrl, HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
- fRdfModel.read(response.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ fRdfModel.read(response.getEntity().getContent(),
+ OSLCUtils.absoluteUrlFromRelative(setupBaseUrl, currentUrl),
+ OSLCConstants.JENA_RDF_XML);
fServiceProvider = (Resource) fRdfModel.getResource(currentUrl);
assertNotNull("Failed to read ServiceProvider resource at URI: "+currentUrl, fServiceProvider);
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryRdfXmlTests.java
index c54051b..d5b471a 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/SimplifiedQueryRdfXmlTests.java
@@ -90,7 +90,9 @@ public class SimplifiedQueryRdfXmlTests extends SimplifiedQueryBaseTests {
assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
Model queryModel = ModelFactory.createDefaultModel();
- queryModel.read(response.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ queryModel.read(response.getEntity().getContent(),
+ OSLCUtils.absoluteUrlFromRelative(setupBaseUrl, currentUrl),
+ OSLCConstants.JENA_RDF_XML);
EntityUtils.consume(response.getEntity());
Resource responseInfoRes = (Resource) queryModel.getResource(currentUrl + query);
assumeNotNull("Expended ResponseInfo/@rdf:about to equal request URL", responseInfoRes);
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/TestsBase.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/TestsBase.java
index 6cf5ed9..a55e105 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/TestsBase.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/TestsBase.java
@@ -331,7 +331,9 @@ public class TestsBase {
// Used to hold RDF from doing service discovery
Model spModel = ModelFactory.createDefaultModel();
- spModel.read(resp.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ spModel.read(resp.getEntity().getContent(),
+ OSLCUtils.absoluteUrlFromRelative(setupBaseUrl, inBaseURL),
+ OSLCConstants.JENA_RDF_XML);
EntityUtils.consume(resp.getEntity());
// Get all the "inlined" definitions for Service Providers, namely
@@ -387,7 +389,7 @@ public class TestsBase {
basicCreds, OSLCConstants.CT_RDF, headers);
Model spModel = ModelFactory.createDefaultModel();
- spModel.read(resp.getEntity().getContent(), OSLCConstants.JENA_RDF_XML);
+ spModel.read(resp.getEntity().getContent(), base, OSLCConstants.JENA_RDF_XML);
Property capProp = spModel.createProperty(propertyUri);
Property usageProp = spModel.createProperty(OSLCConstants.USAGE_PROP);