directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r807400 - in /directory: apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/ apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/ apacheds/branches/apa...
Date Mon, 24 Aug 2009 22:04:07 GMT
Author: elecharny
Date: Mon Aug 24 22:04:06 2009
New Revision: 807400

URL: http://svn.apache.org/viewvc?rev=807400&view=rev
Log:
Removed the LdapSyntaxDescription class and used LdapSynhtax instead

Modified:
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
    directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemSyntaxCheckerProducer.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxChecker/LdapSyntaxDescriptionSyntaxChecker.java
    directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
Mon Aug 24 22:04:06 2009
@@ -33,13 +33,13 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimNormalizer;
 import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
 import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.LdapComparatorDescription;
-import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescription;
 import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescriptionSchemaParser;
@@ -714,25 +714,27 @@
         
         Attributes attrs = getSubschemaSubentryAttributes();
         Attribute attrTypes = attrs.get( "ldapSyntaxes" );
-        LdapSyntaxDescription syntaxDescription = null; 
+        LdapSyntax ldapSyntax = null;
+        
         for ( int ii = 0; ii < attrTypes.size(); ii++ )
         {
             String desc = ( String ) attrTypes.get( ii );
+            
             if ( desc.indexOf( oid ) != -1 )
             {
-                syntaxDescription = ldapSyntaxDescriptionSchemaParser.parseLdapSyntaxDescription(
desc );
+                ldapSyntax = ldapSyntaxDescriptionSchemaParser.parseLdapSyntaxDescription(
desc );
                 break;
             }
         }
      
         if ( isPresent )
         {
-            assertNotNull( syntaxDescription );
-            assertEquals( oid, syntaxDescription.getOid() );
+            assertNotNull( ldapSyntax );
+            assertEquals( oid, ldapSyntax.getOid() );
         }
         else
         {
-            assertNull( syntaxDescription );
+            assertNull( ldapSyntax );
         }
 
         // -------------------------------------------------------------------
@@ -898,7 +900,7 @@
         if ( isPresent )
         {
             assertNotNull( matchingRuleDescription );
-            assertEquals( oid, matchingRuleDescription.getNumericOid() );
+            assertEquals( oid, matchingRuleDescription.getOid() );
         }
         else
         {
@@ -937,11 +939,11 @@
         
         if ( isPresent ) 
         { 
-            assertTrue( service.getRegistries().getMatchingRuleRegistry().hasMatchingRule(
oid ) );
+            assertTrue( service.getRegistries().getMatchingRuleRegistry().contains( oid )
);
         }
         else
         {
-            assertFalse( service.getRegistries().getMatchingRuleRegistry().hasMatchingRule(
oid ) );
+            assertFalse( service.getRegistries().getMatchingRuleRegistry().contains( oid
) );
         }
     }
     

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/DescriptionParsers.java
Mon Aug 24 22:04:06 2009
@@ -26,7 +26,6 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.constants.MetaSchemaConstants;
-import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -51,13 +50,11 @@
 import org.apache.directory.shared.ldap.schema.parsers.DITContentRuleDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.DITStructureRuleDescription;
 import org.apache.directory.shared.ldap.schema.parsers.DITStructureRuleDescriptionSchemaParser;
-import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescription;
 import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescription;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleUseDescription;
 import org.apache.directory.shared.ldap.schema.parsers.MatchingRuleUseDescriptionSchemaParser;
-import org.apache.directory.shared.ldap.schema.parsers.NameFormDescription;
 import org.apache.directory.shared.ldap.schema.parsers.NameFormDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescription;
 import org.apache.directory.shared.ldap.schema.parsers.NormalizerDescriptionSchemaParser;
