directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r803314 - /directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
Date Tue, 11 Aug 2009 22:44:32 GMT
Author: elecharny
Date: Tue Aug 11 22:44:31 2009
New Revision: 803314

URL: http://svn.apache.org/viewvc?rev=803314&view=rev
Log:
Uses ModificationIterm instead of Attribute in order to keep the modification order

Modified:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=803314&r1=803313&r2=803314&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
Tue Aug 11 22:44:31 2009
@@ -1972,20 +1972,20 @@
     // Private Utility Methods 
     // -----------------------------------------------------------------------
     
-
     private void modify( int op, List<String> descriptions, String opAttr ) throws
Exception
     {
         LdapDN dn = new LdapDN( getSubschemaSubentryDN() );
-        Attribute attr = new BasicAttribute( opAttr );
+        
+        // Uses ModificationItem to keep the modification ordering
+        ModificationItem[] modifications = new ModificationItem[ descriptions.size()];
+        int i = 0;
+        
         for ( String description : descriptions )
         {
-            attr.add( description );
+            modifications[i++] = new ModificationItem( op, new BasicAttribute( opAttr, description
) );
         }
         
-        Attributes mods = new BasicAttributes( true );
-        mods.put( attr );
-        
-        getRootContext( service ).modifyAttributes( dn, op, mods );
+        getRootContext( service ).modifyAttributes( dn, modifications );
     }
     
     
@@ -2013,6 +2013,7 @@
     {
         InputStream in = getClass().getResourceAsStream( resource );
         ByteArrayOutputStream out = new ByteArrayOutputStream();
+
         while ( in.available() > 0 )
         {
             out.write( in.read() );



Mime
View raw message