directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r225198 - /directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/
Date Mon, 25 Jul 2005 22:47:45 GMT
Author: elecharny
Date: Mon Jul 25 15:47:33 2005
New Revision: 225198

URL: http://svn.apache.org/viewcvs?rev=225198&view=rev
Log:
- Added a check between the expected length and the computed length for each test
- fixed some errors in PDU size

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultEntryTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultReferenceTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AbandonRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -82,5 +82,8 @@
 
         Assert.assertEquals( 3, message.getMessageId() );
         Assert.assertEquals( 2, abandonRequest.getMessageId() );
+        
+        // Check the length
+        Assert.assertEquals(8, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -160,5 +160,9 @@
 	        
 	        vals.remove( value.toString() );
 	    }
+	    
+        // Check the length
+        Assert.assertEquals(0x5B, message.computeLength());
+	    
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/AddResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -93,5 +93,8 @@
         Assert.assertEquals( 0, addResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", addResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
+
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -93,6 +93,9 @@
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SimpleAuthentication
) );
         Assert.assertEquals( "password", ( ( SimpleAuthentication ) br.getAuthentication()
).getSimple().toString() );
+
+        // Check the length
+        Assert.assertEquals(0x35, message.computeLength());
     }
 
     /**
@@ -189,6 +192,9 @@
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getName() );
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials )
);
         Assert.assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication()
).getMechanism() );
+
+        // Check the length
+        Assert.assertEquals(0x38, message.computeLength());
     }
 
     /**
@@ -199,11 +205,11 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x41 );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x40 );
         stream.put(
             new byte[]
             {
-                0x30, 0x3F, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x3E, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
 				0x60, 0x39, 		//        CHOICE { ..., bindRequest BindRequest, ...
                         			// BindRequest ::= APPLICATION[0] SEQUENCE {
@@ -250,5 +256,8 @@
         Assert.assertEquals( true, ( br.getAuthentication() instanceof SaslCredentials )
);
         Assert.assertEquals( "KERBEROS_V4", ( ( SaslCredentials ) br.getAuthentication()
).getMechanism() );
         Assert.assertEquals( "abcdef", ( ( SaslCredentials ) br.getAuthentication() ).getCredentials().toString()
);
+
+        // Check the length
+        Assert.assertEquals(0x40, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/BindResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -94,6 +94,9 @@
         Assert.assertEquals( 0, br.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", br.getLdapResult().getErrorMessage() );
+
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 
     /**
@@ -150,5 +153,8 @@
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", br.getLdapResult().getErrorMessage() );
         Assert.assertEquals( "AB", br.getServerSaslCreds().toString());
+
+        // Check the length
+        Assert.assertEquals(0x31, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -95,6 +95,9 @@
         Assert.assertEquals( "cn=testModify, ou=users, ou=system", compareRequest.getEntry()
);
         Assert.assertEquals( "test", compareRequest.getAttributeDesc() );
         Assert.assertEquals( "value", compareRequest.getAssertionValue().toString() );
+
+        // Check the length
+        Assert.assertEquals(0x3A, message.computeLength());
     }
 
     /**

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/CompareResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -95,5 +95,8 @@
         Assert.assertEquals( 0, compareResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", compareResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", compareResponse.getLdapResult().getErrorMessage() );
+
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -88,6 +88,9 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "cn=testModify, ou=users, ou=system", delRequest.getEntry()
);
+
+        // Check the length
+        Assert.assertEquals(0x29, message.computeLength());
     }
 
     /**

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -95,5 +95,8 @@
         Assert.assertEquals( 0, delResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", delResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", delResponse.getLdapResult().getErrorMessage() );
+
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -90,6 +90,9 @@
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "1.3.6.1.5.5.2", extendedRequest.getName() );
         Assert.assertEquals( "value", extendedRequest.getValue().toString() );
+        
+        // Check the length
+        Assert.assertEquals(0x16, message.computeLength());
     }
 
     /**
@@ -99,12 +102,12 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x10 );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0F );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x0E, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x0D, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
 				            		//     CHOICE { ..., extendedReq     ExtendedRequest, ...
 				0x77, 0x08,         // ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
@@ -134,5 +137,8 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "1.3.6.1.5.5.2", extendedRequest.getName() );
+        
+        // Check the length
+        Assert.assertEquals(0x0F, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ExtendedResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -103,6 +103,9 @@
         Assert.assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         Assert.assertEquals( "1.3.6.1.5.5.2", extendedResponse.getName() );
         Assert.assertEquals( "value", extendedResponse.getResponse().toString() );
+        
+        // Check the length
+        Assert.assertEquals(0x3C, message.computeLength());
     }
 
     /**
@@ -157,5 +160,8 @@
         Assert.assertEquals( 0, extendedResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", extendedResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
+
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -96,6 +96,8 @@
         Assert.assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
         Assert.assertEquals( "ou=system", modifyDNRequest.getNewSuperior() );
 
+        // Check the length
+        Assert.assertEquals(0x4A, message.computeLength());
     }
 
     /**
@@ -146,5 +148,8 @@
         Assert.assertEquals( "cn=testModify, ou=users, ou=system", modifyDNRequest.getEntry()
);
         Assert.assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
         Assert.assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
+        
+        // Check the length
+        Assert.assertEquals(0x3F, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -95,5 +95,8 @@
         Assert.assertEquals( 0, modifyDNResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", modifyDNResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", modifyDNResponse.getLdapResult().getErrorMessage() );
+        
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -155,5 +155,7 @@
             vals.remove( value.toString() );
         }
 
+        // Check the length
+        Assert.assertEquals(0x56, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java
Mon Jul 25 15:47:33 2005
@@ -95,5 +95,8 @@
         Assert.assertEquals( 0, modifyResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", modifyResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", modifyResponse.getLdapResult().getErrorMessage() );
+        
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -344,6 +344,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x90, message.computeLength());
     }
 
     /**
@@ -480,6 +483,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x7B, message.computeLength());
     }
 
     /**
@@ -573,6 +579,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x65, message.computeLength());
     }
 
     /**
@@ -668,6 +677,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x65, message.computeLength());
     }
 
     /**
@@ -764,6 +776,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x68, message.computeLength());
     }
 
     /**
@@ -861,6 +876,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x6B, message.computeLength());
     }
 
     /**
@@ -956,6 +974,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x68, message.computeLength());
     }
 
     /**
@@ -967,7 +988,7 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x66B );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x6B );
         stream.put(
             new byte[]
             {
@@ -1054,6 +1075,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x6B, message.computeLength());
     }
 
     /**
@@ -1149,6 +1173,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x68, message.computeLength());
     }
 
     /**
@@ -1248,6 +1275,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x6B, message.computeLength());
     }
 
     /**
@@ -1361,6 +1391,9 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x96, message.computeLength());
     }
 
     /**
@@ -1432,5 +1465,8 @@
             
             Assert.assertEquals("attr" + i, attribute.toString());
         }
+        
+        // Check the length
+        Assert.assertEquals(0x75, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java
Mon Jul 25 15:47:33 2005
@@ -93,5 +93,8 @@
         Assert.assertEquals( 0, searchResultDone.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", searchResultDone.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", searchResultDone.getLdapResult().getErrorMessage() );
+        
+        // Check the length
+        Assert.assertEquals(0x2D, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultEntryTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultEntryTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultEntryTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultEntryTest.java
Mon Jul 25 15:47:33 2005
@@ -131,6 +131,9 @@
                 expectedValues.remove( value.toString() );
             }
         }
+        
+        // Check the length
+        Assert.assertEquals(0x50, message.computeLength());
     }
 
     /**
@@ -225,5 +228,8 @@
                 expectedValues.remove( value.toString() );
             }
         }
+        
+        // Check the length
+        Assert.assertEquals(0x7C, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultReferenceTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultReferenceTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultReferenceTest.java
Mon Jul 25 15:47:33 2005
@@ -157,5 +157,7 @@
         
         Assert.assertTrue( ldapUrlsSet.size() == 0 );
         
+        // Check the length
+        Assert.assertEquals(0x3D8, message.computeLength());
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java?rev=225198&r1=225197&r2=225198&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java
Mon Jul 25 15:47:33 2005
@@ -77,5 +77,8 @@
         UnBindRequest br      = message.getUnBindRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
+        
+        // Check the length
+        Assert.assertEquals(7, message.computeLength());
     }
 }



Mime
View raw message