directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r941333 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/ test/java/org/apache/directory/shared/ldap/codec/controls/replication/
Date Wed, 05 May 2010 15:09:54 GMT
Author: kayyagari
Date: Wed May  5 15:09:54 2010
New Revision: 941333

URL: http://svn.apache.org/viewvc?rev=941333&view=rev
Log:
o fixed a missing octet string tag
o fixed the test cases

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java?rev=941333&r1=941332&r2=941333&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java
Wed May  5 15:09:54 2010
@@ -127,7 +127,9 @@ public class SyncModifyDnControl extends
                 break;
         }
 
-        return super.computeLength( syncModDnSeqLength );
+        valueLength = 1 + TLV.getNbBytes( syncModDnSeqLength ) + syncModDnSeqLength;
+        
+        return super.computeLength( valueLength );
     }
 
 
@@ -148,6 +150,10 @@ public class SyncModifyDnControl extends
         // Encode the Control envelop
         super.encode( buffer );
 
+        // Encode the OCTET_STRING tag
+        buffer.put( UniversalTag.OCTET_STRING_TAG );
+        buffer.put( TLV.getBytes( valueLength ) );
+        
         // Encode the SEQ 
         buffer.put( UniversalTag.SEQUENCE_TAG );
         buffer.put( TLV.getBytes( syncModDnSeqLength ) );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java?rev=941333&r1=941332&r2=941333&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java
Wed May  5 15:09:54 2010
@@ -81,14 +81,15 @@ public class SyncModifyDnControlTest
         try
         {
 
-            ByteBuffer buffer = ByteBuffer.allocate( 48 );
+            ByteBuffer buffer = ByteBuffer.allocate( 50 );
             buffer.put( new byte[]
                 { 
-                  0x30, 0x2E,                            // Control
+                  0x30, 0x30,                            // Control
                     0x04, 0x18,                          // OID (SuncStateValue)
                       '1', '.', '3', '.', '6', '.', '1', '.', 
                       '4', '.', '1', '.', '4', '2', '0', '3', 
                       '.', '1', '.', '9', '.', '1', '.', '5',
+                     0x04, 0x14, 
                      0x30, 0x12, 
                       0x04, 0x07, 'u','i','d','=','j','i','m', //     entryDn entryDn
                       ( byte )0x80, 0x07,                     //     move
@@ -144,14 +145,15 @@ public class SyncModifyDnControlTest
         try
         {
 
-            ByteBuffer buffer = ByteBuffer.allocate( 51 );
+            ByteBuffer buffer = ByteBuffer.allocate( 53 );
             buffer.put( new byte[]
                 { 
-                  0x30, 0x31,                            // Control
+                  0x30, 0x33,                            // Control
                     0x04, 0x18,                          // OID (SuncStateValue)
                       '1', '.', '3', '.', '6', '.', '1', '.', 
                       '4', '.', '1', '.', '4', '2', '0', '3', 
                       '.', '1', '.', '9', '.', '1', '.', '5',
+                      0x04, 0x17,
                       0x30, 0x15,                                // SyncModifyDnControl ::=
SEQUENCE {
                       0x04, 0x07, 'u','i','d','=','j','i','m', //     entryDn LDAPDN
                       ( byte )0x00A1, 0x0A,                    //     rename
@@ -209,14 +211,15 @@ public class SyncModifyDnControlTest
         try
         {
 
-            ByteBuffer buffer = ByteBuffer.allocate( 58 );
+            ByteBuffer buffer = ByteBuffer.allocate( 60 );
             buffer.put( new byte[]
                 { 
-                  0x30, 0x38,                            // Control
+                  0x30, 0x3A,                            // Control
                     0x04, 0x18,                          // OID (SuncStateValue)
                       '1', '.', '3', '.', '6', '.', '1', '.', 
                       '4', '.', '1', '.', '4', '2', '0', '3', 
                       '.', '1', '.', '9', '.', '1', '.', '5',
+                      0x04, 0x1E,
                       0x30, 0x1C,                                // SyncModifyDnControl ::=
SEQUENCE {
                       0x04, 0x07, 'u','i','d','=','j','i','m', //     entryDn LDAPDN
                       ( byte )0x00A2, 0x11,                    //     rename



Mime
View raw message