directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r922001 - in /directory: clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/
Date Thu, 11 Mar 2010 20:12:47 GMT
Author: kayyagari
Date: Thu Mar 11 20:12:46 2010
New Revision: 922001

URL: http://svn.apache.org/viewvc?rev=922001&view=rev
Log:
o fixed DIRSERVER-1476 by modifying the LdapTransformer.transformFiletr(ExprNode) method
o added a test case in client-api to test the fix

Modified:
    directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientSearchRequestTest.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java

Modified: directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientSearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientSearchRequestTest.java?rev=922001&r1=922000&r2=922001&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientSearchRequestTest.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/ClientSearchRequestTest.java
Thu Mar 11 20:12:46 2010
@@ -32,12 +32,14 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.message.SearchRequest;
 import org.apache.directory.ldap.client.api.message.SearchResponse;
 import org.apache.directory.ldap.client.api.message.SearchResultDone;
+import org.apache.directory.ldap.client.api.message.SearchResultEntry;
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.cursor.Cursor;
+import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.name.DN;
@@ -125,6 +127,23 @@ public class ClientSearchRequestTest ext
     
 
     @Test
+    public void testSearchEquality() throws Exception
+    {
+        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(objectclass=organizationalUnit)",
SearchScope.ONELEVEL, "*",
+            "+" );
+        int count = 0;
+        while ( cursor.next() )
+        {
+            Entry entry = ( ( SearchResultEntry ) cursor.get() ).getEntry();
+            assertNotNull(  entry );
+            count++;
+        }
+        
+        assertEquals( 4, count );
+    }
+    
+    
+    @Test
     public void testAsyncSearch() throws Exception
     {
         SearchFuture searchFuture = connection.searchAsync( "ou=system", "(objectclass=*)",
SearchScope.ONELEVEL, "*",

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java?rev=922001&r1=922000&r2=922001&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java
Thu Mar 11 20:12:46 2010
@@ -617,7 +617,7 @@ public class LdapTransformer
                     {
                         filter = new AttributeValueAssertionFilter( LdapConstants.EQUALITY_MATCH_FILTER
);
                         AttributeValueAssertion assertion = new AttributeValueAssertion();
-                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAssertionType().name()
);
+                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAttribute()
);
                         assertion.setAssertionValue( ((EqualityNode<?>)exprNode).getValue()
);
                         ((AttributeValueAssertionFilter)filter).setAssertion( assertion );
                     }
@@ -625,7 +625,7 @@ public class LdapTransformer
                     {
                         filter = new AttributeValueAssertionFilter( LdapConstants.GREATER_OR_EQUAL_FILTER
);
                         AttributeValueAssertion assertion = new AttributeValueAssertion();
-                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAssertionType().name()
);
+                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAttribute()
);
                         assertion.setAssertionValue( ((EqualityNode<?>)exprNode).getValue()
);
                         ((AttributeValueAssertionFilter)filter).setAssertion( assertion );
                     }
@@ -633,7 +633,7 @@ public class LdapTransformer
                     {
                         filter = new AttributeValueAssertionFilter( LdapConstants.LESS_OR_EQUAL_FILTER
);
                         AttributeValueAssertion assertion = new AttributeValueAssertion();
-                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAssertionType().name()
);
+                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAttribute()
);
                         assertion.setAssertionValue( ((EqualityNode<?>)exprNode).getValue()
);
                         ((AttributeValueAssertionFilter)filter).setAssertion( assertion );
                     }
@@ -641,7 +641,7 @@ public class LdapTransformer
                     {
                         filter = new AttributeValueAssertionFilter( LdapConstants.APPROX_MATCH_FILTER
);
                         AttributeValueAssertion assertion = new AttributeValueAssertion();
-                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAssertionType().name()
);
+                        assertion.setAttributeDesc( ((EqualityNode<?>)exprNode).getAttribute()
);
                         assertion.setAssertionValue( ((EqualityNode<?>)exprNode).getValue()
);
                         ((AttributeValueAssertionFilter)filter).setAssertion( assertion );
                     }



Mime
View raw message