directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1731913 - in /directory/shared/trunk: integ/ integ/src/test/java/org/apache/directory/api/ldap/model/name/ ldap/extras/sp/ ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/ ldap/schema/data/ ldap/schema/data/src/test/java/org/...
Date Tue, 23 Feb 2016 17:46:01 GMT
Author: elecharny
Date: Tue Feb 23 17:46:00 2016
New Revision: 1731913

URL: http://svn.apache.org/viewvc?rev=1731913&view=rev
Log:
o Removed the dependency on commons.io

Modified:
    directory/shared/trunk/integ/pom.xml
    directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnTest.java
    directory/shared/trunk/ldap/extras/sp/pom.xml
    directory/shared/trunk/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/JavaStoredProcUtils.java
    directory/shared/trunk/ldap/schema/data/pom.xml
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extractor/SchemaLdifExtractorTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/LdifSchemaLoaderTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/MatchingRuleTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerAddTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerEnableDisableLoadTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadTest.java
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadWithDepsTest.java

Modified: directory/shared/trunk/integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/pom.xml?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/integ/pom.xml (original)
+++ directory/shared/trunk/integ/pom.xml Tue Feb 23 17:46:00 2016
@@ -83,13 +83,6 @@
       <artifactId>api-ldap-codec-standalone</artifactId>
       <scope>test</scope>
     </dependency>
-
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <scope>test</scope>
-    </dependency>
-
   </dependencies>
 
   <properties>

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/DnTest.java
Tue Feb 23 17:46:00 2016
@@ -2735,6 +2735,21 @@ public class DnTest
 
 
     @Test
+    public void testNormalizeBackSlash() throws Exception
+    {
+        Dn dn = new Dn( "cn=A\\,b,dc=com" );
+        dn.apply( schemaManager );
+        
+        System.out.println( dn.toString() );
+        System.out.println( dn );
+        System.out.println( dn.getName() );
+        System.out.println( dn.getNormName() );
+        
+        System.out.println( dn.getRdn().getAva().getValue().getString() );
+    }
+
+
+    @Test
     public void testNormalizeCompositeWithEscaped() throws Exception
     {
         Dn dn = new Dn( "  OU  =  Ex\\+mple + cn = T\\+ST\\  ,  ou  =  COM " );

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnTest.java
Tue Feb 23 17:46:00 2016
@@ -878,27 +878,89 @@ public class SchemaAwareRdnTest
         Rdn rdn = new Rdn( schemaManager, "cn=a\\ b\\ c" );
         assertEquals( "2.5.4.3=a b c", rdn.getNormName() );
     }
+    
+    /*
+    @Test
+        public void testEscapedSpaceInValue() throws LdapException
+    {
+        Rdn rdn1 = new Rdn( schemaManager, "cn=a b c" );
+        Rdn rdn2 = new Rdn( schemaManager, "cn=a\\ b\\ c" );
+        assertEquals( "2.5.4.3=a b c", rdn1.getNormName() );
+        assertEquals( "2.5.4.3=a b c", rdn2.getNormName() );
+        assertTrue( rdn1.equals( rdn2 ) );
+
+        Rdn rdn3 = new Rdn( schemaManager, "cn=\\ a b c\\ " );
+        Rdn rdn4 = new Rdn( schemaManager, "cn=\\ a\\ b\\ c\\ " );
+        assertEquals( "2.5.4.3= a b c ", rdn3.getNormName() );
+        assertEquals( "cn=\\ a b c\\ ", rdn3.getName() );
+        assertEquals( "2.5.4.3=\\ a b c\\ ", rdn4.getNormName() );
+        assertEquals( "cn=\\ a\\ b\\ c\\ ", rdn4.getName() );
+        assertTrue( rdn3.equals( rdn4 ) );
+    }
+    */
+    
+    /*
+    public void testEscapedSpaceInValue2() throws LdapException
+    {
+        Rdn rdn = new Rdn( schemaManager, "cn=\\ a\\ " );
+
+        assertEquals( "cn=\\ a\\ ", rdn.getName() );
+        assertEquals( "2.5.4.3=\\ a\\ ", rdn.getNormName() );
+    }
+    */
 
 
     @Test
     public void testEscapedSpaceInValue() throws LdapException
     {
         Rdn rdn1 = new Rdn( schemaManager, "cn=a b c" );
-        Rdn rdn2 = new Rdn( schemaManager, "cn=a\\ b\\ c" );
         assertEquals( "2.5.4.3=a b c", rdn1.getNormName() );
+
+        Rdn rdn2 = new Rdn( schemaManager, "cn=a\\ b\\ c" );
         assertEquals( "2.5.4.3=a b c", rdn2.getNormName() );
+        
         assertTrue( rdn1.equals( rdn2 ) );
 
         Rdn rdn3 = new Rdn( schemaManager, "cn=\\ a b c\\ " );
-        Rdn rdn4 = new Rdn( schemaManager, "cn=\\ a\\ b\\ c\\ " );
         assertEquals( "2.5.4.3=\\ a b c\\ ", rdn3.getNormName() );
         assertEquals( "cn=\\ a b c\\ ", rdn3.getName() );
+
+        Rdn rdn4 = new Rdn( schemaManager, "cn=\\ a\\ b\\ c\\ " );
         assertEquals( "2.5.4.3=\\ a b c\\ ", rdn4.getNormName() );
         assertEquals( "cn=\\ a\\ b\\ c\\ ", rdn4.getName() );
         assertTrue( rdn3.equals( rdn4 ) );
     }
 
 
