directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r955090 - in /directory: apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/
Date Tue, 15 Jun 2010 23:38:54 GMT
Author: elecharny
Date: Tue Jun 15 23:38:53 2010
New Revision: 955090

URL: http://svn.apache.org/viewvc?rev=955090&view=rev
Log:
Fixed DIRAPI-17 : the Substring filter was not containing the Attribute, leading to a NPE
when encoding it.

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

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java?rev=955090&r1=955089&r2=955090&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/ClientSearchRequestTest.java
Tue Jun 15 23:38:53 2010
@@ -165,6 +165,33 @@ public class ClientSearchRequestTest ext
     }
 
     
+    /**
+     * Test a search with a Substring filter
+     * @throws Exception
+     */
+    @Test
+    public void testSearchPersonSubstring() throws Exception
+    {
+        SearchFuture searchFuture = connection.searchAsync( "ou=system", "(objectclass=*ers*)",
SearchScope.SUBTREE, "*",
+            "+" );
+        int count = 0;
+        SearchResponse searchResponse = null;
+        do
+        {
+            searchResponse = ( SearchResponse ) searchFuture.get( 100000, TimeUnit.MILLISECONDS
);
+            assertNotNull( searchResponse );
+            
+            if ( !( searchResponse instanceof SearchResultDone ) )
+            {
+                count++;
+            }
+        }
+        while ( !( searchResponse instanceof SearchResultDone ) );
+
+        assertEquals(2, count );
+    }
+
+    
     @Test
     public void testSearchWithDerefAlias() throws Exception
     {

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=955090&r1=955089&r2=955090&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
Tue Jun 15 23:38:53 2010
@@ -644,6 +644,7 @@ public class LdapTransformer
                     // Transform Substring Nodes
                     filter = new SubstringFilter();
 
+                    ((SubstringFilter)filter).setType( ((SubstringNode)exprNode).getAttribute()
);
                     String initialString = ((SubstringNode)exprNode).getInitial();
                     String finalString = ((SubstringNode)exprNode).getFinal();
                     List<String> anyStrings = ((SubstringNode)exprNode).getAny();



Mime
View raw message