directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 37090 - in incubator/directory/ldap/trunk/common/src: java/org/apache/ldap/common/message test/org/apache/ldap/common/message
Date Thu, 26 Aug 2004 16:51:03 GMT
Author: akarasulu
Date: Thu Aug 26 09:51:02 2004
New Revision: 37090

Modified:
   incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
   incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/message/ExtendedRequestImplTest.java
Log:
fixed a few bugs for ExtendedRequestImpl and its test

Modified: incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
(original)
+++ incubator/directory/ldap/trunk/common/src/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
Thu Aug 26 09:51:02 2004
@@ -142,9 +142,22 @@
         }
 
         ExtendedRequest req = ( ExtendedRequest ) obj;
-        if ( ! oid.equals( req.getOid() ) )
+        if ( oid != null && req.getOid() == null )
         {
             return false;
+        }
+
+        if ( oid == null && req.getOid() != null )
+        {
+            return false;
+        }
+
+        if ( oid != null && req.getOid() != null )
+        {
+            if ( ! oid.equals( req.getOid() ) )
+            {
+                return false;
+            }
         }
 
         if ( payload != null && req.getPayload() == null )

Modified: incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/message/ExtendedRequestImplTest.java
==============================================================================
--- incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/message/ExtendedRequestImplTest.java
(original)
+++ incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/message/ExtendedRequestImplTest.java
Thu Aug 26 09:51:02 2004
@@ -55,8 +55,8 @@
         req0.setPayload( "Hello World!".getBytes() );
 
         ExtendedRequestImpl req1 = new ExtendedRequestImpl( 5 );
-        req0.setOid( "1.1.1.1" );
-        req0.setPayload( "Hello World!".getBytes() );
+        req1.setOid( "1.1.1.1" );
+        req1.setPayload( "Hello World!".getBytes() );
 
         assertTrue( req0.equals( req1 ) );
         assertTrue( req1.equals( req0 ) );
@@ -130,7 +130,7 @@
 
             public byte[] getPayload()
             {
-                return new byte[0];
+                return null;
             }
 
             public void setPayload( byte[] payload )
@@ -139,7 +139,7 @@
 
             public MessageTypeEnum getResponseType()
             {
-                return MessageTypeEnum.COMPARERESPONSE;
+                return MessageTypeEnum.EXTENDEDRESP;
             }
 
             public boolean hasResponse()
@@ -149,7 +149,7 @@
 
             public MessageTypeEnum getType()
             {
-                return MessageTypeEnum.COMPAREREQUEST;
+                return MessageTypeEnum.EXTENDEDREQ;
             }
 
             public Collection getControls()

Mime
View raw message