directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r307434 - /directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/
Date Sun, 09 Oct 2005 13:55:49 GMT
Author: elecharny
Date: Sun Oct  9 06:55:37 2005
New Revision: 307434

URL: http://svn.apache.org/viewcvs?rev=307434&view=rev
Log:
Fixed request and responses test according to the modification of LdapResult grammar :
the matchedDN should be null except in 4 cases.

Modified:
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareRequestTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelRequestTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNRequestTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyResponseTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchRequestTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultDoneTest.java
    directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultReferenceTest.java

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddRequestTest.java
Sun Oct  9 06:55:37 2005
@@ -50,17 +50,17 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x5B );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x59 );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x59, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x57, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
-				0x68, 0x54, 		//     CHOICE { ..., addRequest   AddRequest, ...
+				0x68, 0x52, 		//     CHOICE { ..., addRequest   AddRequest, ...
                         			// AddRequest ::= [APPLICATION 8] SEQUENCE {
 									//     entry           LDAPDN,
-				0x04, 0x22, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', ' ',
'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
'm',
+				0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o',
'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
 									//     attributes      AttributeList }
                 0x30, 0x2E,         // AttributeList ::= SEQUENCE OF SEQUENCE {
                 0x30, 0x0c,         // attribute 1
@@ -99,7 +99,7 @@
 
         // Check the decoded message
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( "cn=testModify, ou=users, ou=system", addRequest.getEntry()
);
+        Assert.assertEquals( "cn=testModify,ou=users,ou=system", addRequest.getEntry() );
 
         Attributes attributes = addRequest.getAttributes();
         
@@ -155,7 +155,7 @@
 	    }
 	    
         // Check the length
-        Assert.assertEquals(0x5B, message.computeLength());
+        Assert.assertEquals(0x59, message.computeLength());
 	    
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/AddResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -40,22 +40,20 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2B, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x0C, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x69, 0x26, 		//        CHOICE { ..., addResponse AddResponse, ...
+				0x69, 0x07, 		//        CHOICE { ..., addResponse AddResponse, ...
                         			// AddResponse ::= [APPLICATION 9] LDAPResult
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 									// }
@@ -84,11 +82,11 @@
         
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, addResponse.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", addResponse.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", addResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", addResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
         
         try
         {

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/BindResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -40,23 +40,21 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2B, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x0C, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x61, 0x26, 		//        CHOICE { ..., bindResponse BindResponse, ...
+				0x61, 0x07, 		//        CHOICE { ..., bindResponse BindResponse, ...
                         			// BindResponse ::= APPLICATION[1] SEQUENCE {
 									//        COMPONENTS OF LDAPResult,
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 									// serverSaslCreds [7] OCTET STRING OPTIONAL }
@@ -85,11 +83,11 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, br.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", br.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", br.getLdapResult().getErrorMessage() );
 
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
 
         // Check the encoding
         try
@@ -114,23 +112,21 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x31 );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x12 );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2F, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x10, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x61, 0x2A, 		//        CHOICE { ..., bindResponse BindResponse, ...
+				0x61, 0x0B, 		//        CHOICE { ..., bindResponse BindResponse, ...
                         			// BindResponse ::= APPLICATION[1] SEQUENCE {
 									//        COMPONENTS OF LDAPResult,
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00,  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 				(byte)0x87, 0x02, 'A', 'B' // serverSaslCreds [7] OCTET STRING OPTIONAL }
@@ -159,12 +155,12 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, br.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", br.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", br.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", br.getLdapResult().getErrorMessage() );
         Assert.assertEquals( "AB", br.getServerSaslCreds().toString());
 
         // Check the length
-        Assert.assertEquals(0x31, message.computeLength());
+        Assert.assertEquals(0x12, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareRequestTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareRequestTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareRequestTest.java
Sun Oct  9 06:55:37 2005
@@ -45,17 +45,17 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x3A );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x38 );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x38, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x36, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
 				            		//     CHOICE { ..., compareRequest   CompareRequest, ...
-				0x6E, 0x33,         // CompareRequest ::= [APPLICATION 14] SEQUENCE {
+				0x6E, 0x31,         // CompareRequest ::= [APPLICATION 14] SEQUENCE {
 				                    //     entry           LDAPDN,
