directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r359055 - /directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java
Date Mon, 26 Dec 2005 10:29:43 GMT
Author: elecharny
Date: Mon Dec 26 02:29:39 2005
New Revision: 359055

URL: http://svn.apache.org/viewcvs?rev=359055&view=rev
Log:
Used LdapDN instead of LdapName

Modified:
    directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java?rev=359055&r1=359054&r2=359055&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java
Mon Dec 26 02:29:39 2005
@@ -28,9 +28,7 @@
 import org.apache.ldap.common.filter.AbstractExprNode;
 import org.apache.ldap.common.filter.BranchNode;
 import org.apache.ldap.common.filter.SimpleNode;
-import org.apache.ldap.common.name.LdapName;
-import org.apache.ldap.common.name.SimpleNameComponentNormalizer;
-import org.apache.ldap.common.schema.DeepTrimNormalizer;
+import org.apache.ldap.common.name.LdapDN;
 
 
 /**
@@ -184,22 +182,22 @@
         SubtreeSpecification ss = parser.parse( SPEC_WITH_SPECIFICEXCLUSIONS );
         assertFalse( ss.getChopBeforeExclusions().isEmpty() );
         assertFalse( ss.getChopAfterExclusions().isEmpty() );
-        assertTrue( ss.getChopBeforeExclusions().contains( new LdapName( "ab=cd" ) ) );
-        assertTrue( ss.getChopAfterExclusions().contains( new LdapName( "ef=gh" ) ) );
+        assertTrue( ss.getChopBeforeExclusions().contains( new LdapDN( "ab=cd" ) ) );
+        assertTrue( ss.getChopAfterExclusions().contains( new LdapDN( "ef=gh" ) ) );
 
         // try a second time
         ss = parser.parse( SPEC_WITH_SPECIFICEXCLUSIONS );
         assertFalse( ss.getChopBeforeExclusions().isEmpty() );
         assertFalse( ss.getChopAfterExclusions().isEmpty() );
-        assertTrue( ss.getChopBeforeExclusions().contains( new LdapName( "ab=cd" ) ) );
-        assertTrue( ss.getChopAfterExclusions().contains( new LdapName( "ef=gh" ) ) );
+        assertTrue( ss.getChopBeforeExclusions().contains( new LdapDN( "ab=cd" ) ) );
+        assertTrue( ss.getChopAfterExclusions().contains( new LdapDN( "ef=gh" ) ) );
 
         // try a third time
         ss = parser.parse( SPEC_WITH_SPECIFICEXCLUSIONS );
         assertFalse( ss.getChopBeforeExclusions().isEmpty() );
         assertFalse( ss.getChopAfterExclusions().isEmpty() );
-        assertTrue( ss.getChopBeforeExclusions().contains( new LdapName( "ab=cd" ) ) );
-        assertTrue( ss.getChopAfterExclusions().contains( new LdapName( "ef=gh" ) ) );
+        assertTrue( ss.getChopBeforeExclusions().contains( new LdapDN( "ab=cd" ) ) );
+        assertTrue( ss.getChopAfterExclusions().contains( new LdapDN( "ef=gh" ) ) );
     }
 
 
@@ -243,7 +241,7 @@
     {
         SubtreeSpecification ss = parser.parse( SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM );
         
-        assertEquals( new LdapName( "ou=ORGANIZATION UNIT" ) , ss.getBase() );
+        assertEquals( new LdapDN( "ou=ORGANIZATION UNIT" ) , ss.getBase() );
         assertEquals( 1 , ss.getMinBaseDistance());
         assertEquals( 2 , ss.getMaxBaseDistance());
     }
@@ -258,10 +256,10 @@
         assertNotNull ( ss );
         
         assertEquals ( "ou=people", ss.getBase().toString() );
-        assertTrue ( ss.getChopBeforeExclusions().contains( new LdapName( "x=y" ) ) );
-        assertTrue ( ss.getChopBeforeExclusions().contains( new LdapName( "y=z" ) ) );
-        assertTrue ( ss.getChopAfterExclusions().contains( new LdapName( "k=l" ) ) );
-        assertTrue ( ss.getChopAfterExclusions().contains( new LdapName( "l=m" ) ) );
+        assertTrue ( ss.getChopBeforeExclusions().contains( new LdapDN( "x=y" ) ) );
+        assertTrue ( ss.getChopBeforeExclusions().contains( new LdapDN( "y=z" ) ) );
+        assertTrue ( ss.getChopAfterExclusions().contains( new LdapDN( "k=l" ) ) );
+        assertTrue ( ss.getChopAfterExclusions().contains( new LdapDN( "l=m" ) ) );
         assertEquals ( 7 , ss.getMinBaseDistance() );
         assertEquals ( 77 , ss.getMaxBaseDistance() );
     }
@@ -347,9 +345,7 @@
     public void testSpecWithBaseNormalizing() throws Exception
     {
         // create a new normalizing parser for this test case 
-        SubtreeSpecificationParser parser = new SubtreeSpecificationParser(
-                                                new SimpleNameComponentNormalizer(
-                                                    new DeepTrimNormalizer()));
+        SubtreeSpecificationParser parser = new SubtreeSpecificationParser();
         SubtreeSpecification ss = parser.parse( SPEC_WITH_BASE_NORMALIZING );
         assertNotNull( ss );
         



Mime
View raw message