+    /**
+     * attributeValue = string / hexstring
+     * string =   [ ( leadchar / pair ) [ *( stringchar / pair )
+     *   ( trailchar / pair ) ] ]
+     * leadchar = LUTF1 / UTFMB
+     * pair = ESC ( ESC / special / hexpair )
+     * special = escaped / SPACE / SHARP / EQUALS
+     * 
+     * --> replace <ESC><special> with <special>
+     * 
+     * '\#' will be replaced by '#'
+     */
+    @Test
+    public void testEscapedHashInValue2() throws LdapException
+    {
+        Rdn rdn = new Rdn( schemaManager, "cn=a\\#b" );
+        assertEquals( "2.5.4.3=a#b", rdn.getNormName() );
+        assertEquals( "cn=a\\#b", rdn.getName() );
+        
+        // Check the AVA
+        assertEquals( "2.5.4.3=a#b", rdn.getAva().getNormName() );
+        assertEquals( "cn=a\\#b", rdn.getAva().getName() );
+        
+        // Check the value
+        assertEquals( "a#b", rdn.getAva().getValue().getNormValue() );
+        assertEquals( "a\\#b", rdn.getAva().getValue().getString() );
+    }
+
+
     @Test
     public void testEscapedHashInValue() throws LdapException
     {

Modified: directory/shared/trunk/ldap/extras/sp/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/sp/pom.xml?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/sp/pom.xml (original)
+++ directory/shared/trunk/ldap/extras/sp/pom.xml Tue Feb 23 17:46:00 2016
@@ -63,11 +63,6 @@
     </dependency> 
 
     <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-    </dependency> 
-
-    <dependency>
       <groupId>commons-lang</groupId>
       <artifactId>commons-lang</artifactId>
     </dependency>
@@ -88,7 +83,6 @@
               org.apache.directory.api.ldap.sp;version=${project.version};-noimport:=true
             </Export-Package>
             <Import-Package>
-              org.apache.commons.io;version=${commons.io.version},
               org.apache.commons.lang;version=${commons.lang.version},
               org.apache.directory.api.ldap.codec.api;version=${project.version},
               org.apache.directory.api.ldap.extras.extended.storedProcedure;version=${project.version},

Modified: directory/shared/trunk/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/JavaStoredProcUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/JavaStoredProcUtils.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/JavaStoredProcUtils.java
(original)
+++ directory/shared/trunk/ldap/extras/sp/src/main/java/org/apache/directory/api/ldap/sp/JavaStoredProcUtils.java
Tue Feb 23 17:46:00 2016
@@ -36,10 +36,10 @@ import javax.naming.ldap.ExtendedRespons
 import javax.naming.ldap.LdapContext;
 
 import org.apache.commons.lang.SerializationUtils;
-import org.apache.commons.io.IOUtils;
 import org.apache.directory.api.ldap.codec.api.LdapApiServiceFactory;
 import org.apache.directory.api.ldap.extras.extended.storedProcedure.StoredProcedureRequestImpl;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.util.IOUtils;
 
 
 /**

Modified: directory/shared/trunk/ldap/schema/data/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/pom.xml?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/pom.xml (original)
+++ directory/shared/trunk/ldap/schema/data/pom.xml Tue Feb 23 17:46:00 2016
@@ -56,12 +56,6 @@
       <artifactId>api-ldap-extras-aci</artifactId>
       <scope>test</scope>
     </dependency>
-
-    <dependency>
-      <groupId>commons-io</groupId>
-      <artifactId>commons-io</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extractor/SchemaLdifExtractorTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extractor/SchemaLdifExtractorTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extractor/SchemaLdifExtractorTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/extractor/SchemaLdifExtractorTest.java
Tue Feb 23 17:46:00 2016
@@ -23,8 +23,8 @@ package org.apache.directory.api.ldap.sc
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
+import org.apache.directory.api.util.FileUtils;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/LdifSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/LdifSchemaLoaderTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/LdifSchemaLoaderTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/LdifSchemaLoaderTest.java
Tue Feb 23 17:46:00 2016
@@ -26,11 +26,11 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.schema.extractor.SchemaLdifExtractor;
 import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.util.exception.Exceptions;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/MatchingRuleTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/MatchingRuleTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/MatchingRuleTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/MatchingRuleTest.java
Tue Feb 23 17:46:00 2016
@@ -28,7 +28,7 @@ import static org.junit.Assert.assertTru
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.api.ldap.model.schema.MatchingRule;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerAddTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerAddTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerAddTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerAddTest.java
Tue Feb 23 17:46:00 2016
@@ -32,7 +32,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.exception.LdapSchemaException;
 import org.apache.directory.api.ldap.model.schema.AttributeType;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerDelTest.java
Tue Feb 23 17:46:00 2016
@@ -30,7 +30,7 @@ import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
-import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.exception.LdapProtocolErrorException;
 import org.apache.directory.api.ldap.model.schema.AttributeType;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerEnableDisableLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerEnableDisableLoadTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerEnableDisableLoadTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerEnableDisableLoadTest.java
Tue Feb 23 17:46:00 2016
@@ -33,7 +33,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.registries.Schema;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadTest.java
Tue Feb 23 17:46:00 2016
@@ -30,7 +30,7 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadWithDepsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadWithDepsTest.java?rev=1731913&r1=1731912&r2=1731913&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadWithDepsTest.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schema/loader/SchemaManagerLoadWithDepsTest.java
Tue Feb 23 17:46:00 2016
@@ -29,7 +29,7 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.io.IOException;
 
-import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.registries.DefaultSchema;



Mime
View raw message