directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1788924 - in /directory/shared/branches/shared-value/ldap: client/api/src/main/java/org/apache/directory/ldap/client/api/ model/src/main/java/org/apache/directory/api/ldap/model/entry/ model/src/test/java/org/apache/directory/api/ldap/mode...
Date Mon, 27 Mar 2017 12:35:39 GMT
Author: elecharny
Date: Mon Mar 27 12:35:38 2017
New Revision: 1788924

URL: http://svn.apache.org/viewvc?rev=1788924&view=rev
Log:
o Applied Stefan's patch on exception
o Applied Radovan's patch on HR flag when the AT does not have a Syntax
o Fixed the TelephoneNumber SC test

Modified:
    directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
    directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/BinaryValueAttributeTypeTest.java
    directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/StringValueAttributeTypeTest.java
    directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1788924&r1=1788923&r2=1788924&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Mon Mar 27 12:35:38 2017
@@ -4268,7 +4268,7 @@ public class LdapNetworkConnection exten
                     }
                     else
                     {
-                        throw new InvalidConnectionException( exception.getMessage() );
+                        throw new InvalidConnectionException( exception.getMessage(), exception
);
                     }
                 }
 

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java?rev=1788924&r1=1788923&r2=1788924&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
Mon Mar 27 12:35:38 2017
@@ -208,7 +208,10 @@ public class Value implements Cloneable,
         {
             if ( attributeType.getSyntax() == null )
             {
-                throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX )
);
+                // Some broken LDAP servers do not have proper syntax definitions, default
to HR
+                LOG.info( I18n.err( I18n.ERR_04445_NO_SYNTAX ) );
+                isHR = true;
+                //throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX
) );
             }
             else
             {
@@ -239,7 +242,10 @@ public class Value implements Cloneable,
         {
             if ( attributeType.getSyntax() == null )
             {
-                throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX )
);
+                // Some broken LDAP servers do not have proper syntax definitions, default
to HR
+                LOG.info( I18n.err( I18n.ERR_04445_NO_SYNTAX ) );
+                isHR = true;
+                //throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX
) );
             }
             else
             {
@@ -311,7 +317,10 @@ public class Value implements Cloneable,
         {
             if ( attributeType.getSyntax() == null )
             {
-                throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX )
);
+                // Some broken LDAP servers do not have proper syntax definitions, default
to HR
+                LOG.info( I18n.err( I18n.ERR_04445_NO_SYNTAX ) );
+                isHR = true;
+                //throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX
) );
             }
             else
             {
@@ -372,7 +381,10 @@ public class Value implements Cloneable,
         {
             if ( attributeType.getSyntax() == null )
             {
-                throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX )
);
+                // Some broken LDAP servers do not have proper syntax definitions, default
to HR
+                LOG.info( I18n.err( I18n.ERR_04445_NO_SYNTAX ) );
+                isHR = true;
+                //throw new IllegalArgumentException( I18n.err( I18n.ERR_04445_NO_SYNTAX
) );
             }
             else
             {

Modified: directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/BinaryValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/BinaryValueAttributeTypeTest.java?rev=1788924&r1=1788923&r2=1788924&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/BinaryValueAttributeTypeTest.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/BinaryValueAttributeTypeTest.java
Mon Mar 27 12:35:38 2017
@@ -202,13 +202,14 @@ public class BinaryValueAttributeTypeTes
      * Test the constructor with bad AttributeType
      * @throws LdapInvalidAttributeValueException 
      */
-    @Test( expected=IllegalArgumentException.class)
+    @Test
     public void testBadConstructor()
     {
-        // create a AT without no syntax
+        // create a AT with no syntax
         MutableAttributeType attribute = new MutableAttributeType( "1.1.3.1" );
 
-        Value.createValue( attribute );
+        Value value = Value.createValue( attribute );
+        assertTrue( value.isHumanReadable() );
     }
 
 

Modified: directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/StringValueAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/StringValueAttributeTypeTest.java?rev=1788924&r1=1788923&r2=1788924&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/StringValueAttributeTypeTest.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/entry/StringValueAttributeTypeTest.java
Mon Mar 27 12:35:38 2017
@@ -329,15 +329,9 @@ public class StringValueAttributeTypeTes
         // create a AT without any syntax
         AttributeType attribute = new EntryUtils.AT( "1.1.3.1" );
 
-        try
-        {
-            Value.createValue( attribute );
-            fail();
-        }
-        catch ( IllegalArgumentException iae )
-        {
-            // Expected...
-        }
+        Value value = Value.createValue( attribute );
+        
+        assertTrue( value.isHumanReadable() );
     }
 
 

Modified: directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java?rev=1788924&r1=1788923&r2=1788924&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxes/TelephoneNumberSyntaxCheckerTest.java
Mon Mar 27 12:35:38 2017
@@ -98,6 +98,7 @@ public class TelephoneNumberSyntaxChecke
     public void testWithNewMandatoryRegexp()
     {
         // Adding french telephone number regexp
+        checker = new TelephoneNumberSyntaxChecker();
         checker.setDefaultRegexp( " *0[1-8](( *|[-/.]{1})\\d\\d){4} *" );
 
         assertFalse( checker.isValidSyntax( "+ 123 ( 456 )7891   12345" ) );



Mime
View raw message