-				0x04, 0x22, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', ' ',
'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
'm',
+				0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o',
'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
 				                    //     ava             AttributeValueAssertion }
 				0x30, 0x0D,         // AttributeValueAssertion ::= SEQUENCE {
                                     //     attributeDesc   AttributeDescription,
@@ -86,12 +86,12 @@
         CompareRequest compareRequest      = message.getCompareRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( "cn=testModify, ou=users, ou=system", compareRequest.getEntry()
);
+        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());
+        Assert.assertEquals(0x38, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/CompareResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -42,22 +42,20 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2B, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x0C, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x6F, 0x26, 		//        CHOICE { ..., compareResponse CompareResponse, ...
+				0x6F, 0x07, 		//        CHOICE { ..., compareResponse CompareResponse, ...
                         			// CompareResponse ::= [APPLICATION 15] LDAPResult
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 									// }
@@ -86,11 +84,11 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, compareResponse.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", compareResponse.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", compareResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", compareResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
         
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelRequestTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelRequestTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelRequestTest.java
Sun Oct  9 06:55:37 2005
@@ -44,18 +44,18 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x29 );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x27 );
         
         stream.put(
             new byte[]
             {
                  
                 
-                0x30, 0x27, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x25, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
 				            		//     CHOICE { ..., delRequest   DelRequest, ...
                         			// DelRequest ::= [APPLICATION 10] LDAPDN;
-				0x4A, 0x22, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', ' ',
'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
'm'
+				0x4A, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o',
'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm'
             } );
 
         String decodedPdu = StringUtils.dumpBytes( stream.array() );
@@ -80,10 +80,10 @@
         DelRequest delRequest      = message.getDelRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( "cn=testModify, ou=users, ou=system", delRequest.getEntry()
);
+        Assert.assertEquals( "cn=testModify,ou=users,ou=system", delRequest.getEntry() );
 
         // Check the length
-        Assert.assertEquals(0x29, message.computeLength());
+        Assert.assertEquals(0x27, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/DelResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -51,7 +51,7 @@
 				0x02, 0x01, 0x01, 	//         messageID MessageID
 				0x6B, 0x26, 		//        CHOICE { ..., delResponse DelResponse, ...
                         			// DelResponse ::= [APPLICATION 11] LDAPResult
-				0x0A, 0x01, 0x00, 	//   LDAPResult ::= SEQUENCE {
+				0x0A, 0x01, 0x21, 	//   LDAPResult ::= SEQUENCE {
 									//		resultCode ENUMERATED {
 									//			success (0), ...
 				 					//      },
@@ -85,7 +85,7 @@
         DelResponse delResponse      = message.getDelResponse();
 
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( 0, delResponse.getLdapResult().getResultCode() );
+        Assert.assertEquals( 33, delResponse.getLdapResult().getResultCode() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", delResponse.getLdapResult().getMatchedDN()
);
         Assert.assertEquals( "", delResponse.getLdapResult().getErrorMessage() );
 

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ExtendedResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -44,23 +44,21 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x3C );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x1D );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x3A, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x1B, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
 				            		//     CHOICE { ..., extendedResp     ExtendedResponse, ...
-				0x78, 0x35,         // ExtendedResponse ::= [APPLICATION 23] SEQUENCE {
+				0x78, 0x16,         // ExtendedResponse ::= [APPLICATION 23] SEQUENCE {
 				                    //     COMPONENTS OF LDAPResult,
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00,  		//      errorMessage LDAPString,
 				                    //		referral     [3] Referral OPTIONAL }				                    //
    requestName      [0] LDAPOID,
 				                    //    responseName     [10] LDAPOID OPTIONAL,
@@ -92,13 +90,13 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, extendedResponse.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", extendedResponse.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
         Assert.assertEquals( "1.3.6.1.5.5.2", extendedResponse.getResponseName() );
         Assert.assertEquals( "value", extendedResponse.getResponse().toString() );
         
         // Check the length
-        Assert.assertEquals(0x3C, message.computeLength());
+        Assert.assertEquals(0x1D, message.computeLength());
         
         // Check the encoding
         try
@@ -123,23 +121,21 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                    0x30, 0x2B, 		// LDAPMessage ::= SEQUENCE {
+                    0x30, 0x0C, 		// LDAPMessage ::= SEQUENCE {
     				0x02, 0x01, 0x01, 	//     messageID MessageID
     				            		//     CHOICE { ..., extendedResp     Response, ...
