directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r959368 - in /directory/apacheds/trunk: core-api/ core/ core/src/main/java/org/apache/directory/server/core/authz/support/ core/src/test/java/org/apache/directory/server/core/authz/support/
Date Wed, 30 Jun 2010 16:27:14 GMT
Author: elecharny
Date: Wed Jun 30 16:27:14 2010
New Revision: 959368

URL: http://svn.apache.org/viewvc?rev=959368&view=rev
Log:
Fixed the tests accordingly to the modification done in the ACI parser

Modified:
    directory/apacheds/trunk/core-api/pom.xml
    directory/apacheds/trunk/core/pom.xml
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java

Modified: directory/apacheds/trunk/core-api/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/pom.xml?rev=959368&r1=959367&r2=959368&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/pom.xml (original)
+++ directory/apacheds/trunk/core-api/pom.xml Wed Jun 30 16:27:14 2010
@@ -99,6 +99,11 @@
     
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-aci</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-cursor</artifactId>
     </dependency>
     

Modified: directory/apacheds/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/pom.xml?rev=959368&r1=959367&r2=959368&view=diff
==============================================================================
--- directory/apacheds/trunk/core/pom.xml (original)
+++ directory/apacheds/trunk/core/pom.xml Wed Jun 30 16:27:14 2010
@@ -108,6 +108,11 @@
     
     <dependency>
       <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-aci</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
       <artifactId>shared-cursor</artifactId>
     </dependency>
     

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=959368&r1=959367&r2=959368&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
Wed Jun 30 16:27:14 2010
@@ -46,7 +46,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
 
 
 /**
@@ -153,9 +152,11 @@ public class RelatedProtectedItemFilter 
 
                 AllAttributeValuesItem aav = ( AllAttributeValuesItem ) item;
 
-                for ( Iterator<String> j = aav.iterator(); j.hasNext(); )
+                for ( Iterator<AttributeType> iterator = aav.iterator(); iterator.hasNext();
)
                 {
-                    if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName(
j.next() ) ) )
+                    AttributeType attributeType = iterator.next();
+                    
+                    if ( oid.equals( attributeType.getOid() ) )
                     {
                         return true;
                     }
@@ -170,11 +171,11 @@ public class RelatedProtectedItemFilter 
 
                 AttributeTypeItem at = ( AttributeTypeItem ) item;
                 
-                for ( Iterator<String> j = at.iterator(); j.hasNext(); )
+                for ( Iterator<AttributeType> iterator = at.iterator(); iterator.hasNext();
)
                 {
-                    String attrName = j.next();
+                    AttributeType attributeType = iterator.next();
                     
-                    if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName(
attrName ) ) )
+                    if ( oid.equals( attributeType.getOid() ) )
                     {
                         return true;
                     }
@@ -277,11 +278,12 @@ public class RelatedProtectedItemFilter 
                 }
 
                 SelfValueItem sv = ( SelfValueItem ) item;
-                for ( Iterator<String> j = sv.iterator(); j.hasNext(); )
+                
+                for ( Iterator<AttributeType> iterator = sv.iterator(); iterator.hasNext();
)
                 {
-                    String svItem = j.next();
+                    AttributeType attributeType = iterator.next();
                     
-                    if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName(
svItem ) ) )
+                    if ( oid.equals( attributeType.getOid() ) )
                     {
                         EntryAttribute attr = entry.get( oid );
                         

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java?rev=959368&r1=959367&r2=959368&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
Wed Jun 30 16:27:14 2010
@@ -43,6 +43,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -56,7 +57,7 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class MostSpecificProtectedItemFilterTest
 {
-    private static final Set<String> EMPTY_STRING_COLLECTION = Collections.unmodifiableSet(
new HashSet<String>() );
+    private static final Set<AttributeType> EMPTY_STRING_COLLECTION = Collections.unmodifiableSet(
new HashSet<AttributeType>() );
 
     private static final Set<EntryAttribute> EMPTY_ATTRIBUTE_COLLECTION = Collections
         .unmodifiableSet( new HashSet<EntryAttribute>() );

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=959368&r1=959367&r2=959368&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
Wed Jun 30 16:27:14 2010
@@ -176,8 +176,8 @@ public class RelatedProtectedItemFilterT
     @Test 
     public void testAllAttributeValues() throws Exception
     {
-        Set<String> attrTypes = new HashSet<String>();
-        attrTypes.add( "cn" );
+        Set<AttributeType> attrTypes = new HashSet<AttributeType>();
+        attrTypes.add( CN_AT );
         Collection<ACITuple> tuples = getTuples( new AllAttributeValuesItem( attrTypes
) );
 
         // Test wrong scope
@@ -197,8 +197,8 @@ public class RelatedProtectedItemFilterT
     @Test 
     public void testAttributeType() throws Exception
     {
-        Set<String> attrTypes = new HashSet<String>();
-        attrTypes.add( "cn" );
+        Set<AttributeType> attrTypes = new HashSet<AttributeType>();
+        attrTypes.add( CN_AT );
         Collection<ACITuple> tuples = getTuples( new AttributeTypeItem( attrTypes )
);
 
         // Test wrong scope
@@ -332,8 +332,8 @@ public class RelatedProtectedItemFilterT
     @Test 
     public void testSelfValue() throws Exception
     {
-        Set<String> attrTypes = new HashSet<String>();
-        attrTypes.add( "cn" );
+        Set<AttributeType> attrTypes = new HashSet<AttributeType>();
+        attrTypes.add( CN_AT );
         Collection<ACITuple> tuples = getTuples( new SelfValueItem( attrTypes ) );
 
         Entry entry = new DefaultEntry( schemaManager, USER_NAME );



Mime
View raw message