@@ -65,6 +62,7 @@
 import org.apache.directory.shared.ldap.schema.parsers.ObjectClassDescriptionSchemaParser;
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescription;
 import org.apache.directory.shared.ldap.schema.parsers.SyntaxCheckerDescriptionSchemaParser;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 
 
 /**
@@ -511,10 +509,10 @@
 
 
     /**
-     * Parses a set of ldapSyntaxDescriptions held within an attribute into 
+     * Parses a set of ldapSyntaxes held within an attribute into 
      * schema entities.
      * 
-     * @param attr the attribute containing ldapSyntaxDescriptions
+     * @param attr the attribute containing ldapSyntaxes
      * @return the set of Syntax objects for the descriptions 
      * @throws NamingException if there are problems parsing the descriptions
      */
@@ -531,22 +529,22 @@
         
         for ( Value<?> value:attr )
         {
-            LdapSyntaxDescription desc = null;
+            LdapSyntax ldapSyntax = null;
             
             try
             {
-                desc = syntaxParser.parseLdapSyntaxDescription( value.getString() );
+                ldapSyntax = syntaxParser.parseLdapSyntaxDescription( value.getString() );
             }
             catch ( ParseException e )
             {
                 LdapInvalidAttributeValueException iave = new LdapInvalidAttributeValueException(

-                    "The following does not conform to the ldapSyntaxDescription syntax:
" + value.getString(), 
+                    "The following does not conform to the ldapSyntax description syntax:
" + value.getString(), 
                     ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 iave.setRootCause( e );
                 throw iave;
             }
             
-            if ( ! dao.hasSyntaxChecker( desc.getOid() ) )
+            if ( ! dao.hasSyntaxChecker( ldapSyntax.getOid() ) )
             {
                 throw new LdapOperationNotSupportedException(
                     "Cannot permit the addition of a syntax without the prior creation of
a " +
@@ -554,9 +552,7 @@
                     ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
 
-            LdapSyntax ldapSyntax = new LdapSyntax( desc.getOid() );
-            setSchemaObjectProperties( desc, ldapSyntax );
-            ldapSyntax.setHumanReadable( isHumanReadable( desc ) );
+            ldapSyntax.setHumanReadable( isHumanReadable( ldapSyntax ) );
             syntaxes[pos++] = ldapSyntax;
         }
         
@@ -738,11 +734,11 @@
         
         for ( Value<?> value:attr )
         {
-            NameFormDescription desc = null;
+            NameForm nf = null;
             
             try
             {
-                desc = nameFormParser.parseNameFormDescription( value.getString() );
+                nf = nameFormParser.parseNameFormDescription( value.getString() );
             }
             catch ( ParseException e )
             {
@@ -753,13 +749,6 @@
                 throw iave;
             }
             
-            NameFormImpl nf = new NameFormImpl( desc.getNumericOid(), globalRegistries );
-            nf.setMayUseOids( desc.getMayAttributeTypes().toArray( EMPTY ) );
-            nf.setMustUseOids( desc.getMustAttributeTypes().toArray( EMPTY ) );
-            nf.setObjectClassOid( desc.getStructuralObjectClass() );
-            
-            setSchemaObjectProperties( desc, nf );
-            
             nameForms[pos++] = nf;
         }
         
@@ -779,11 +768,8 @@
         obj.setDescription( desc.getDescription() );
         obj.setSchemaName( getSchema( desc ) );
 
-        if ( ! ( desc instanceof LdapSyntaxDescription ) )
-        {
-            obj.setNames( desc.getNames() );
-            obj.setObsolete( desc.isObsolete() );
-        }
+        obj.setNames( desc.getNames() );
+        obj.setObsolete( desc.isObsolete() );
     }
     
     
@@ -791,12 +777,12 @@
      * Checks to see if the syntax description is human readable by checking 
      * for the presence of the X-IS-HUMAN_READABLE schema extension.
      * 
-     * @param desc the ldapSyntaxDescription 
+     * @param desc the ldapSyntax 
      * @return true if the syntax is human readable, false otherwise
      */
-    private boolean isHumanReadable( LdapSyntaxDescription desc )
+    private boolean isHumanReadable( LdapSyntax ldapSyntax )
     {
-        List<String> values = desc.getExtensions().get( MetaSchemaConstants.X_IS_HUMAN_READABLE
);
+        List<String> values = ldapSyntax.getExtensions().get( MetaSchemaConstants.X_IS_HUMAN_READABLE
);
         
         if ( values == null || values.size() == 0 )
         {

Modified: directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemSyntaxCheckerProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemSyntaxCheckerProducer.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemSyntaxCheckerProducer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/SystemSyntaxCheckerProducer.java
Mon Aug 24 22:04:06 2009
@@ -23,8 +23,8 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
-import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.ldap.schema.syntaxChecker.ACIItemSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntaxChecker.AcceptAllSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntaxChecker.AccessPointSyntaxChecker;

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
Mon Aug 24 22:04:06 2009
@@ -22,9 +22,6 @@
 
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
-
-
 
 /**
  * A syntax definition. Each attribute stored in a directory has a defined

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
Mon Aug 24 22:04:06 2009
@@ -22,6 +22,7 @@
 
 import java.text.ParseException;
 
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -60,10 +61,10 @@
      * </pre>
      * 
      * @param ldapSyntaxDescription the LDAP syntay description to be parsed
-     * @return the parsed LdapSyntaxDescription bean
+     * @return the parsed LdapSyntax bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized LdapSyntaxDescription parseLdapSyntaxDescription( String ldapSyntaxDescription
)
+    public synchronized LdapSyntax parseLdapSyntaxDescription( String ldapSyntaxDescription
)
         throws ParseException
     {
 
@@ -77,8 +78,9 @@
 
         try
         {
-            LdapSyntaxDescription lsd = parser.ldapSyntaxDescription();
-            return lsd;
+            LdapSyntax ldapSyntax = parser.ldapSyntaxDescription();
+            ldapSyntax.setSpecification( ldapSyntaxDescription );
+            return ldapSyntax;
         }
         catch ( RecognitionException re )
         {
@@ -102,9 +104,9 @@
      * Parses a LdapSyntax description
      * 
      * @param The LdapSyntax description to parse
-     * @return An instance of LdapSyntaxDescription
+     * @return An instance of LdapSyntax
      */
-    public LdapSyntaxDescription parse( String schemaDescription ) throws ParseException
+    public LdapSyntax parse( String schemaDescription ) throws ParseException
     {
         return parseLdapSyntaxDescription( schemaDescription );
     }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxChecker/LdapSyntaxDescriptionSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxChecker/LdapSyntaxDescriptionSyntaxChecker.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxChecker/LdapSyntaxDescriptionSyntaxChecker.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxChecker/LdapSyntaxDescriptionSyntaxChecker.java
Mon Aug 24 22:04:06 2009
@@ -52,7 +52,7 @@
     /** The serialVersionUID */
     private static final long serialVersionUID = 1L;
 
-    /** The schema parser used to parse the LdapSyntaxDescription Syntax */
+    /** The schema parser used to parse the LdapSyntax description Syntax */
     private LdapSyntaxDescriptionSchemaParser schemaParser = new LdapSyntaxDescriptionSchemaParser();
 
 

Modified: directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java?rev=807400&r1=807399&r2=807400&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParserTest.java
Mon Aug 24 22:04:06 2009
@@ -22,7 +22,7 @@
 
 import java.text.ParseException;
 
-import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescription;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.parsers.LdapSyntaxDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -113,22 +113,23 @@
     public void testFull() throws ParseException
     {
         String value = null;
-        LdapSyntaxDescription lsd = null;
+        LdapSyntax ldapSyntax = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577'
X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
-        lsd = parser.parseLdapSyntaxDescription( value );
+        ldapSyntax = parser.parseLdapSyntaxDescription( value );
 
-        assertEquals( "1.2.3.4.5.6.7.8.9.0", lsd.getOid() );
-        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", lsd.getDescription()
);
-        assertEquals( 2, lsd.getExtensions().size() );
-        assertNotNull( lsd.getExtensions().get( "X-TEST-a" ) );
-        assertEquals( 2, lsd.getExtensions().get( "X-TEST-a" ).size() );
-        assertEquals( "test1-1", lsd.getExtensions().get( "X-TEST-a" ).get( 0 ) );
-        assertEquals( "test1-2", lsd.getExtensions().get( "X-TEST-a" ).get( 1 ) );
-        assertNotNull( lsd.getExtensions().get( "X-TEST-b" ) );
-        assertEquals( 2, lsd.getExtensions().get( "X-TEST-b" ).size() );
-        assertEquals( "test2-1", lsd.getExtensions().get( "X-TEST-b" ).get( 0 ) );
-        assertEquals( "test2-2", lsd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( "1.2.3.4.5.6.7.8.9.0", ldapSyntax.getOid() );
+        assertEquals( "Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577", ldapSyntax.getDescription()
);
+        assertEquals( 2, ldapSyntax.getExtensions().size() );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-TEST-a" ) );
+        assertEquals( 2, ldapSyntax.getExtensions().get( "X-TEST-a" ).size() );
+        assertEquals( "test1-1", ldapSyntax.getExtensions().get( "X-TEST-a" ).get( 0 ) );
+        assertEquals( "test1-2", ldapSyntax.getExtensions().get( "X-TEST-a" ).get( 1 ) );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-TEST-b" ) );
+        assertEquals( 2, ldapSyntax.getExtensions().get( "X-TEST-b" ).size() );
+        assertEquals( "test2-1", ldapSyntax.getExtensions().get( "X-TEST-b" ).get( 0 ) );
+        assertEquals( "test2-2", ldapSyntax.getExtensions().get( "X-TEST-b" ).get( 1 ) );
+        assertEquals( value, ldapSyntax.getSpecification() );
     }
 
 
@@ -154,14 +155,15 @@
     public void testRfcBinary() throws ParseException
     {
         String value = "( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' X-NOT-HUMAN-READABLE
'TRUE' )";
-        LdapSyntaxDescription lsd = parser.parseLdapSyntaxDescription( value );
+        LdapSyntax ldapSyntax = parser.parseLdapSyntaxDescription( value );
 
-        assertEquals( "1.3.6.1.4.1.1466.115.121.1.5", lsd.getOid() );
-        assertEquals( "Binary", lsd.getDescription() );
-        assertEquals( 1, lsd.getExtensions().size() );
-        assertNotNull( lsd.getExtensions().get( "X-NOT-HUMAN-READABLE" ) );
-        assertEquals( 1, lsd.getExtensions().get( "X-NOT-HUMAN-READABLE" ).size() );
-        assertEquals( "TRUE", lsd.getExtensions().get( "X-NOT-HUMAN-READABLE" ).get( 0 )
);
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.5", ldapSyntax.getOid() );
+        assertEquals( "Binary", ldapSyntax.getDescription() );
+        assertEquals( 1, ldapSyntax.getExtensions().size() );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-NOT-HUMAN-READABLE" ) );
+        assertEquals( 1, ldapSyntax.getExtensions().get( "X-NOT-HUMAN-READABLE" ).size()
);
+        assertEquals( "TRUE", ldapSyntax.getExtensions().get( "X-NOT-HUMAN-READABLE" ).get(
0 ) );
+        assertEquals( value, ldapSyntax.getSpecification() );
     }
 
 
@@ -172,10 +174,11 @@
     public void testSyntaxWithExtensions() throws ParseException
     {
         String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 DESC 'bogus description' X-SCHEMA
'blah' X-IS-HUMAN-READABLE 'true' )";
-        LdapSyntaxDescription desc = parser.parseLdapSyntaxDescription( substrate );
-        assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", desc.getOid() );
-        assertEquals( "bogus description", desc.getDescription() );
-        assertNotNull( desc.getExtensions().get( "X-IS-HUMAN-READABLE" ) );
+        LdapSyntax ldapSyntax = parser.parseLdapSyntaxDescription( substrate );
+        assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", ldapSyntax.getOid() );
+        assertEquals( "bogus description", ldapSyntax.getDescription() );
+        assertNotNull( ldapSyntax.getExtensions().get( "X-IS-HUMAN-READABLE" ) );
+        assertEquals( substrate, ldapSyntax.getSpecification() );
     }
 
 



Mime
View raw message