-    				0x78, 0x26,         // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
+    				0x78, 0x07,         // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
     				                    //     COMPONENTS OF LDAPResult,
     				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
     				0x04, 0x00  		//      errorMessage LDAPString,
     				                    //		referral     [3] Referral OPTIONAL }				                
   //     requestName      [0] LDAPOID,
             } );
@@ -167,11 +163,11 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, extendedResponse.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", extendedResponse.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", extendedResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", extendedResponse.getLdapResult().getErrorMessage() );
 
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNRequestTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNRequestTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNRequestTest.java
Sun Oct  9 06:55:37 2005
@@ -44,19 +44,19 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x4A );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x48 );
         
         stream.put(
             new byte[]
             {
                  
                 
-                0x30, 0x48, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x46, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
-				0x6C, 0x43, 		//     CHOICE { ..., modifyDNRequest   ModifyDNRequest, ...
+				0x6C, 0x41, 		//     CHOICE { ..., modifyDNRequest   ModifyDNRequest, ...
                         			// ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
 									//     entry           LDAPDN,
-				0x04, 0x22, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', ' ',
'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
'm',
+				0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o',
'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
 			                        //     newrdn          RelativeLDAPDN,
                 0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i',
'f', 'y',
                 0x01, 0x01, 0x00,   //     deleteoldrdn    BOOLEAN,
@@ -84,13 +84,13 @@
         ModifyDNRequest modifyDNRequest      = message.getModifyDNRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( "cn=testModify, ou=users, ou=system", modifyDNRequest.getEntry()
);
+        Assert.assertEquals( "cn=testModify,ou=users,ou=system", modifyDNRequest.getEntry()
);
         Assert.assertEquals( false, modifyDNRequest.isDeleteOldRDN() );
         Assert.assertEquals( "cn=testDNModify", modifyDNRequest.getNewRDN() );
         Assert.assertEquals( "ou=system", modifyDNRequest.getNewSuperior() );
 
         // Check the length
-        Assert.assertEquals(0x4A, message.computeLength());
+        Assert.assertEquals(0x48, message.computeLength());
         
         // Check the encoding
         try
@@ -115,19 +115,19 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x3F );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x3D );
         
         stream.put(
             new byte[]
             {
                  
                 
-                0x30, 0x3D, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x3B, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
-				0x6C, 0x38, 		//     CHOICE { ..., modifyDNRequest   ModifyDNRequest, ...
+				0x6C, 0x36, 		//     CHOICE { ..., modifyDNRequest   ModifyDNRequest, ...
                         			// ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
 									//     entry           LDAPDN,
-				0x04, 0x22, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', ' ',
'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
'm',
+				0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o',
'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
 			                        //     newrdn          RelativeLDAPDN,
                 0x04, 0x0F, 'c', 'n', '=', 't', 'e', 's', 't', 'D', 'N', 'M', 'o', 'd', 'i',
'f', 'y',
                 0x01, 0x01, 0x00   //     deleteoldrdn    BOOLEAN,
@@ -154,12 +154,12 @@
         ModifyDNRequest modifyDNRequest      = message.getModifyDNRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( "cn=testModify, ou=users, ou=system", modifyDNRequest.getEntry()
);
+        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());
+        Assert.assertEquals(0x3D, message.computeLength());
         
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyDNResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -42,22 +42,20 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2B, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x0C, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x6D, 0x26, 		//        CHOICE { ..., modifyDNResponse ModifyDNResponse, ...
+				0x6D, 0x07, 		//        CHOICE { ..., modifyDNResponse ModifyDNResponse, ...
                         			// ModifyDNResponse ::= [APPLICATION 13] LDAPResult
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 									// }
@@ -86,11 +84,11 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, modifyDNResponse.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", modifyDNResponse.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", modifyDNResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", modifyDNResponse.getLdapResult().getErrorMessage() );
         
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyRequestTest.java
Sun Oct  9 06:55:37 2005
@@ -51,19 +51,19 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x56 );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x54 );
         
         stream.put(
             new byte[]
             {
                  
                 
-                0x30, 0x54, 		// LDAPMessage ::= SEQUENCE {
+                0x30, 0x52, 		// LDAPMessage ::= SEQUENCE {
 				0x02, 0x01, 0x01, 	//     messageID MessageID
-				0x66, 0x4f, 		//     CHOICE { ..., modifyRequest   ModifyRequest, ...
+				0x66, 0x4d, 		//     CHOICE { ..., modifyRequest   ModifyRequest, ...
                         			// ModifyRequest ::= [APPLICATION 6] SEQUENCE {
 									//     object          LDAPDN,
-				0x04, 0x22, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', ' ',
'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 'o', 'u', '=', 's', 'y', 's', 't', 'e',
'm',
+				0x04, 0x20, 'c', 'n', '=', 't', 'e', 's', 't', 'M', 'o', 'd', 'i', 'f', 'y', ',', 'o',
'u', '=', 'u', 's', 'e', 'r', 's', ',', 'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm',
                 0x30, 0x29,         //     modification    SEQUENCE OF SEQUENCE {
                 0x30, 0x11,
                 0x0A, 0x01, 0x02,   //         operation       ENUMERATED {
@@ -110,7 +110,7 @@
         ModifyRequest modifyRequest      = message.getModifyRequest();
         
         Assert.assertEquals( 1, message.getMessageId() );
-        Assert.assertEquals( "cn=testModify, ou=users, ou=system", modifyRequest.getObject()
);
+        Assert.assertEquals( "cn=testModify,ou=users,ou=system", modifyRequest.getObject()
);
 
         ArrayList modifications = modifyRequest.getModifications();
         
@@ -149,7 +149,7 @@
         }
 
         // Check the length
-        Assert.assertEquals(0x56, message.computeLength());
+        Assert.assertEquals(0x54, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyResponseTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyResponseTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/ModifyResponseTest.java
Sun Oct  9 06:55:37 2005
@@ -42,22 +42,20 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2B, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x0C, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x67, 0x26, 		//        CHOICE { ..., modifyResponse ModifyResponse, ...
+				0x67, 0x07, 		//        CHOICE { ..., modifyResponse ModifyResponse, ...
                         			// ModifyResponse ::= [APPLICATION 7] LDAPResult
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 									// }
@@ -86,11 +84,11 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, modifyResponse.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", modifyResponse.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", modifyResponse.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", modifyResponse.getLdapResult().getErrorMessage() );
         
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchRequestTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchRequestTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchRequestTest.java
Sun Oct  9 06:55:37 2005
@@ -543,12 +543,12 @@
         stream.put(
             new byte[]
             {
-                0x30, 0x38,                   // LDAPMessage ::=SEQUENCE {
+                0x30, 0x37,                   // LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x03, 	          //        messageID MessageID
-				0x63, 0x33,                   //	      CHOICE { ..., searchRequest SearchRequest, ...
+				0x63, 0x32,                   //	      CHOICE { ..., searchRequest SearchRequest, ...
                         			     	  // SearchRequest ::= APPLICATION[3] SEQUENCE {
-				0x04, 0x13, 		     	  //    baseObject LDAPDN,
-				'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',', ' ', 
+				0x04, 0x12, 		     	  //    baseObject LDAPDN,
+				'o', 'u', '=', 'u', 's', 'e', 'r', 's', ',',  
 				'o', 'u', '=', 's', 'y', 's', 't', 'e', 'm', 
 				0x0A, 0x01, 0x00,        	  //    scope           ENUMERATED {
                 					     	  //        baseObject              (0),
@@ -595,7 +595,7 @@
         SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 3, message.getMessageId() );
-        Assert.assertEquals( "ou=users, ou=system", sr.getBaseObject().toString() );
+        Assert.assertEquals( "ou=users,ou=system", sr.getBaseObject().toString() );
         Assert.assertEquals( LdapConstants.SCOPE_BASE_OBJECT, sr.getScope() );
         Assert.assertEquals( LdapConstants.DEREF_ALWAYS, sr.getDerefAliases() );
         Assert.assertEquals( 0, sr.getSizeLimit() );
@@ -613,7 +613,7 @@
        	Assert.assertNull( attributes );
 
         // Check the length
-        Assert.assertEquals(0x3A, message.computeLength());
+        Assert.assertEquals(0x39, message.computeLength());
 
         // Check the encoding
         try
@@ -622,7 +622,7 @@
             
             String encodedPdu = StringUtils.dumpBytes( bb.array() ); 
             
-            Assert.assertEquals(encodedPdu, decodedPdu.substring( 0, decodedPdu.length()
- 30) );
+            Assert.assertEquals(encodedPdu, decodedPdu.substring( 0, decodedPdu.length()
- 35) );
         }
         catch ( EncoderException ee )
         {
@@ -1515,11 +1515,11 @@
         SubstringFilter substringFilter = (SubstringFilter)sr.getFilter();
         Assert.assertNotNull(substringFilter);
         
-        Assert.assertEquals("objectclass", substringFilter.getType().toString());
+        Assert.assertEquals("objectclass", substringFilter.getType().getString());
         Assert.assertEquals(null, substringFilter.getInitialSubstrings());
-        Assert.assertEquals("t", ((LdapString)substringFilter.getAnySubstrings().get(0)).toString());
-        Assert.assertEquals("t", ((LdapString)substringFilter.getAnySubstrings().get(1)).toString());
-        Assert.assertEquals("t", ((LdapString)substringFilter.getAnySubstrings().get(2)).toString());
+        Assert.assertEquals("t", ((LdapString)substringFilter.getAnySubstrings().get(0)).getString());
+        Assert.assertEquals("t", ((LdapString)substringFilter.getAnySubstrings().get(1)).getString());
+        Assert.assertEquals("t", ((LdapString)substringFilter.getAnySubstrings().get(2)).getString());
         Assert.assertEquals(null, substringFilter.getFinalSubstrings());
 
         // The attributes

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultDoneTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultDoneTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultDoneTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultDoneTest.java
Sun Oct  9 06:55:37 2005
@@ -43,22 +43,20 @@
     {
         Asn1Decoder ldapDecoder = new LdapDecoder();
 
-        ByteBuffer  stream      = ByteBuffer.allocate( 0x2D );
+        ByteBuffer  stream      = ByteBuffer.allocate( 0x0E );
         
         stream.put(
             new byte[]
             {
-                0x30, 0x2B, 		// LDAPMessage ::=SEQUENCE {
+                0x30, 0x0C, 		// LDAPMessage ::=SEQUENCE {
 				0x02, 0x01, 0x01, 	//         messageID MessageID
-				0x65, 0x26, 		//        CHOICE { ..., delResponse DelResponse, ...
+				0x65, 0x07, 		//        CHOICE { ..., delResponse DelResponse, ...
                         			// SearchResultDone ::= [APPLICATION 5] LDAPResult
 				0x0A, 0x01, 0x00, 	//   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,			//		matchedDN    LDAPDN,
 				0x04, 0x00  		//      errorMessage LDAPString,
 									//		referral     [3] Referral OPTIONAL }
 									// }
@@ -85,11 +83,11 @@
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, searchResultDone.getLdapResult().getResultCode() );
-        Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", searchResultDone.getLdapResult().getMatchedDN()
);
+        Assert.assertEquals( "", searchResultDone.getLdapResult().getMatchedDN() );
         Assert.assertEquals( "", searchResultDone.getLdapResult().getErrorMessage() );
         
         // Check the length
-        Assert.assertEquals(0x2D, message.computeLength());
+        Assert.assertEquals(0x0E, message.computeLength());
 
         // Check the encoding
         try

Modified: directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultReferenceTest.java?rev=307434&r1=307433&r2=307434&view=diff
==============================================================================
--- directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultReferenceTest.java
(original)
+++ directory/shared/ldap/trunk/apache2-provider/src/test/org/apache/asn1new/ldap/codec/SearchResultReferenceTest.java
Sun Oct  9 06:55:37 2005
@@ -27,6 +27,7 @@
 import org.apache.asn1new.ber.Asn1Decoder;
 import org.apache.asn1new.ber.containers.IAsn1Container;
 import org.apache.asn1new.ldap.codec.primitives.LdapURL;
+import org.apache.asn1new.ldap.codec.primitives.LdapURLEncodingException;
 import org.apache.asn1new.ldap.pojo.LdapMessage;
 import org.apache.asn1new.ldap.pojo.SearchResultReference;
 import org.apache.asn1new.util.StringUtils;
@@ -127,7 +128,7 @@
 	        {
 	            ldapUrlsSet.add( new LdapURL( ldapUrls[i].getBytes() ).toString() );
 	        }
-        } catch (DecoderException de)
+        } catch (LdapURLEncodingException luee)
         {
             Assert.fail();
         }



Mime
View raw message