summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Padgett2011-11-09 09:18:53 (EST)
committer Michael Fiedler2011-11-09 09:18:53 (EST)
commit6e40ee24b761a4952683932d126a91a29c86e8f4 (patch)
treef668b99237e69d6345520a1ee3b1e09aeb0f3bde
parent8d9759ce86f4ddf105de73382a4d50300f4ecb4b (diff)
downloadorg.eclipse.lyo.testsuite-6e40ee24b761a4952683932d126a91a29c86e8f4.zip
org.eclipse.lyo.testsuite-6e40ee24b761a4952683932d126a91a29c86e8f4.tar.gz
org.eclipse.lyo.testsuite-6e40ee24b761a4952683932d126a91a29c86e8f4.tar.bz2
Bug362367 - Add support for inlined change requests
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestXmlTests.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestXmlTests.java
index ab02195..0c1e12b 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/server/oslcv2tests/ChangeRequestXmlTests.java
@@ -120,9 +120,15 @@ public class ChangeRequestXmlTests extends TestsBase {
EntityUtils.consume(resp.getEntity());
assertTrue("Received " +resp.getStatusLine(), (resp.getStatusLine().getStatusCode() == HttpStatus.SC_OK));
//Get XML Doc from response
- Document doc = OSLCUtils.createXMLDocFromResponseBody(respBody);
- Node result = (Node) OSLCUtils.getXPath().evaluate("//rdfs:member/@rdf:resource",
- doc, XPathConstants.NODE);
+ Document doc = OSLCUtils.createXMLDocFromResponseBody(respBody);
+ //Check for results by reference (rdf:resource)
+ Node result = (Node) OSLCUtils.getXPath().evaluate("//rdfs:member/@rdf:resource",
+ doc, XPathConstants.NODE);
+ if (result == null)
+ //No results by reference. Check for inline results (rdf:about)
+ result = (Node) OSLCUtils.getXPath().evaluate(
+ "//rdfs:member/oslc_cm_v2:ChangeRequest/@rdf:about", doc,
+ XPathConstants.NODE);
if (result != null)
results.add(result.getNodeValue());
if (onlyOnce)