directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1065732 [2/2] - in /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec: abandon/ bind/ controls/ppolicy/ controls/replication/ del/ search/controls/
Date Mon, 31 Jan 2011 19:57:17 GMT
Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java?rev=1065732&r1=1065731&r2=1065732&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncStateValueControlTest.java
Mon Jan 31 19:57:17 2011
@@ -80,26 +80,8 @@ public class SyncStateValueControlTest
         // Check the encoding
         try
         {
-            ByteBuffer buffer = ByteBuffer.allocate( 0x2E );
-            buffer.put( new byte[]
-                { 
-                  0x30, 0x2C,                            // Control
-                    0x04, 0x18,                          // OID (SuncStateValue)
-                      '1', '.', '3', '.', '6', '.', '1', '.', 
-                      '4', '.', '1', '.', '4', '2', '0', '3', 
-                      '.', '1', '.', '9', '.', '1', '.', '2',
-                    0x04, 0x10,
-                      0x30, 0x0E,                        // SyncStateValue ::= SEQUENCE {
-                        0x0A, 0x01, 0x00,                //     state ENUMERATED {
-                                                         //         present (0)
-                                                         //     }
-                        0x04, 0x03, 'a', 'b', 'c',       //     entryUUID syncUUID OPTIONAL,
-                        0x04, 0x04, 'x', 'k', 'c', 'd'   //     cookie syncCookie OPTIONAL,
-                } );
-            buffer.flip();
-
             ByteBuffer encoded = ((SyncStateValueDecorator)syncStateValue).encode( ByteBuffer.allocate(
((SyncStateValueDecorator)syncStateValue).computeLength() ) );
-            assertEquals( Strings.dumpBytes(buffer.array()), Strings.dumpBytes(encoded.array())
);
+            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array()
) );
         }
         catch ( EncoderException ee )
         {
@@ -135,25 +117,8 @@ public class SyncStateValueControlTest
         // Check the encoding
         try
         {
-            ByteBuffer buffer = ByteBuffer.allocate( 0x28 );
-            buffer.put( new byte[]
-                { 
-                  0x30, 0x26,                            // Control
-                    0x04, 0x18,                          // OID (SuncStateValue)
-                      '1', '.', '3', '.', '6', '.', '1', '.', 
-                      '4', '.', '1', '.', '4', '2', '0', '3', 
-                      '.', '1', '.', '9', '.', '1', '.', '2',
-                    0x04, 0x0A,
-                      0x30, 0x08,                        // SyncStateValue ::= SEQUENCE {
-                        0x0A, 0x01, 0x01,                //     state ENUMERATED {
-                                                         //         add (1)
-                                                         //     }
-                        0x04, 0x03, 'a', 'b', 'c'        //     entryUUID syncUUID OPTIONAL,
-                } );
-            buffer.flip();
-
             ByteBuffer encoded = ((SyncStateValueDecorator)syncStateValue).encode( ByteBuffer.allocate(
((SyncStateValueDecorator)syncStateValue).computeLength() ) );
-            assertEquals( Strings.dumpBytes(buffer.array()), Strings.dumpBytes(encoded.array())
);
+            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array()
) );
         }
         catch ( EncoderException ee )
         {
@@ -190,25 +155,18 @@ public class SyncStateValueControlTest
         // Check the encoding
         try
         {
-            ByteBuffer buffer = ByteBuffer.allocate( 0x28 );
-            buffer.put( new byte[]
-                { 
-                  0x30, 0x26,                            // Control
-                    0x04, 0x18,                          // OID (SuncStateValue)
-                      '1', '.', '3', '.', '6', '.', '1', '.', 
-                      '4', '.', '1', '.', '4', '2', '0', '3', 
-                      '.', '1', '.', '9', '.', '1', '.', '2',
-                    0x04, 0x0A,
-                      0x30, 0x08,                        // SyncStateValue ::= SEQUENCE {
-                        0x0A, 0x01, 0x02,                //     state ENUMERATED {
-                                                         //         modify (2)
-                                                         //     }
-                        0x04, 0x03, 'a', 'b', 'c'        //     entryUUID syncUUID OPTIONAL,
+            bb = ByteBuffer.allocate( 0x0A );
+            bb.put( new byte[]
+                { 0x30, 0x08,                  // SyncStateValue ::= SEQUENCE {
+                    0x0A, 0x01, 0x02,          //     state ENUMERATED {
+                                               //         modify (2)
+                                               //     }
+                    0x04, 0x03, 'a', 'b', 'c'  //     entryUUID syncUUID OPTIONAL
                 } );
-            buffer.flip();
+            bb.flip();
 
             ByteBuffer encoded = ((SyncStateValueDecorator)syncStateValue).encode( ByteBuffer.allocate(
((SyncStateValueDecorator)syncStateValue).computeLength() ) );
-            assertEquals( Strings.dumpBytes(buffer.array()), Strings.dumpBytes(encoded.array())
);
+            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array()
) );
         }
         catch ( EncoderException ee )
         {
@@ -225,7 +183,8 @@ public class SyncStateValueControlTest
     {
         ByteBuffer bb = ByteBuffer.allocate( 0x02 );
         bb.put( new byte[]
-            { 0x30, 0x00 // SyncStateValue ::= SEQUENCE {
+            { 
+              0x30, 0x00 // SyncStateValue ::= SEQUENCE {
             } );
         bb.flip();
 
@@ -243,7 +202,8 @@ public class SyncStateValueControlTest
     {
         ByteBuffer bb = ByteBuffer.allocate( 0x07 );
         bb.put( new byte[]
-            { 0x30, 0x05,                 // SyncStateValue ::= SEQUENCE {
+            { 
+              0x30, 0x05,                 // SyncStateValue ::= SEQUENCE {
                 0x04, 0x03, 'a', 'b', 'c' //     cookie syncCookie OPTIONAL,
             } );
         bb.flip();
@@ -262,7 +222,8 @@ public class SyncStateValueControlTest
     {
         ByteBuffer bb = ByteBuffer.allocate( 0x05 );
         bb.put( new byte[]
-            { 0x30, 0x03,                  // SyncStateValue ::= SEQUENCE {
+            { 
+              0x30, 0x03,                  // SyncStateValue ::= SEQUENCE {
                 0x0A, 0x01, 0x02,          //     state ENUMERATED {
                                            //         modify (2)
                                            //     }
@@ -305,26 +266,8 @@ public class SyncStateValueControlTest
         // Check the encoding
         try
         {
-            ByteBuffer buffer = ByteBuffer.allocate( 0x2E );
-            buffer.put( new byte[]
-                { 
-                  0x30, 0x2C,                            // Control
-                    0x04, 0x18,                          // OID (SuncStateValue)
-                      '1', '.', '3', '.', '6', '.', '1', '.', 
-                      '4', '.', '1', '.', '4', '2', '0', '3', 
-                      '.', '1', '.', '9', '.', '1', '.', '2',
-                    0x04, 0x10,
-                      0x30, 0x0E,                        // SyncStateValue ::= SEQUENCE {
-                        0x0A, 0x01, 0x04,                //     state ENUMERATED {
-                                                         //         present (0)
-                                                         //     }
-                        0x04, 0x03, 'a', 'b', 'c',       //     entryUUID syncUUID OPTIONAL,
-                        0x04, 0x04, 'x', 'k', 'c', 'd'   //     cookie syncCookie OPTIONAL,
-                } );
-            buffer.flip();
-
             ByteBuffer encoded = ((SyncStateValueDecorator)syncStateValue).encode( ByteBuffer.allocate(
((SyncStateValueDecorator)syncStateValue).computeLength() ) );
-            assertEquals( Strings.dumpBytes(buffer.array()), Strings.dumpBytes(encoded.array())
);
+            assertEquals( Strings.dumpBytes( bb.array() ), Strings.dumpBytes( encoded.array()
) );
         }
         catch ( EncoderException ee )
         {

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java?rev=1065732&r1=1065731&r2=1065732&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
Mon Jan 31 19:57:17 2011
@@ -29,18 +29,18 @@ import java.util.Map;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
 import org.apache.directory.shared.ldap.codec.ICodecControl;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.decorators.DeleteResponseDecorator;
+import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
-import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -189,34 +189,27 @@ public class DelResponseTest
 
         stream.put( new byte[]
             {
-                0x30,
-                0x48, // LDAPMessage ::=SEQUENCE {
-                0x02,
-                0x01,
-                0x01, // messageID MessageID
-                0x6B,
-                0x26, // CHOICE { ..., delResponse DelResponse, ...
-                // DelResponse ::= [APPLICATION 11] LDAPResult
-                0x0A,
-                0x01,
-                0x21, // LDAPResult ::= SEQUENCE {
-                // resultCode ENUMERATED {
-                // success (0), ...
-                // },
-                0x04,
-                0x1F, // matchedDN LDAPDN,
-                'u', 'i', 'd', '=', 'a', 'k', 'a', 'r', 'a', 's', 'u', 'l', 'u', ',', 'd',
'c', '=', 'e', 'x', 'a',
-                'm', 'p', 'l', 'e', ',', 'd', 'c', '=', 'c', 'o',
-                'm',
-                0x04,
-                0x00, // errorMessage
-                // LDAPString,
-                // referral [3] Referral OPTIONAL }
-                // }
-                ( byte ) 0xA0,
-                0x1B, // A control
-                0x30, 0x19, 0x04, 0x17, 0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 0x2E,
0x31, 0x2E, 0x31, 0x31,
-                0x33, 0x37, 0x33, 0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32
+                0x30, 0x48,               // LDAPMessage ::=SEQUENCE {
+                  0x02, 0x01, 0x01,       // messageID MessageID
+                  0x6B, 0x26,             // CHOICE { ..., delResponse DelResponse, ...
+                                          // DelResponse ::= [APPLICATION 11] LDAPResult
+                    0x0A, 0x01, 0x21,     // LDAPResult ::= SEQUENCE {
+                                          // resultCode ENUMERATED {
+                                          // success (0), ...
+                                          // },
+                    0x04, 0x1F,           // matchedDN LDAPDN,
+                  'u', 'i', 'd', '=', 'a', 'k', 'a', 'r', 'a', 's', 'u', 'l', 'u', ',', 'd',
'c', '=', 'e', 'x', 'a',
+                  'm', 'p', 'l', 'e', ',', 'd', 'c', '=', 'c', 'o', 'm',
+                    0x04, 0x00,           // errorMessage
+                                          // LDAPString,
+                                          // referral [3] Referral OPTIONAL }
+                                          // }
+                    ( byte ) 0xA0, 0x1B,  // A control
+                      0x30, 0x19, 
+                        0x04, 0x17, 
+                          0x32, 0x2E, 0x31, 0x36, 0x2E, 0x38, 0x34, 0x30, 
+                          0x2E, 0x31, 0x2E, 0x31, 0x31, 0x33, 0x37, 0x33, 
+                          0x30, 0x2E, 0x33, 0x2E, 0x34, 0x2E, 0x32
 
             } );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=1065732&r1=1065731&r2=1065732&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
Mon Jan 31 19:57:17 2011
@@ -245,15 +245,9 @@ public class EntryChangeControlTest
     @Test
     public void testEncodeEntryChangeControl() throws Exception
     {
-        ByteBuffer bb = ByteBuffer.allocate( 0x2A );
+        ByteBuffer bb = ByteBuffer.allocate( 0x0D );
         bb.put( new byte[]
             { 
-            0x30, 0x28,                            // Control
-              0x04, 0x17,                          // OID (SyncRequestValue)
-                '2', '.', '1', '6', '.', '8', '4', '0', 
-                '.', '1', '.', '1', '1', '3', '7', '3', 
-                '0', '.', '3', '.', '4', '.', '7',
-              0x04, 0x0D,
                 0x30, 0x0B,                        // EntryChangeNotification ::= SEQUENCE
{
                   0x0A, 0x01, 0x08,                //     changeType ENUMERATED {
                                                    //         modDN (8)
@@ -283,15 +277,9 @@ public class EntryChangeControlTest
     @Test
     public void testEncodeEntryChangeControlLong() throws Exception
     {
-        ByteBuffer bb = ByteBuffer.allocate( 0x30 );
+        ByteBuffer bb = ByteBuffer.allocate( 0x13 );
         bb.put( new byte[]
             { 
-            0x30, 0x2E,                            // Control
-              0x04, 0x17,                          // OID (SyncRequestValue)
-                '2', '.', '1', '6', '.', '8', '4', '0', 
-                '.', '1', '.', '1', '1', '3', '7', '3', 
-                '0', '.', '3', '.', '4', '.', '7',
-              0x04, 0x13,
                 0x30, 0x11,                        // EntryChangeNotification ::= SEQUENCE
{
                   0x0A, 0x01, 0x08,                //     changeType ENUMERATED {
                                                    //         modDN (8)

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java?rev=1065732&r1=1065731&r2=1065732&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
Mon Jan 31 19:57:17 2011
@@ -56,15 +56,9 @@ public class PSearchControlTest
     @Test
     public void testEncodePSearchControl() throws Exception
     {
-        ByteBuffer bb = ByteBuffer.allocate( 0x28 );
+        ByteBuffer bb = ByteBuffer.allocate( 0x0B );
         bb.put( new byte[]
             { 
-            0x30, 0x26,                            // Control
-              0x04, 0x17,                          // OID (SyncRequestValue)
-                '2', '.', '1', '6', '.', '8', '4', '0', 
-                '.', '1', '.', '1', '1', '3', '7', '3', 
-                '0', '.', '3', '.', '4', '.', '3',
-              0x04, 0x0B,
                 0x30, 0x09,           // PersistentSearch ::= SEQUENCE {
                   0x02, 0x01, 0x01,   // changeTypes INTEGER,
                   0x01, 0x01, 0x00,   // changesOnly BOOLEAN,

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java?rev=1065732&r1=1065731&r2=1065732&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java
Mon Jan 31 19:57:17 2011
@@ -56,7 +56,7 @@ public class PagedSearchControlTest
     @Test
     public void testEncodePagedSearchControl() throws Exception
     {
-        ByteBuffer bb = ByteBuffer.allocate( 0x2A );
+        ByteBuffer bb = ByteBuffer.allocate( 0x0B );
         bb.put( new byte[]
             { 
                 0x30, 0x09,                        // realSearchControlValue ::= SEQUENCE
{
@@ -75,28 +75,13 @@ public class PagedSearchControlTest
             
         bb.flip();
 
-        ByteBuffer buffer = ByteBuffer.allocate( 0x27 );
-        buffer.put( new byte[]
-            { 
-              0x30, 0x25,                            // Control
-                0x04, 0x16,                          // OID (PagedSearch)
-                  '1', '.', '2', '.', '8', '4', '0', '.', 
-                  '1', '1', '3', '5', '5', '6', '.', '1', 
-                  '.', '4', '.', '3', '1', '9',
-                0x04, 0x0B,
-                  0x30, 0x09,                        // realSearchControlValue ::= SEQUENCE
{
-                    0x02, 0x01, 0x20,                // size INTEGER,
-                    0x04, 0x04, 't', 'e', 's', 't'   // cookie OCTET STRING,
-            } );
-        buffer.flip();
-
         PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
         ctrl.setSize( 32 );
         ctrl.setCookie( Strings.getBytesUtf8("test") );
 
-        bb = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
-        String decoded = Strings.dumpBytes(bb.array());
-        String expected = Strings.dumpBytes(buffer.array());
+        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
+        String decoded = Strings.dumpBytes( buffer.array() );
+        String expected = Strings.dumpBytes( bb.array() );
         assertEquals( expected, decoded );
     }
     
@@ -186,28 +171,13 @@ public class PagedSearchControlTest
         bb.flip();
 
 
-        ByteBuffer buffer = ByteBuffer.allocate( 0x27 );
-        buffer.put( new byte[]
-            { 
-              0x30, 0x25,                            // Control
-                0x04, 0x16,                          // OID (PagedSearch)
-                  '1', '.', '2', '.', '8', '4', '0', '.', 
-                  '1', '1', '3', '5', '5', '6', '.', '1', 
-                  '.', '4', '.', '3', '1', '9',
-                0x04, 0x0B,
-                  0x30, 0x09,                        // realSearchControlValue ::= SEQUENCE
{
-                    0x02, 0x01, (byte)0xFF,          // size INTEGER,
-                    0x04, 0x04, 't', 'e', 's', 't'   // cookie OCTET STRING,
-            } );
-        buffer.flip();
-
         PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
         ctrl.setSize( -1 );
         ctrl.setCookie( Strings.getBytesUtf8("test") );
 
-        bb = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
-        String decoded = Strings.dumpBytes(bb.array());
-        String expected = Strings.dumpBytes(buffer.array());
+        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
+        String decoded = Strings.dumpBytes( buffer.array() );
+        String expected = Strings.dumpBytes( bb.array() );
         assertEquals( expected, decoded );
     }
     
@@ -255,28 +225,13 @@ public class PagedSearchControlTest
         assertEquals( 32, pagedSearch.getSize() );
         assertNull( pagedSearch.getCookie() );
             
-        ByteBuffer buffer = ByteBuffer.allocate( 0x23 );
-        buffer.put( new byte[]
-            { 
-              0x30, 0x21,                            // Control
-                0x04, 0x16,                          // OID (PagedSearch)
-                  '1', '.', '2', '.', '8', '4', '0', '.', 
-                  '1', '1', '3', '5', '5', '6', '.', '1', 
-                  '.', '4', '.', '3', '1', '9',
-                0x04, 0x07,
-                  0x30, 0x05,                        // realSearchControlValue ::= SEQUENCE
{
-                    0x02, 0x01, 0x20,                // size INTEGER,
-                    0x04, 0x00                       // cookie OCTET STRING,
-            } );
-        buffer.flip();
-
         PagedResultsDecorator ctrl = new PagedResultsDecorator( codec );
         ctrl.setSize( 32 );
         ctrl.setCookie( null );
 
-        bb = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
-        String decoded = Strings.dumpBytes(bb.array());
-        String expected = Strings.dumpBytes(buffer.array());
+        ByteBuffer buffer = ctrl.encode( ByteBuffer.allocate( ctrl.computeLength() ) );
+        String decoded = Strings.dumpBytes( buffer.array() );
+        String expected = Strings.dumpBytes( bb.array() );
         assertEquals( expected, decoded );
     }
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java?rev=1065732&r1=1065731&r2=1065732&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/SubEntryControlTest.java
Mon Jan 31 19:57:17 2011
@@ -73,23 +73,9 @@ public class SubEntryControlTest
         // test encoding
         try
         {
-            ByteBuffer buffer = ByteBuffer.allocate( 0x20 );
-            buffer.put( new byte[]
-                { 
-                0x30, 0x1E,                            // Control
-                  0x04, 0x17,                          // OID (Subentries)
-                    '1', '.', '3', '.', '6', '.', '1', '.', 
-                    '4', '.', '1', '.', '4', '2', '0', '3', 
-                    '.', '1', '.', '1', '0', '.', '1',
-                  0x04, 0x03,
-                    0x01, 0x01, (byte)0xFF // Visibility ::= BOOLEAN
-                } );
-
-            buffer.flip();
-
-            bb = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
-            String expected = Strings.dumpBytes(buffer.array());
-            String decoded = Strings.dumpBytes(bb.array());
+            ByteBuffer buffer = decorator.encode( ByteBuffer.allocate( decorator.computeLength()
) );
+            String expected = Strings.dumpBytes( bb.array() );
+            String decoded = Strings.dumpBytes( buffer.array() );
             assertEquals( expected, decoded );
         }
         catch( EncoderException e )
@@ -121,23 +107,9 @@ public class SubEntryControlTest
         // test encoding
         try
         {
-            ByteBuffer buffer = ByteBuffer.allocate( 0x20 );
-            buffer.put( new byte[]
-                { 
-                0x30, 0x1E,                            // Control
-                  0x04, 0x17,                          // OID (Subentries)
-                    '1', '.', '3', '.', '6', '.', '1', '.', 
-                    '4', '.', '1', '.', '4', '2', '0', '3', 
-                    '.', '1', '.', '1', '0', '.', '1',
-                  0x04, 0x03,
-                    0x01, 0x01, 0x00 // Visibility ::= BOOLEAN
-                } );
-
-            buffer.flip();
-
-            bb = decorator.encode( ByteBuffer.allocate( decorator.computeLength() ) );
-            String expected = Strings.dumpBytes(buffer.array());
-            String decoded = Strings.dumpBytes(bb.array());
+            ByteBuffer buffer = decorator.encode( ByteBuffer.allocate( decorator.computeLength()
) );
+            String expected = Strings.dumpBytes( bb.array() );
+            String decoded = Strings.dumpBytes( buffer.array() );
             assertEquals( expected, decoded );
         }
         catch( EncoderException e )



Mime
View raw message