Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java2
-rw-r--r--org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java13
-rw-r--r--org.eclipse.mylyn.oslc.tests/src/org/eclipse/mylyn/oslc/cm/tests/ServiceDiscoveryTest.java4
-rw-r--r--org.eclipse.mylyn.oslc.tests/xml/service-provider-catalog.xml10
4 files changed, 20 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java
index 43e2213e9..2c637067f 100644
--- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java
+++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java
@@ -79,6 +79,8 @@ public interface IOslcCoreConstants {
public static final String ATTRIBUTE_HINTHEIGHT = "hintHeight"; //$NON-NLS-1$
+ public static final String ATTRIBUTE_ABOUT = "about"; //$NON-NLS-1$
+
// Http header keys
public static final String HEADER_ETAG = "ETag"; //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java
index bb5f8d5fc..be0c3cdcf 100644
--- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java
+++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java
@@ -149,13 +149,13 @@ public abstract class AbstractOslcClient {
Iterator<?> itr = doc.getDescendants(new ElementFilter(IOslcCoreConstants.ELEMENT_SERVICE_PROVIDER_CATALOG));
while (itr.hasNext()) {
Element element = (Element) itr.next();
- if (element.getParent() != doc.getRootElement()) {
- Attribute attrResource = element.getAttribute(IOslcCoreConstants.ATTRIBUTE_RESOURCE,
+ if (element != doc.getRootElement()) {
+ Attribute attrAbout = element.getAttribute(IOslcCoreConstants.ATTRIBUTE_ABOUT,
IOslcCoreConstants.NAMESPACE_RDF);
String title = element.getChild(IOslcCoreConstants.ELEMENT_TITLE, IOslcCoreConstants.NAMESPACE_DC)
.getText();
- if (attrResource != null && attrResource.getValue().length() > 0) {
- providers.add(new OslcServiceProviderCatalog(title, attrResource.getValue()));
+ if (attrAbout != null && attrAbout.getValue().length() > 0) {
+ providers.add(new OslcServiceProviderCatalog(title, attrAbout.getValue()));
}
}
}
@@ -230,7 +230,8 @@ public abstract class AbstractOslcClient {
config.setDescription(element.getText());
}
- itr = doc.getDescendants(new ElementFilter(IOslcCoreConstants.ELEMENT_CREATIONDIALOG));
+ itr = doc.getDescendants(new ElementFilter(IOslcCoreConstants.ELEMENT_CREATIONDIALOG,
+ IOslcCoreConstants.NAMESPACE_OSLC_CM_1_0));
while (itr.hasNext()) {
boolean isDefault = false;
Element element = (Element) itr.next();
@@ -401,7 +402,7 @@ public abstract class AbstractOslcClient {
protected GetMethod createGetMethod(String requestPath) {
GetMethod method = new GetMethod(getRequestPath(requestPath));
- method.setFollowRedirects(false);
+ method.setFollowRedirects(true);
method.setDoAuthentication(true);
// application/xml is returned by oslc servers by default
//method.setRequestHeader("Accept", "application/xml");
diff --git a/org.eclipse.mylyn.oslc.tests/src/org/eclipse/mylyn/oslc/cm/tests/ServiceDiscoveryTest.java b/org.eclipse.mylyn.oslc.tests/src/org/eclipse/mylyn/oslc/cm/tests/ServiceDiscoveryTest.java
index ff2ce4c0a..7b58767eb 100644
--- a/org.eclipse.mylyn.oslc.tests/src/org/eclipse/mylyn/oslc/cm/tests/ServiceDiscoveryTest.java
+++ b/org.eclipse.mylyn.oslc.tests/src/org/eclipse/mylyn/oslc/cm/tests/ServiceDiscoveryTest.java
@@ -97,8 +97,10 @@ public class ServiceDiscoveryTest extends TestCase {
FileInputStream inStream = new FileInputStream(file);
ArrayList<OslcServiceProvider> list = new ArrayList<OslcServiceProvider>();
client.parseServices(inStream, list, new NullProgressMonitor());
- assertEquals(1, list.size());
+ assertEquals(2, list.size());
OslcServiceProvider desc = list.get(0);
+ assertEquals("http://somewhere/catalog", desc.getUrl());
+ desc = list.get(1);
assertEquals("http://mylyn.eclipse.org/oslc/cqrest/repo/7.0.0/db/SAMPL", desc.getUrl());
}
diff --git a/org.eclipse.mylyn.oslc.tests/xml/service-provider-catalog.xml b/org.eclipse.mylyn.oslc.tests/xml/service-provider-catalog.xml
index f725f39f3..df6aad5fb 100644
--- a/org.eclipse.mylyn.oslc.tests/xml/service-provider-catalog.xml
+++ b/org.eclipse.mylyn.oslc.tests/xml/service-provider-catalog.xml
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ServiceProviderCatalog xmlns="http://open-services.net/xmlns/discovery/1.0/" xmlns:dc="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="http://mylyn.eclipse.org/oslc/cqrest/repo/7.0.0/db/">
-<dc:title>Database</dc:title>
+<ServiceProviderCatalog xmlns="http://open-services.net/xmlns/discovery/1.0/" xmlns:dc="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdf:about="http://demo.tasktop.com/oslc/cqrest/">
+<dc:title>Repository</dc:title>
+<entry>
+<ServiceProviderCatalog rdf:about="http://somewhere/catalog">
+<dc:title>ALM</dc:title>
+<details rdf:resource="http://somewhere/webaccess/"/>
+</ServiceProviderCatalog>
+</entry>
<entry>
<ServiceProvider>
<dc:title>SAMPL</dc:title>

Back to the top