aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorttsanton2014-01-13 10:15:18 (EST)
committerttsanton2014-01-13 11:50:28 (EST)
commitd493bbc1800ce0a9ba6f9f5fb90b6552f85875d3 (patch)
tree7b5793951a24823ff1a6b29deff05e96320a6af0
parent3347ac9b8b5d556ba1ffbf7237b419b5c6e8ac1c (diff)
downloadorg.eclipse.lyo.testsuite-d493bbc1800ce0a9ba6f9f5fb90b6552f85875d3.zip
org.eclipse.lyo.testsuite-d493bbc1800ce0a9ba6f9f5fb90b6552f85875d3.tar.gz
org.eclipse.lyo.testsuite-d493bbc1800ce0a9ba6f9f5fb90b6552f85875d3.tar.bz2
Bug 425217 - Test oslc:Service resources have exactly one oslc:domainrefs/changes/82/20582/2
Change-Id: Iadc7de5cf82b25ae4dc20e059356ff2a7985534f Signed-off-by: ttsanton <ttsanton@us.ibm.com>
-rw-r--r--org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/ServiceProviderRdfXmlTests.java39
1 files changed, 27 insertions, 12 deletions
diff --git a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/ServiceProviderRdfXmlTests.java b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/ServiceProviderRdfXmlTests.java
index 983b407..dd7ade0 100644
--- a/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/ServiceProviderRdfXmlTests.java
+++ b/org.eclipse.lyo.testsuite.server/src/main/java/org/eclipse/lyo/testsuite/oslcv2/ServiceProviderRdfXmlTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 IBM Corporation.
+ * Copyright (c) 2011, 2014 IBM Corporation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -196,6 +196,22 @@ public class ServiceProviderRdfXmlTests extends TestsBase {
{
Property dcTitle = fRdfModel.createProperty(OSLCConstants.DC_TITLE_PROP);
assertTrue(fServiceProvider.listProperties(dcTitle).toList().size() <= 1);
+ }
+
+ @Test
+ public void eachServiceHasOneDomain() throws XPathExpressionException
+ {
+ Property domainProp = fRdfModel.createProperty(OSLCConstants.OSLC_V2, "domain");
+ Property serviceProp = fRdfModel.createProperty(OSLCConstants.SERVICE_PROP);
+ List<Statement> list = fServiceProvider.listProperties(serviceProp).toList();
+ for(int i = 0; i < list.size(); i++ )
+ {
+ Statement services = list.get(i);
+ Resource r = services.getResource();
+ // Make sure each service has one domain
+ assertEquals(1, r.listProperties(domainProp).toList().size());
+ }
+
}
@Test
@@ -205,7 +221,15 @@ public class ServiceProviderRdfXmlTests extends TestsBase {
List<?> lst = fServiceProvider.listProperties(service).toList();
assertTrue(lst.size() >= 1);
}
-
+
+ @Test
+ public void serviceProviderHasAtMostOnePublisher()
+ {
+ Property dcPublisher = fRdfModel.createProperty(OSLCConstants.DC_PUBLISHER_PROP);
+ assertTrue(fServiceProvider.listProperties(dcPublisher).toList().size() <= 1);
+ }
+
+
/* TODO: Complete ServiceProvider RDF/XML test validation
@Test
@@ -218,11 +242,7 @@ public class ServiceProviderRdfXmlTests extends TestsBase {
{
}
- @Test
- public void serviceProviderHasAtMostOnePublisher()
- {
- }
-
+
@Test
public void publisherElementsAreValid()
{
@@ -239,11 +259,6 @@ public class ServiceProviderRdfXmlTests extends TestsBase {
}
@Test
- public void eachServiceHasOneDomain()
- {
- }
-
- @Test
public void creationFactoriesAreValid()
{
}