directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r987114 - in /directory/shared/branches/shared-codec-merge/dsml-parser/src: main/java/org/apache/directory/shared/dsmlv2/reponse/ main/java/org/apache/directory/shared/dsmlv2/request/ test/java/org/apache/directory/shared/dsmlv2/extendedRes...
Date Thu, 19 Aug 2010 10:33:14 GMT
Author: elecharny
Date: Thu Aug 19 10:33:13 2010
New Revision: 987114

URL: http://svn.apache.org/viewvc?rev=987114&view=rev
Log:
Fixed a bunch of errors. 24 errors still to be fixed, instead of 60 yesterday

Modified:
    directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
    directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
    directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=987114&r1=987113&r2=987114&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
(original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
Thu Aug 19 10:33:13 2010
@@ -1059,6 +1059,10 @@ public class Dsmlv2ResponseGrammar exten
             {
                 extendedResponse = new ExtendedResponseImpl( ParserUtils.parseAndVerifyRequestID(
attributeValue, xpp ) );
             }
+            else
+            {
+                extendedResponse = new ExtendedResponseImpl( -1 );
+            }
 
             container.getBatchResponse().addResponse( extendedResponse );
 
@@ -1427,7 +1431,7 @@ public class Dsmlv2ResponseGrammar exten
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ResultResponse ldapResponse = ( ResultResponse ) container.getBatchResponse().getCurrentResponse();
+            Response ldapResponse = container.getBatchResponse().getCurrentResponse();
 
             LdapResult ldapResult = null;
 
@@ -1440,7 +1444,7 @@ public class Dsmlv2ResponseGrammar exten
             }
             else
             {
-                ldapResult = ldapResponse.getLdapResult();
+                ldapResult = ( ( ResultResponse ) ldapResponse ).getLdapResult();
             }
 
             XmlPullParser xpp = container.getParser();

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=987114&r1=987113&r2=987114&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
(original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
Thu Aug 19 10:33:13 2010
@@ -2281,6 +2281,7 @@ public class Dsmlv2Grammar extends Abstr
             }
             else
             {
+                searchRequest.setFilter( searchRequest.getFilter() );
                 searchRequest.setCurrentFilter( null );
             }
         }

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java?rev=987114&r1=987113&r2=987114&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
Thu Aug 19 10:33:13 2010
@@ -522,7 +522,7 @@ public class ExtendedResponseTest extend
 
         LdapResult ldapResult = extendedResponse.getLdapResult();
 
-        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getName()
);
+        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", ldapResult.getMatchedDn().getNormName()
);
     }
 
 

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java?rev=987114&r1=987113&r2=987114&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
Thu Aug 19 10:33:13 2010
@@ -35,16 +35,16 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.dsmlv2.AbstractTest;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
-import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
-import org.apache.directory.shared.ldap.codec.search.PresentFilter;
 import org.apache.directory.shared.ldap.filter.AndNode;
 import org.apache.directory.shared.ldap.filter.ApproximateNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.filter.ExtensibleNode;
 import org.apache.directory.shared.ldap.filter.GreaterEqNode;
 import org.apache.directory.shared.ldap.filter.LessEqNode;
 import org.apache.directory.shared.ldap.filter.NotNode;
 import org.apache.directory.shared.ldap.filter.OrNode;
+import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.filter.SearchScope;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
 import org.apache.directory.shared.ldap.message.AliasDerefMode;
@@ -1528,11 +1528,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof PresentFilter );
+        assertTrue( filter instanceof PresenceNode );
 
-        PresentFilter presentFilter = ( PresentFilter ) filter;
+        PresenceNode presentFilter = ( PresenceNode ) filter;
 
-        assertEquals( "givenName", presentFilter.getAttributeDescription().toString() );
+        assertEquals( "givenName", presentFilter.getAttribute() );
     }
 
 
@@ -1571,13 +1571,13 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertEquals( "A Value", extensibleMatchFilter.getMatchValue().getString() );
+        assertEquals( "A Value", extensibleMatchFilter.getValue().getString() );
 
-        assertEquals( false, extensibleMatchFilter.isDnAttributes() );
+        assertEquals( false, extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1606,13 +1606,13 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertEquals( "DSMLv2.0 rocks!!", extensibleMatchFilter.getMatchValue().getString()
);
+        assertEquals( "DSMLv2.0 rocks!!", extensibleMatchFilter.getValue().getString() );
 
-        assertEquals( false, extensibleMatchFilter.isDnAttributes() );
+        assertEquals( false, extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1641,13 +1641,13 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertNull( extensibleMatchFilter.getMatchValue() );
+        assertNull( extensibleMatchFilter.getValue() );
 
-        assertEquals( false, extensibleMatchFilter.isDnAttributes() );
+        assertEquals( false, extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1696,11 +1696,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertTrue( extensibleMatchFilter.isDnAttributes() );
+        assertTrue( extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1729,11 +1729,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertTrue( extensibleMatchFilter.isDnAttributes() );
+        assertTrue( extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1762,11 +1762,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertFalse( extensibleMatchFilter.isDnAttributes() );
+        assertFalse( extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1795,11 +1795,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertFalse( extensibleMatchFilter.isDnAttributes() );
+        assertFalse( extensibleMatchFilter.hasDnAttributes() );
     }
 
 
@@ -1838,11 +1838,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertEquals( "AMatchingRuleName", extensibleMatchFilter.getMatchingRule().toString()
);
+        assertEquals( "AMatchingRuleName", extensibleMatchFilter.getMatchingRuleId() );
     }
 
 
@@ -1871,11 +1871,11 @@ public class SearchRequestTest extends A
 
         ExprNode filter = searchRequest.getFilter();
 
-        assertTrue( filter instanceof ExtensibleMatchFilter );
+        assertTrue( filter instanceof ExtensibleNode );
 
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) filter;
+        ExtensibleNode extensibleMatchFilter = ( ExtensibleNode ) filter;
 
-        assertEquals( "givenName", extensibleMatchFilter.getType().toString() );
+        assertEquals( "givenName", extensibleMatchFilter.getAttribute() );
     }
 
 

Modified: directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java?rev=987114&r1=987113&r2=987114&view=diff
==============================================================================
--- directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
(original)
+++ directory/shared/branches/shared-codec-merge/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
Thu Aug 19 10:33:13 2010
@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 
 import java.util.Collection;
-import java.util.List;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
@@ -493,15 +492,13 @@ public class SearchResultDoneTest extend
 
         LdapResult ldapResult = searchResultDone.getLdapResult();
 
-        List<String> referrals = ( List<String> ) ldapResult.getReferral().getLdapUrls();
+        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();
 
         assertEquals( 1, referrals.size() );
 
-        Object referral = referrals.get( 0 );
-
         try
         {
-            assertEquals( new LdapURL( "ldap://www.apache.org/" ).toString(), referral.toString()
);
+            assertTrue( referrals.contains( new LdapURL( "ldap://www.apache.org/" ).toString()
) );
         }
         catch ( LdapURLEncodingException e )
         {



Mime
View raw message