directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r582244 - /directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
Date Fri, 05 Oct 2007 13:05:42 GMT
Author: ersiner
Date: Fri Oct  5 06:05:36 2007
New Revision: 582244

URL: http://svn.apache.org/viewvc?rev=582244&view=rev
Log:
Added test case (commented) for https://issues.apache.org/jira/browse/DIRSERVER-1062.

Modified:
    directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java

Modified: directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java?rev=582244&r1=582243&r2=582244&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/authz/ModifyAuthorizationITest.java
Fri Oct  5 06:05:36 2007
@@ -227,10 +227,10 @@
     private ModificationItemImpl[] toItems( int modOp, Attributes changes ) throws NamingException
     {
         List<ModificationItemImpl> mods = new ArrayList<ModificationItemImpl>();
-        NamingEnumeration list = changes.getAll();
+        NamingEnumeration<? extends Attribute> list = changes.getAll();
         while ( list.hasMore() )
         {
-            Attribute attr = ( Attribute ) list.next();
+            Attribute attr = list.next();
             mods.add( new ModificationItemImpl( modOp, attr ) );
         }
         ModificationItemImpl[] modArray = new ModificationItemImpl[mods.size()];
@@ -545,4 +545,62 @@
         
     }
     
+
+    /**
+     * FIXME https://issues.apache.org/jira/browse/DIRSERVER-1062
+     * 
+    public void testMaxValueCountProtectedItem() throws NamingException
+    {
+        createUser( "billyd", "billyd" );
+        createAccessControlSubentry( "mvcACI",
+            " {" +
+                " identificationTag \"selfControlPasswordACI\"," +
+                " precedence 10," +
+                " authenticationLevel simple," +
+                " itemOrUserFirst userFirst:" + 
+                " {" +
+                    " userClasses { allUsers }," +
+                    " userPermissions" + 
+                    " {" +
+                        " {" +
+                            " protectedItems { entry }," +
+                            " grantsAndDenials { grantModify, grantBrowse }" +
+                        " }" +
+                        " ," +
+                        " {" +
+                            " protectedItems" + 
+                            " {" +
+                                " maxValueCount" + 
+                                " {" +
+                                    " { type description, maxCount 1 }" + 
+                                " }" +
+                                " ," +
+                                " allAttributeValues { description }" + 
+                            " }" +
+                            " ," +
+                            " grantsAndDenials" + 
+                            " {" +
+                                " grantRemove," +
+                                " grantAdd" +
+                            " }" +
+                        " }" +
+                     " }" +
+                " }" +
+            " }" );
+        
+        ModificationItemImpl[] mods = toItems( DirContext.ADD_ATTRIBUTE,
+            new AttributesImpl( "description", "description 1", true ) );
+        
+        assertTrue( checkCanModifyAs( "billyd", "billyd", "ou=testou", mods ) );
+        
+        AttributesImpl attrs = new AttributesImpl(true);
+        AttributeImpl attr = new AttributeImpl( "description" );
+        attr.add( "description 1" );
+        attr.add( "description 2" );
+        attrs.put( attr );
+        mods = toItems( DirContext.ADD_ATTRIBUTE, attrs );
+        
+        assertFalse( checkCanModifyAs( "billyd", "billyd", "ou=testou", mods ) );
+    }
+    */
 }



Mime
View raw message