Author: bdaw
Date: 2010-08-02 11:13:53 -0400 (Mon, 02 Aug 2010)
New Revision: 340
Modified:
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java
idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
Log:
PLIDM-20 - FeaturesMetaDataImpl.getSupportedRelationshipTypes() doesn't return correct
data in some cases
Modified:
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java 2010-07-29
20:04:34 UTC (rev 339)
+++
idm/branches/1.1.0/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/store/FeaturesMetaDataImpl.java 2010-08-02
15:13:53 UTC (rev 340)
@@ -60,6 +60,7 @@
// <Relationship Type, <From IdentityType, To IdentityType>>
private final Map<String, Map<String, Set<String>>>
supportedRelationshipMappings = new HashMap<String, Map<String,
Set<String>>>();
+ private final Set<String> supportedRelationshipTypes = new
HashSet<String>();
public FeaturesMetaDataImpl(IdentityStoreConfigurationMetaData configurationMD,
Set<IdentityObjectSearchCriteriaType>
supportedCriteria,
@@ -97,6 +98,12 @@
// Supported relationships
+ for (String type : configurationMD.getSupportedRelationshipTypes())
+ {
+ supportedRelationshipTypes.add(type);
+ }
+
+
for (IdentityObjectTypeMetaData identityObjectTypeMetaData :
configurationMD.getSupportedIdentityTypes())
{
String fromTypeName = identityObjectTypeMetaData.getName();
@@ -211,7 +218,7 @@
public Set<String> getSupportedRelationshipTypes()
{
- return supportedRelationshipMappings.keySet();
+ return Collections.unmodifiableSet(supportedRelationshipTypes);
}
public boolean isCredentialSupported(IdentityObjectType identityObjectType,
IdentityObjectCredentialType credentialType)
Modified:
idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
===================================================================
---
idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2010-07-29
20:04:34 UTC (rev 339)
+++
idm/branches/1.1.0/picketlink-idm-testsuite/src/test/java/org/picketlink/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2010-08-02
15:13:53 UTC (rev 340)
@@ -344,6 +344,11 @@
}
+ public void testMD() throws Exception
+ {
+ assertEquals(2,
store.getSupportedFeatures().getSupportedRelationshipTypes().size());
+ }
+
public void testRelationships() throws Exception
{
commonTest.testRelationships();