directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r433483 - in /directory/branches/apacheds/1.0: core/src/main/java/org/apache/directory/server/core/schema/ server-unit/src/test/java/org/apache/directory/server/
Date Tue, 22 Aug 2006 03:18:06 GMT
Author: akarasulu
Date: Mon Aug 21 20:18:05 2006
New Revision: 433483

URL: http://svn.apache.org/viewvc?rev=433483&view=rev
Log:
fix for DIRSERVER-630

Added:
    directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
      - copied, changed from r433475, directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModification.java
Removed:
    directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModification.java
Modified:
    directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=433483&r1=433482&r2=433483&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Mon Aug 21 20:18:05 2006
@@ -786,6 +786,17 @@
             {
                 objectClassMod = mods[ii];
             }
+            
+            // Freak out under some weird cases
+            if ( mods[0].getAttribute().size() == 0 )
+            {
+                // not ok for add but ok for replace and delete
+                if ( mods[0].getModificationOp() == DirContext.ADD_ATTRIBUTE )
+                {
+                    throw new LdapInvalidAttributeValueException( "No value is not a valid
value for an attribute.", 
+                        ResultCodeEnum.INVALIDATTRIBUTESYNTAX );
+                }
+            }
 
             StringBuffer keybuf = new StringBuffer();
             keybuf.append( mods[ii].getModificationOp() );

Copied: directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
(from r433475, directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModification.java)
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java?p2=directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java&p1=directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModification.java&r1=433475&r2=433483&rev=433483&view=diff
==============================================================================
--- directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModification.java
(original)
+++ directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/IllegalModificationITest.java
Mon Aug 21 20:18:05 2006
@@ -48,7 +48,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: $
  */
-public class IllegalModification extends AbstractServerTest
+public class IllegalModificationITest extends AbstractServerTest
 {
     static final String DN = "cn=Kate Bush,ou=system";
     static final String USER = "uid=admin,ou=system";
@@ -93,7 +93,7 @@
 
         try
         {
-            con.modify( "cn=Kate Bush,dc=example,dc=com", mod );
+            con.modify( "cn=Kate Bush,ou=system", mod );
             fail( "error expected due to empty attribute value" );
         }
         catch ( LDAPException e )
@@ -103,7 +103,6 @@
 
         // Check whether entry is unmodified, i.e. no description
         LDAPEntry entry = con.read( DN );
-        System.err.println( entry );
         assertEquals( "description exists?", null, entry.getAttribute( "description" ) );
     }
 }



Mime
View raw message