directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r664290 [11/13] - in /directory/shared/branches/bigbang: ./ asn1/src/main/java/org/apache/directory/shared/asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ asn1/...
Date Sat, 07 Jun 2008 06:28:15 GMT
Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java Fri Jun  6 23:28:06 2008
@@ -53,8 +53,8 @@
  */
 public class LdifUtilsTest
 {
-	private String testString = "this is a test";
-	
+    private String testString = "this is a test";
+    
     /**
      * Helper method to build a basic entry used by the Modify tests
      */
@@ -75,181 +75,181 @@
     }
 
     
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char NUL (ASCII code 0)
-	 */
-	@Test
-	public void testIsLdifSafeStartingWithNUL()
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char NUL (ASCII code 0)
+     */
+    @Test
+    public void testIsLdifSafeStartingWithNUL()
     {
-		char c = ( char ) 0;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 0;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char LF (ASCII code 10)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char LF (ASCII code 10)
+     */
     @Test
-	public void testIsLdifSafeStartingWithLF()
+    public void testIsLdifSafeStartingWithLF()
     {
-		char c = ( char ) 10;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 10;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
 
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char CR (ASCII code 13)
-	 */
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char CR (ASCII code 13)
+     */
     @Test
-	public void testIsLdifSafeStartingWithCR()
+    public void testIsLdifSafeStartingWithCR()
     {
-		char c = ( char ) 13;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 13;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
 
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char SPACE (ASCII code 32)
-	 */
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char SPACE (ASCII code 32)
+     */
     @Test
-	public void testIsLdifSafeStartingWithSpace()
+    public void testIsLdifSafeStartingWithSpace()
     {
-		char c = ( char ) 32;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 32;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char COLON (:) (ASCII code 58)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char COLON (:) (ASCII code 58)
+     */
     @Test
-	public void testIsLdifSafeStartingWithColon()
+    public void testIsLdifSafeStartingWithColon()
     {
-		char c = ( char ) 58;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 58;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char LESS_THAN (<) (ASCII code 60)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char LESS_THAN (<) (ASCII code 60)
+     */
     @Test
-	public void testIsLdifSafeStartingWithLessThan()
+    public void testIsLdifSafeStartingWithLessThan()
     {
-		char c = ( char ) 60;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 60;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char with ASCII code 127
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char with ASCII code 127
+     */
     @Test
-	public void testIsLdifSafeStartingWithCharGreaterThan127()
+    public void testIsLdifSafeStartingWithCharGreaterThan127()
     {
-		char c = ( char ) 127;
-		
-		assertTrue( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 127;
+        
+        assertTrue( LdifUtils.isLDIFSafe( c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String starting with the
-	 * char with ASCII code greater than 127
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String starting with the
+     * char with ASCII code greater than 127
+     */
     @Test
-	public void testIsLdifSafeStartingWithCharGreaterThan127Bis()
+    public void testIsLdifSafeStartingWithCharGreaterThan127Bis()
     {
-		char c = ( char ) 222;
-		
-		assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
+        char c = ( char ) 222;
+        
+        assertFalse( LdifUtils.isLDIFSafe( c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String containing the
-	 * char NUL (ASCII code 0)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String containing the
+     * char NUL (ASCII code 0)
+     */
     @Test
-	public void testIsLdifSafeContainsNUL()
+    public void testIsLdifSafeContainsNUL()
     {
-		char c = ( char ) 0;
-		
-		assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
+        char c = ( char ) 0;
+        
+        assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String containing the
-	 * char LF (ASCII code 10)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String containing the
+     * char LF (ASCII code 10)
+     */
     @Test
-	public void testIsLdifSafeContainsLF()
+    public void testIsLdifSafeContainsLF()
     {
-		char c = ( char ) 10;
-		
-		assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
+        char c = ( char ) 10;
+        
+        assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String containing the
-	 * char CR (ASCII code 13)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String containing the
+     * char CR (ASCII code 13)
+     */
     @Test
-	public void testIsLdifSafeContainsCR()
+    public void testIsLdifSafeContainsCR()
     {
-		char c = ( char ) 13;
-		
-		assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
+        char c = ( char ) 13;
+        
+        assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String containing the
-	 * char with ASCII code 127
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String containing the
+     * char with ASCII code 127
+     */
     @Test
-	public void testIsLdifSafeContainsCharGreaterThan127()
+    public void testIsLdifSafeContainsCharGreaterThan127()
     {
-		char c = ( char ) 127;
-		
-		assertTrue( LdifUtils.isLDIFSafe( testString + c + testString ) );
+        char c = ( char ) 127;
+        
+        assertTrue( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String containing a
-	 * char with ASCII code greater than 127
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String containing a
+     * char with ASCII code greater than 127
+     */
     @Test
-	public void testIsLdifSafeContainsCharGreaterThan127Bis()
+    public void testIsLdifSafeContainsCharGreaterThan127Bis()
     {
-		char c = ( char ) 328;
-		
-		assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
+        char c = ( char ) 328;
+        
+        assertFalse( LdifUtils.isLDIFSafe( testString + c + testString ) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a String ending with the
-	 * char SPACE (ASCII code 32)
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a String ending with the
+     * char SPACE (ASCII code 32)
+     */
     @Test
-	public void testIsLdifSafeEndingWithSpace()
+    public void testIsLdifSafeEndingWithSpace()
     {
-		char c = ( char ) 32;
-		
-		assertFalse( LdifUtils.isLDIFSafe( testString  + c) );
+        char c = ( char ) 32;
+        
+        assertFalse( LdifUtils.isLDIFSafe( testString  + c) );
     }
-	
-	/**
-	 * Tests the method IsLdifSafe with a correct String
-	 */
+    
+    /**
+     * Tests the method IsLdifSafe with a correct String
+     */
     @Test
-	public void testIsLdifSafeCorrectString()
-    {		
-		assertTrue( LdifUtils.isLDIFSafe( testString ) );
+    public void testIsLdifSafeCorrectString()
+    {        
+        assertTrue( LdifUtils.isLDIFSafe( testString ) );
     }
     
     
@@ -1065,14 +1065,14 @@
     public void testReverseMultipleModifications() throws NamingException
     {
         String initialEntryLdif = 
-        		"dn: cn=test, ou=system\n" + 
-        		"objectclass: top\n" + 
-        		"objectclass: person\n" + 
-        		"cn: test\n" + 
-        		"sn: joe doe\n" + 
-        		"l: USA\n" + 
-        		"ou: apache\n" + 
-        		"ou: acme corp\n"; 
+                "dn: cn=test, ou=system\n" + 
+                "objectclass: top\n" + 
+                "objectclass: person\n" + 
+                "cn: test\n" + 
+                "sn: joe doe\n" + 
+                "l: USA\n" + 
+                "ou: apache\n" + 
+                "ou: acme corp\n"; 
         
         LdifReader reader = new LdifReader();
         List<LdifEntry> entries = reader.parseLdif( initialEntryLdif );

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/AddRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -48,8 +48,8 @@
  */
 public class AddRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
-	
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    
     /**
      * Creates and populates a AttributeImpl with a specific id.
      * 

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ArrayNamingEnumerationTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ArrayNamingEnumerationTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ArrayNamingEnumerationTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ArrayNamingEnumerationTest.java Fri Jun  6 23:28:06 2008
@@ -36,7 +36,7 @@
  */
 public class ArrayNamingEnumerationTest extends TestCase
 {
-	/**
+    /**
      * Tests ArrayNamingEnumeration using an null array.
      */
     public void testUsingNullArray()

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -44,9 +44,9 @@
  */
 public class BindRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Tests the same object referrence for equality.
      */
     public void testEqualsSameObj()

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/CompareRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -45,9 +45,9 @@
  */
 public class CompareRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Tests the same object referrence for equality.
      */
     public void testEqualsSameObj()

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/DeleteRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -45,9 +45,9 @@
  */
 public class DeleteRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Tests the same object referrence for equality.
      */
     public void testEqualsSameObj()

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -44,9 +44,9 @@
  */
 public class ExtendedRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Tests the same object referrence for equality.
      */
     public void testEqualsSameObj()

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ExtendedResponseImplTest.java Fri Jun  6 23:28:06 2008
@@ -47,9 +47,9 @@
  */
 public class ExtendedResponseImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Creates and populates a ExtendedResponseImpl stub for testing purposes.
      * 
      * @return a populated ExtendedResponseImpl stub

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyDnRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -46,9 +46,9 @@
  */
 public class ModifyDnRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Constructs a ModifyDnrequest to test.
      * 
      * @return the request

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/ModifyRequestImplTest.java Fri Jun  6 23:28:06 2008
@@ -51,9 +51,9 @@
  */
 public class ModifyRequestImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Builds a ModifyRequest for testing purposes.
      * 
      * @return the ModifyRequest to use for tests

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseDoneImplTest.java Fri Jun  6 23:28:06 2008
@@ -47,9 +47,9 @@
  */
 public class SearchResponseDoneImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Creates and populates a SearchResponseDoneImpl stub for testing purposes.
      * 
      * @return a populated SearchResponseDoneImpl stub

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseEntryImplTest.java Fri Jun  6 23:28:06 2008
@@ -46,9 +46,9 @@
  */
 public class SearchResponseEntryImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Creates and populates a AttributeImpl with a specific id.
      * 
      * @param id

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseReferenceImplTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseReferenceImplTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseReferenceImplTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/message/SearchResponseReferenceImplTest.java Fri Jun  6 23:28:06 2008
@@ -43,9 +43,9 @@
  */
 public class SearchResponseReferenceImplTest extends TestCase
 {
-	private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
+    private static final Map<String, Control> EMPTY_CONTROL_MAP = new HashMap<String, Control>();
 
-	/**
+    /**
      * Creates a baseline referral to test with and adds it to the supplied
      * response object.
      * 

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java Fri Jun  6 23:28:06 2008
@@ -29,18 +29,19 @@
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
 
-import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.util.StringTools;
-import org.junit.Test;
+
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import org.junit.Test;
 
 
 /**
  * Test the class AttributeTypeAndValue
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class AttributeTypeAndValueTest
 {

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/DnParserDIRSERVER_584_Test.java Fri Jun  6 23:28:06 2008
@@ -31,7 +31,7 @@
  * Testcase devised specifically for DIRSERVER-584.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
+ * @version $Rev$, $Date$, 
  * @see <a href="https://issues.apache.org/jira/browse/DIRSERVER-584">DIRSERVER-584</a>
  */
 public class DnParserDIRSERVER_584_Test extends TestCase

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java Fri Jun  6 23:28:06 2008
@@ -61,6 +61,7 @@
  * Test the class LdapDN
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class LdapDNTest
 {
@@ -1534,6 +1535,10 @@
            }
 
 
+           /**
+            * Compute the instance's hash code
+            * @return the instance's hash code 
+            */
            public int hashCode()
            {
                return super.hashCode();

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDnParserTest.java Fri Jun  6 23:28:06 2008
@@ -27,8 +27,6 @@
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.name.LdapDnParser;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -36,6 +34,7 @@
  * Test the class LdapDN
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$, 
  */
 public class LdapDnParserTest extends TestCase
 {

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/SchemaUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/SchemaUtilsTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/SchemaUtilsTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/SchemaUtilsTest.java Fri Jun  6 23:28:06 2008
@@ -182,7 +182,7 @@
     static class SyntaxImpl extends AbstractSyntax
     {
         @SuppressWarnings ( { "AnalyzingVariableNaming" } )
-        public static final long serialVersionUID = 1L;
+        private static final long serialVersionUID = 1L;
         
         protected SyntaxImpl(String oid)
         {

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java Fri Jun  6 23:28:06 2008
@@ -65,9 +65,9 @@
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )";
 
         parser.parse( attributeTypeData );
-        List attributeTypeList = parser.getAttributeTypes();
-        Map attributeTypes = mapAttributeTypes( attributeTypeList );
-        AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.14" );
+        List<AttributeTypeLiteral> attributeTypeList = parser.getAttributeTypes();
+        Map<String, AttributeTypeLiteral> attributeTypes = mapAttributeTypes( attributeTypeList );
+        AttributeTypeLiteral type = attributeTypes.get( "2.5.4.14" );
 
         assertNotNull( type );
         assertEquals( "2.5.4.14", type.getOid() );
@@ -77,13 +77,12 @@
     }
 
 
-    private Map mapAttributeTypes( List attributeTypeList )
+    private Map<String, AttributeTypeLiteral> mapAttributeTypes( List<AttributeTypeLiteral> attributeTypeList )
     {
-        Map m = new HashMap();
+        Map<String, AttributeTypeLiteral> m = new HashMap<String, AttributeTypeLiteral>();
         
-        for ( int ii = 0 ; ii < attributeTypeList.size(); ii++ )
+        for ( AttributeTypeLiteral type : attributeTypeList )
         {
-            AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypeList.get( ii );
             m.put( type.getOid(), type );
         }
         
@@ -97,9 +96,9 @@
             + "        DESC 'RFC2256: knowledge information'\n" + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        List attributeTypeList = parser.getAttributeTypes();
-        Map attributeTypes = mapAttributeTypes( attributeTypeList );
-        AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.2" );
+        List<AttributeTypeLiteral> attributeTypeList = parser.getAttributeTypes();
+        Map<String, AttributeTypeLiteral> attributeTypes = mapAttributeTypes( attributeTypeList );
+        AttributeTypeLiteral type = attributeTypes.get( "2.5.4.2" );
 
         assertNotNull( type );
         assertEquals( "2.5.4.2", type.getOid() );
@@ -116,14 +115,14 @@
             + "        DESC 'RFC2256: \"knowledge\" information'\n" + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        List attributeTypeList = parser.getAttributeTypes();
-        Map attributeTypes = mapAttributeTypes( attributeTypeList );
-        AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.2" );
+        List<AttributeTypeLiteral> attributeTypeList = parser.getAttributeTypes();
+        Map<String, AttributeTypeLiteral> attributeTypes = mapAttributeTypes( attributeTypeList );
+        AttributeTypeLiteral type = attributeTypes.get( "2.5.4.2" );
 
         assertNotNull( type );
         assertEquals( "2.5.4.2", type.getOid() );
         assertEquals( "knowledgeInformation", type.getNames()[0] );
-        assertEquals( "RFC2256: \\\"knowledge\\\" information", type.getDescription() );
+        assertEquals( "RFC2256: \"knowledge\" information", type.getDescription() );
         assertEquals( "1.3.6.1.4.1.1466.115.121.1.15", type.getSyntax() );
         assertEquals( 32768, type.getLength() );
     }
@@ -136,9 +135,9 @@
             + "        DESC 'RFC2256: knowledge information'\n" + "        EQUALITY caseIgnoreMatch\n"
             + "        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )";
         parser.parse( attributeTypeData );
-        List attributeTypeList = parser.getAttributeTypes();
-        Map attributeTypes = mapAttributeTypes( attributeTypeList );
-        AttributeTypeLiteral type = ( AttributeTypeLiteral ) attributeTypes.get( "2.5.4.2" );
+        List<AttributeTypeLiteral> attributeTypeList = parser.getAttributeTypes();
+        Map<String, AttributeTypeLiteral> attributeTypes = mapAttributeTypes( attributeTypeList );
+        AttributeTypeLiteral type = attributeTypes.get( "2.5.4.2" );
 
         assertNotNull( type );
         assertEquals( "2.5.4.2", type.getOid() );
@@ -149,14 +148,13 @@
     }
 
 
-    private Map mapObjectClasses( List attributeTypeList )
+    private Map<String, ObjectClassLiteral> mapObjectClasses( List<ObjectClassLiteral> objectClassList )
     {
-        Map m = new HashMap();
+        Map<String, ObjectClassLiteral> m = new HashMap<String, ObjectClassLiteral>();
         
-        for ( int ii = 0 ; ii < attributeTypeList.size(); ii++ )
+        for ( ObjectClassLiteral objectClassLiteral : objectClassList )
         {
-            ObjectClassLiteral type = ( ObjectClassLiteral ) attributeTypeList.get( ii );
-            m.put( type.getOid(), type );
+            m.put( objectClassLiteral.getOid(), objectClassLiteral );
         }
         
         return m;
@@ -169,9 +167,9 @@
             + "        SUP top STRUCTURAL\n" + "        MUST ( sn $ cn )\n"
             + "        MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )";
         parser.parse( objectClassData );
-        List objectClassesList = parser.getObjectClassTypes();
-        Map objectClasses = mapObjectClasses( objectClassesList );
-        ObjectClassLiteral objectClass = ( ObjectClassLiteral ) objectClasses.get( "2.5.6.6" );
+        List<ObjectClassLiteral> objectClassesList = parser.getObjectClassTypes();
+        Map<String, ObjectClassLiteral> objectClasses = mapObjectClasses( objectClassesList );
+        ObjectClassLiteral objectClass = objectClasses.get( "2.5.6.6" );
 
         assertNotNull( objectClass );
         assertEquals( "2.5.6.6", objectClass.getOid() );
@@ -199,9 +197,9 @@
             + "\t\tpagerTelephoneNumber $ organizationalStatus $\n"
             + "\t\tmailPreferenceOption $ personalSignature )\n" + "\t)";
         parser.parse( objectClassData );
-        List objectClassesList = parser.getObjectClassTypes();
-        Map objectClasses = mapObjectClasses( objectClassesList );
-        ObjectClassLiteral objectClass = ( ObjectClassLiteral ) objectClasses.get( "0.9.2342.19200300.100.4.4" );
+        List<ObjectClassLiteral> objectClassesList = parser.getObjectClassTypes();
+        Map<String, ObjectClassLiteral> objectClasses = mapObjectClasses( objectClassesList );
+        ObjectClassLiteral objectClass = objectClasses.get( "0.9.2342.19200300.100.4.4" );
 
         assertNotNull( objectClass );
         assertEquals( "0.9.2342.19200300.100.4.4", objectClass.getOid() );
@@ -229,6 +227,6 @@
         assertEquals( "organizationalStatus", objectClass.getMay()[16] );
         assertEquals( "mailPreferenceOption", objectClass.getMay()[17] );
         assertEquals( "personalSignature", objectClass.getMay()[18] );
-
     }
+
 }

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxCheckerTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxCheckerTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxCheckerTest.java Fri Jun  6 23:28:06 2008
@@ -45,6 +45,8 @@
         assertTrue( checker.isValidSyntax( "( 2.5.4.3 NAME ( 'cn' 'commonName' ) DESC 'RFC2256: common name(s) for which the entity is known by'  SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch  )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.4.3 NAME ( 'cn' 'commonName' ) DESC 'RFC2256: common name(s) for which the entity is known by'  SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.4.3 NAME ( 'cn' 'commonName' ) DESC 'RFC2256: common name(s) for which the entity is known by'  SUP name EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 USAGE userApplications )" ) );
+        assertTrue( checker.isValidSyntax( "( 2.5.4.3 NAME cn SUP name )" ) );
+        assertTrue( checker.isValidSyntax( "( 2.5.4.3 name ( 'cn' 'commonName' )  sup name )" ) );
 
         // spaces
         assertTrue( checker.isValidSyntax( "(2.5.4.3 SUP name)" ) );
@@ -82,12 +84,6 @@
         // missing right parenthesis
         assertFalse( checker.isValidSyntax( "( 2.5.4.3 NAME 'cn' SUP name" ) );
 
-        // missing quotes
-        assertFalse( checker.isValidSyntax( "( 2.5.4.3 NAME cn SUP name )" ) );
-
-        // lowercase NAME, SUP
-        assertFalse( checker.isValidSyntax( "( 2.5.4.3 name ( 'cn' 'commonName' )  sup name " ) );
-
         // SYNTAX or SUP must be contained
         assertFalse( checker.isValidSyntax( "( 2.5.4.3 NAME ( 'cn' 'commonName' ) DESC 'RFC2256: common name(s) for which the entity is known by' )" ) );
         

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITContentRuleDescriptionSyntaxCheckerTest.java Fri Jun  6 23:28:06 2008
@@ -35,30 +35,42 @@
 {
     private DITContentRuleDescriptionSyntaxChecker checker = new DITContentRuleDescriptionSyntaxChecker();
 
+
     public void testValid()
     {
         assertTrue( checker.isValidSyntax( "( 2.5.6.4 )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY ( l $ st )  )" ) );
-        assertTrue( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY ( l $ st ) NOT ( 1.2.3.4.5.6.7.8.9.0 $ ou ) )" ) );
-        
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY ( l $ st )  )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 NAME 'organization' DESC 'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o ) MAY ( l $ st ) NOT ( 1.2.3.4.5.6.7.8.9.0 $ ou ) )" ) );
 
         assertTrue( checker.isValidSyntax( "(2.5.6.4)" ) );
-        assertTrue( checker.isValidSyntax( "(   2.5.6.4     NAME   'organization'   DESC   'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o )     MAY    (    l   $   st   ) NOT (1.2.3.4.5.6.7.8.9.0 $ ou))" ) );
+        assertTrue( checker.isValidSyntax( "(2.5.6.4 NAME organization)" ) );
+        assertTrue( checker
+            .isValidSyntax( "(   2.5.6.4     NAME   'organization'   DESC   'content rule for organization' OBSOLETE AUX ( pilotOrganization $  2.5.6.5 ) MUST ( objectClass $ o )     MAY    (    l   $   st   ) NOT (1.2.3.4.5.6.7.8.9.0 $ ou))" ) );
+
+        // lowercase NAME, DESC, AUX
+        assertTrue( checker
+            .isValidSyntax( "( 2.5.6.4 name 'organization' desc 'content rule for organization' aux ( pilotOrganization $  2.5.6.5 ) )" ) );
     }
 
+
     public void testInvalid()
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid OID
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -71,13 +83,6 @@
 
         // missing right parenthesis
         assertFalse( checker.isValidSyntax( "( 2.5.6.4 NAME 'organization'" ) );
-
-        // missing quotes
-        assertFalse( checker.isValidSyntax( "( 2.5.6.4 NAME organization )" ) );
-
-        // lowercase NAME, DESC, AUX
-        assertFalse( checker.isValidSyntax( "( 2.5.6.4 name 'organization' desc 'content rule for organization' aux ( pilotOrganization $  2.5.6.5 ) )" ) );
-
     }
 
 }

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/DITStructureRuleDescriptionSyntaxCheckerTest.java Fri Jun  6 23:28:06 2008
@@ -35,28 +35,41 @@
 {
     private DITStructureRuleDescriptionSyntaxChecker checker = new DITStructureRuleDescriptionSyntaxChecker();
 
+
     public void testValid()
     {
         assertTrue( checker.isValidSyntax( "( 2 FORM 2.5.15.3 )" ) );
         assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' FORM 2.5.15.3 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' FORM 2.5.15.3 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 SUP 1 )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 SUP ( 1 ) )" ) );
-        assertTrue( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 SUP ( 1 1234567890 5 ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' FORM 2.5.15.3 )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 SUP 1 )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 SUP ( 1 ) )" ) );
+        assertTrue( checker
+            .isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' OBSOLETE FORM 2.5.15.3 SUP ( 1 1234567890 5 ) )" ) );
 
         assertTrue( checker.isValidSyntax( "(2 FORM 2.5.15.3)" ) );
-        assertTrue( checker.isValidSyntax( "(   2   NAME    'organization'    DESC    'organization structure rule'    OBSOLETE   FORM   2.5.15.3    SUP   (1 1234567890        5   ))" ) );
+        assertTrue( checker.isValidSyntax( "(2 NAME organization FORM 2.5.15.3)" ) );
+        assertTrue( checker
+            .isValidSyntax( "(   2   NAME    'organization'    DESC    'organization structure rule'    OBSOLETE   FORM   2.5.15.3    SUP   (1 1234567890        5   ))" ) );
+
+        // lowercase NAME, DESC, FORM
+        assertTrue( checker
+            .isValidSyntax( "( 2 name 'organization' desc 'organization structure rule' form 2.5.15.3 )" ) );
     }
 
+
     public void testInvalid()
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid ruleid
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -69,12 +82,6 @@
         // missing right parenthesis
         assertFalse( checker.isValidSyntax( "( 2 FORM 2.5.15.3" ) );
 
-        // missing quotes
-        assertFalse( checker.isValidSyntax( "( 2 NAME organization FORM 2.5.15.3 )" ) );
-
-        // lowercase NAME, DESC, FORM
-        assertFalse( checker.isValidSyntax( "( 2 name 'organization' desc 'organization structure rule' form 2.5.15.3 )" ) );
-
         // missing FORM
         assertFalse( checker.isValidSyntax( "( 2 NAME 'organization' DESC 'organization structure rule' )" ) );
     }

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java Fri Jun  6 23:28:06 2008
@@ -40,12 +40,16 @@
     {
         assertTrue( checker.isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 )" ) ) );
         assertTrue( checker.isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-DEF 'test' )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-DEF 'test' )" ) ) );
 
         // spaces
         assertTrue( checker.isValidSyntax( "(1.3.6.1.4.1.1466.115.121.1.15)" ) );
-        assertTrue( checker.isValidSyntax( "(      1.3.6.1.4.1.1466.115.121.1.15        DESC 'Directory String' X-ABC-DEF     'test'     )" ) );
-        
+        assertTrue( checker
+            .isValidSyntax( "(      1.3.6.1.4.1.1466.115.121.1.15        DESC 'Directory String' X-ABC-DEF     'test'     )" ) );
+
+        // lowercase DESC
+        assertTrue( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 desc 'Directory String' )" ) );
     }
 
 
@@ -53,10 +57,10 @@
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid OID
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -73,13 +77,11 @@
         // missing quotes
         assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC Directory String )" ) );
 
-        // lowercase DESC
-        assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 desc 'Directory String' )" ) );
-
         // invalid extension
         assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-DEF )" ) );
-        assertFalse( checker.isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-123 'test' )" ) );
-        
+        assertFalse( checker
+            .isValidSyntax( "( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' X-ABC-123 'test' )" ) );
+
     }
 
 }

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxCheckerTest.java Fri Jun  6 23:28:06 2008
@@ -40,13 +40,20 @@
     {
         assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 APPLIES userPassword )" ) ) );
         assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
-        assertTrue( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) X-ABC-DEF 'test' )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' DESC 'octetStringMatch' APPLIES ( javaSerializedData $ userPassword ) X-ABC-DEF 'test' )" ) ) );
 
         // spaces
         assertTrue( checker.isValidSyntax( ( "(2.5.13.17 APPLIES userPassword)" ) ) );
-        assertTrue( checker.isValidSyntax( ( "(   2.5.13.17   NAME   'octetStringMatch'   DESC   'octetStringMatch'   APPLIES   (javaSerializedData   $    userPassword)  X-ABC-DEF     'test'   )" ) ) );
+        assertTrue( checker
+            .isValidSyntax( ( "(   2.5.13.17   NAME   'octetStringMatch'   DESC   'octetStringMatch'   APPLIES   (javaSerializedData   $    userPassword)  X-ABC-DEF     'test'   )" ) ) );
+
+        // lowercase DESC
+        assertTrue( checker.isValidSyntax( "( 2.5.13.17 desc 'Directory String' APPLIES userPassword )" ) );
     }
 
 
@@ -54,10 +61,10 @@
     {
         // null 
         assertFalse( checker.isValidSyntax( null ) );
-        
+
         // empty 
         assertFalse( checker.isValidSyntax( "" ) );
-        
+
         // missing/invalid OID
         assertFalse( checker.isValidSyntax( "()" ) );
         assertFalse( checker.isValidSyntax( "(  )" ) );
@@ -74,13 +81,10 @@
         // missing quotes
         assertFalse( checker.isValidSyntax( "( 2.5.13.17 DESC Directory String APPLIES userPassword )" ) );
 
-        // lowercase DESC
-        assertFalse( checker.isValidSyntax( "( 2.5.13.17 desc 'Directory String' APPLIES userPassword )" ) );
-
         // invalid extension
         assertFalse( checker.isValidSyntax( "( 2.5.13.17 APPLIES userPassword X-ABC-DEF )" ) );
         assertFalse( checker.isValidSyntax( "( 2.5.13.17 APPLIES userPassword X-ABC-123 'test' )" ) );
-        
+
         // APPLIES is required
         assertFalse( checker.isValidSyntax( ( "( 2.5.13.17 NAME 'octetStringMatch' )" ) ) );
     }

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxCheckerTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxCheckerTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxCheckerTest.java Fri Jun  6 23:28:06 2008
@@ -38,6 +38,7 @@
     public void testValid()
     {
         assertTrue( checker.isValidSyntax( "( 2.5.6.6 )" ) );
+        assertTrue( checker.isValidSyntax( "( 2.5.6.6 NAME person )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.6 NAME 'person' )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' )" ) );
         assertTrue( checker.isValidSyntax( "( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top )" ) );
@@ -71,9 +72,6 @@
         // missing right parenthesis
         assertFalse( checker.isValidSyntax( "( 2.5.6.6 NAME 'person'" ) );
 
-        // missing quotes
-        assertFalse( checker.isValidSyntax( "( 2.5.6.6 NAME person )" ) );
-
         // lowercase NAME, DESC, SUP
         assertFalse( checker.isValidSyntax( "( 2.5.6.6 name 'person' desc 'RFC2256: a person' sup top " ) );
 

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/AttributeTypeDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/AttributeTypeDescriptionSchemaParserTest.java?rev=664290&r1=664289&r2=664290&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/AttributeTypeDescriptionSchemaParserTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/parser/AttributeTypeDescriptionSchemaParserTest.java Fri Jun  6 23:28:06 2008
@@ -22,9 +22,11 @@
 
 import java.text.ParseException;
 
+import junit.framework.Assert;
 import junit.framework.TestCase;
 
 import org.apache.directory.shared.ldap.schema.UsageEnum;
+import org.apache.directory.shared.ldap.schema.parser.ConsoleParserMonitor;
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
 
 
@@ -42,6 +44,7 @@
     protected void setUp() throws Exception
     {
         parser = new AttributeTypeDescriptionSchemaParser();
+        parser.setParserMonitor( new ConsoleParserMonitor() );
     }
 
 
@@ -115,34 +118,30 @@
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3.4.5.6.7.8.9.0", atd.getSuperType() );
 
-        // SUP descr
-        value = "( 1.1 SYNTAX 1.1 SUP abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 )";
+        // SUP descr, no space
+        value = "(1.1 SYNTAX1.1 SUPabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789)";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd.getSuperType() );
 
-        // no quote allowed
+        // SUP descr, newline
+        value = "\t(\t1.1\tSYNTAX\t1.1\tSUP\tabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789\t)\t";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd.getSuperType() );
+
+        // quoted SUP value
         value = "( 1.1 SYNTAX 1.1 SUP 'name' )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid SUP 'name' (quoted)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "name", atd.getSuperType() );
 
-        // no quote allowed
+        // quoted SUP value
         value = "( 1.1 SYNTAX 1.1 SUP '1.2.3.4' )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid SUP '1.2.3.4' (quoted)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3.4", atd.getSuperType() );
+
+        // quoted SUP value
+        value = "( 1.1 SYNTAX 1.1 SUP ('1.2.3.4') )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3.4", atd.getSuperType() );
 
         // invalid character
         value = "( 1.1 SYNTAX 1.1 SUP 1.2.3.4.A )";
@@ -203,22 +202,25 @@
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3.4567.8.9.0", atd.getEqualityMatchingRule() );
 
-        // EQUALITY descr
-        value = "( 1.1 SYNTAX 1.1 EQUALITY abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 )";
+        // EQUALITY descr, no space
+        value = "(1.1 SYNTAX1.1 EQUALITYabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789)";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd.getEqualityMatchingRule() );
 
-        // no quote allowed
+        // EQUALITY descr, newline
+        value = "\n(\n1.1\nSYNTAX\n1.1\nEQUALITY\nabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789\n)\n";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd.getEqualityMatchingRule() );
+
+        // quoted value
         value = "( 1.1 SYNTAX 1.1 EQUALITY 'caseExcactMatch' )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid EQUALITY 'caseExcactMatch' (quoted)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "caseExcactMatch", atd.getEqualityMatchingRule() );
+
+        // quote value in parentheses 
+        value = "( 1.1 SYNTAX 1.1 EQUALITY ('caseExcactMatch') )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "caseExcactMatch", atd.getEqualityMatchingRule() );
     }
 
 
@@ -233,32 +235,35 @@
         String value = null;
         AttributeTypeDescription atd = null;
 
-        // no EQUALITY
+        // no ORDERING
         value = "( 1.1 SYNTAX 1.1 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertNull( atd.getOrderingMatchingRule() );
 
-        // EQUALITY numericoid
+        // ORDERING numericoid
         value = "( 1.1 SYNTAX 1.1 ORDERING 1.2.3.4567.8.9.0 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3.4567.8.9.0", atd.getOrderingMatchingRule() );
 
-        // EQUALITY descr
-        value = "( 1.1 SYNTAX 1.1 ORDERING abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 )";
+        // ORDERING descr, no space
+        value = "(1.1 SYNTAX1.1 ORDERINGabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789)";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd.getOrderingMatchingRule() );
 
-        // no quote allowed
+        // ORDERING descr, newline
+        value = "\r(\r1.1\rSYNTAX\r1.1\rORDERING\rabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789\r)\r";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd.getOrderingMatchingRule() );
+
+        // quoted value
         value = "( 1.1 SYNTAX 1.1 ORDERING 'generalizedTimeOrderingMatch' )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid ORDERING 'generalizedTimeOrderingMatch' (quoted)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "generalizedTimeOrderingMatch", atd.getOrderingMatchingRule() );
+
+        // quote value in parentheses
+        value = "( 1.1 SYNTAX 1.1 ORDERING ('generalizedTimeOrderingMatch') )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "generalizedTimeOrderingMatch", atd.getOrderingMatchingRule() );
     }
 
 
@@ -273,33 +278,37 @@
         String value = null;
         AttributeTypeDescription atd = null;
 
-        // no EQUALITY
+        // no SUBSTR
         value = "( 1.1 SYNTAX 1.1 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertNull( atd.getSubstringsMatchingRule() );
 
-        // EQUALITY numericoid
+        // SUBSTR numericoid
         value = "( 1.1 SYNTAX 1.1 SUBSTR 1.2.3.4567.8.9.0 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3.4567.8.9.0", atd.getSubstringsMatchingRule() );
 
-        // EQUALITY descr
-        value = "( 1.1 SYNTAX 1.1 SUBSTR abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 )";
+        // SUBSTR descr, no space
+        value = "(1.1 SYNTAX1.1 SUBSTRabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789)";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd
+            .getSubstringsMatchingRule() );
+
+        // SUBSTR descr, newline
+        value = "\r\n(\r\n1.1\r\nSYNTAX\r\n1.1\r\nSUBSTR\r\nabcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789\r\n)\r\n";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789", atd
             .getSubstringsMatchingRule() );
 
-        // no quote allowed
+        // quoted value
         value = "( 1.1 SYNTAX 1.1 SUBSTR 'caseIgnoreSubstringsMatch' )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid SUBSTR 'caseIgnoreSubstringsMatch' (quoted)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "caseIgnoreSubstringsMatch", atd.getSubstringsMatchingRule() );
+
+        // quote value in parentheses
+        value = "( 1.1 SYNTAX 1.1 SUBSTR ('caseIgnoreSubstringsMatch') )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "caseIgnoreSubstringsMatch", atd.getSubstringsMatchingRule() );
     }
 
 
@@ -319,37 +328,61 @@
         assertNull( atd.getSyntax() );
         assertEquals( 0, atd.getSyntaxLength() );
 
+        // SYNTAX string
+        value = "( 1.1 SYNTAX IA5String )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "IA5String", atd.getSyntax() );
+        assertEquals( 0, atd.getSyntaxLength() );
+
         // SYNTAX numericoid
         value = "( 1.1 SYNTAX 1.2.3.4567.8.9.0 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3.4567.8.9.0", atd.getSyntax() );
         assertEquals( 0, atd.getSyntaxLength() );
+        
+        // quoted numericoid
+        value = "( 1.1 SYNTAX '1.2.3.4567.8.9.0' )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3.4567.8.9.0", atd.getSyntax() );
+        assertEquals( 0, atd.getSyntaxLength() );
+
+        // quoted numericoid
+        value = "( 1.1 SYNTAX ('1.2.3.4567.8.9.0') )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3.4567.8.9.0", atd.getSyntax() );
+        assertEquals( 0, atd.getSyntaxLength() );
+
+        // SYNTAX numericoid and length, no spaces
+        value = "(1.1 SYNTAX1.2.3.4567.8.9.0{1234567890})";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3.4567.8.9.0", atd.getSyntax() );
+        assertEquals( 1234567890, atd.getSyntaxLength() );
 
-        // SYNTAX numericoid and length
-        value = "( 1.1 SYNTAX 1.2.3.4567.8.9.0{1234567890} )";
+        // SYNTAX, with tabs
+        value = "\t(\t1.1\tSYNTAX\t1.2.3.4567.8.9.0\t{1234567890}\t)\t";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3.4567.8.9.0", atd.getSyntax() );
         assertEquals( 1234567890, atd.getSyntaxLength() );
 
         // SYNTAX numericoid and zero length
-        value = "( 1.1 SYNTAX 1.2.3{0} )";
+        value = "( 1.1 SYNTAX 1.2.3 {0} )";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( "1.2.3", atd.getSyntax() );
         assertEquals( 0, atd.getSyntaxLength() );
 
-        // no quote allowed
+        // quoted value
         value = "( 1.1 SYNTAX '1.2.3{32}' )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid SYNTAX '1.2.3{32}' (quoted)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3", atd.getSyntax() );
+        assertEquals( 32, atd.getSyntaxLength() );
 
-        // empty syntax
+        // quote value in parentheses
+        value = "( 1.1 SYNTAX ( '1.2.3{32}' ) )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3", atd.getSyntax() );
+        assertEquals( 32, atd.getSyntaxLength() );
+
+        // empty length
         value = "( 1.1 SYNTAX 1.2.3.4{} )";
         try
         {
@@ -363,17 +396,11 @@
 
         // leading zero in length
         value = "( 1.1 SYNTAX 1.2.3.4{01} )";
-        try
-        {
-            atd = parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, invalid SYNTAX 1.2.3.4{01} (leading zero in length)" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( "1.2.3.4", atd.getSyntax() );
+        assertEquals( 1, atd.getSyntaxLength() );
 
-        // invalid syntax
+        // invalid syntax length
         value = "( 1.1 SYNTAX 1.2.3.4{X} )";
         try
         {
@@ -437,7 +464,7 @@
         atd = parser.parseAttributeTypeDescription( value );
         assertTrue( atd.isSingleValued() );
 
-        // ivalid
+        // invalid
         value = "(1.1 SYNTAX 1.1 NAME 'test' DESC 'Descripton' SINGLE-VALU )";
         try
         {
@@ -554,17 +581,20 @@
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( UsageEnum.DIRECTORY_OPERATION, atd.getUsage() );
 
-        // AUXILIARY
-        value = "( 1.1 SYNTAX 1.1 USAGE distributedOperation )";
+        // distributedOperation, tabs
+        value = "\t(\t1.1\tSYNTAX\t1.1\tUSAGE\tdistributedOperation\t)\t";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( UsageEnum.DISTRIBUTED_OPERATION, atd.getUsage() );
 
-        // STRUCTURAL
-        value = "( 1.1 SYNTAX 1.1 USAGE dSAOperation )";
+        // dSAOperation, no space
+        value = "(1.1 SYNTAX1.1 USAGEdSAOperation)";
         atd = parser.parseAttributeTypeDescription( value );
         assertEquals( UsageEnum.DSA_OPERATION, atd.getUsage() );
 
-        // TODO: case insensitive?
+        // directoryOperation, case insensitivity
+        value = "( 1.1 SYNTAX 1.1 USAGE DiReCtOrYoPeRaTiOn )";
+        atd = parser.parseAttributeTypeDescription( value );
+        assertEquals( UsageEnum.DIRECTORY_OPERATION, atd.getUsage() );
 
         // ivalid
         value = "( 1.1 SYNTAX 1.1 USAGE abc )";
@@ -633,7 +663,7 @@
         assertEquals( "test2-2", atd.getExtensions().get( "X-TEST-b" ).get( 1 ) );
     }
 
-    
+
     /**
      * Test unique elements.
      * 
@@ -642,25 +672,18 @@
     public void testUniqueElements()
     {
         String[] testValues = new String[]
-            { 
-                "( 1.1 SYNTAX 1.1 NAME 'test1' NAME 'test2' )", 
-                "( 1.1 SYNTAX 1.1 DESC 'test1' DESC 'test2' )",
-                "( 1.1 SYNTAX 1.1 OBSOLETE OBSOLETE )", 
-                "( 1.1 SYNTAX 1.1 SUP test1 SUP test2 )",
-                "( 1.1 SYNTAX 1.1 EQUALITY test1 EQUALITY test2 )",
-                "( 1.1 SYNTAX 1.1 ORDERING test1 ORDERING test2 )",
-                "( 1.1 SYNTAX 1.1 SUBSTR test1 SUBSTR test2 )",
-                "( 1.1 SYNTAX 1.1 SYNTAX 2.2 SYNTAX 3.3 )",
-                "( 1.1 SYNTAX 1.1 SINGLE-VALUE SINGLE-VALUE )",
-                "( 1.1 SYNTAX 1.1 COLLECTIVE COLLECTIVE )", 
-                "( 1.1 SYNTAX 1.1 USAGE directoryOperation NO-USER-MODIFICATION NO-USER-MODIFICATION )", 
-                "( 1.1 SYNTAX 1.1 USAGE directoryOperation USAGE userApplications )", 
-                "( 1.1 SYNTAX 1.1 X-TEST 'test1' X-TEST 'test2' )" 
-            };
+            { "( 1.1 SYNTAX 1.1 NAME 'test1' NAME 'test2' )", "( 1.1 SYNTAX 1.1 DESC 'test1' DESC 'test2' )",
+                "( 1.1 SYNTAX 1.1 OBSOLETE OBSOLETE )", "( 1.1 SYNTAX 1.1 SUP test1 SUP test2 )",
+                "( 1.1 SYNTAX 1.1 EQUALITY test1 EQUALITY test2 )", "( 1.1 SYNTAX 1.1 ORDERING test1 ORDERING test2 )",
+                "( 1.1 SYNTAX 1.1 SUBSTR test1 SUBSTR test2 )", "( 1.1 SYNTAX 1.1 SYNTAX 2.2 SYNTAX 3.3 )",
+                "( 1.1 SYNTAX 1.1 SINGLE-VALUE SINGLE-VALUE )", "( 1.1 SYNTAX 1.1 COLLECTIVE COLLECTIVE )",
+                "( 1.1 SYNTAX 1.1 USAGE directoryOperation NO-USER-MODIFICATION NO-USER-MODIFICATION )",
+                "( 1.1 SYNTAX 1.1 USAGE directoryOperation USAGE userApplications )",
+                "( 1.1 SYNTAX 1.1 X-TEST 'test1' X-TEST 'test2' )" };
         SchemaParserTestUtils.testUnique( parser, testValues );
     }
-    
-    
+
+
     /**
      * Test required elements.
      * 
@@ -675,30 +698,33 @@
         atd = parser.parseAttributeTypeDescription( value );
         assertNotNull( atd.getSyntax() );
         assertNotNull( atd.getSuperType() );
-        
+
         value = "( 1.2.3.4.5.6.7.8.9.0 SYNTAX 1.1 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertNotNull( atd.getSyntax() );
         assertNull( atd.getSuperType() );
-        
+
         value = "( 1.2.3.4.5.6.7.8.9.0 SUP 1.1 )";
         atd = parser.parseAttributeTypeDescription( value );
         assertNull( atd.getSyntax() );
         assertNotNull( atd.getSuperType() );
 
-        value = "( 1.2.3.4.5.6.7.8.9.0 )";
-        try
-        {
-            parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, SYNTAX or SUP is required" );
-        }
-        catch ( ParseException pe )
+        if ( !parser.isQuirksMode() )
         {
-            // expected
+            value = "( 1.2.3.4.5.6.7.8.9.0 )";
+            try
+            {
+                parser.parseAttributeTypeDescription( value );
+                fail( "Exception expected, SYNTAX or SUP is required" );
+            }
+            catch ( ParseException pe )
+            {
+                // expected
+            }
         }
-
     }
-    
+
+
     /**
      * Test collective constraint:
      * COLLECTIVE requires USAGE userApplications
@@ -713,49 +739,51 @@
         value = "( 1.1 SYNTAX 1.1 COLLECTIVE )";
         atd = parser.parseAttributeTypeDescription( value );
         assertTrue( atd.isCollective() );
-        assertEquals( UsageEnum.USER_APPLICATIONS , atd.getUsage() );
-        
+        assertEquals( UsageEnum.USER_APPLICATIONS, atd.getUsage() );
+
         value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE userApplications )";
         atd = parser.parseAttributeTypeDescription( value );
         assertTrue( atd.isCollective() );
-        assertEquals( UsageEnum.USER_APPLICATIONS , atd.getUsage() );
-        
-        value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE directoryOperation )";
-        try
-        {
-            parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, COLLECTIVE requires USAGE userApplications" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
-        
-        value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE dSAOperation )";
-        try
-        {
-            parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, COLLECTIVE requires USAGE userApplications" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
-        
-        value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE distributedOperation )";
-        try
-        {
-            parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, COLLECTIVE requires USAGE userApplications" );
-        }
-        catch ( ParseException pe )
+        assertEquals( UsageEnum.USER_APPLICATIONS, atd.getUsage() );
+
+        if ( !parser.isQuirksMode() )
         {
-            // expected
+            value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE directoryOperation )";
+            try
+            {
+                parser.parseAttributeTypeDescription( value );
+                fail( "Exception expected, COLLECTIVE requires USAGE userApplications" );
+            }
+            catch ( ParseException pe )
+            {
+                // expected
+            }
+
+            value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE dSAOperation )";
+            try
+            {
+                parser.parseAttributeTypeDescription( value );
+                fail( "Exception expected, COLLECTIVE requires USAGE userApplications" );
+            }
+            catch ( ParseException pe )
+            {
+                // expected
+            }
+
+            value = "( 1.1 SYNTAX 1.1 COLLECTIVE USAGE distributedOperation )";
+            try
+            {
+                parser.parseAttributeTypeDescription( value );
+                fail( "Exception expected, COLLECTIVE requires USAGE userApplications" );
+            }
+            catch ( ParseException pe )
+            {
+                // expected
+            }
         }
-        
     }
-    
-    
+
+
     /**
      * Test no-user-modification constraint:
      * NO-USER-MODIFICATION requires an operational USAGE
@@ -766,46 +794,49 @@
     {
         String value = null;
         AttributeTypeDescription atd = null;
-        
+
         value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION USAGE directoryOperation )";
         atd = parser.parseAttributeTypeDescription( value );
         assertFalse( atd.isUserModifiable() );
-        assertEquals( UsageEnum.DIRECTORY_OPERATION , atd.getUsage() );
-        
+        assertEquals( UsageEnum.DIRECTORY_OPERATION, atd.getUsage() );
+
         value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION USAGE dSAOperation )";
         atd = parser.parseAttributeTypeDescription( value );
         assertFalse( atd.isUserModifiable() );
-        assertEquals( UsageEnum.DSA_OPERATION , atd.getUsage() );
-        
+        assertEquals( UsageEnum.DSA_OPERATION, atd.getUsage() );
+
         value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION USAGE distributedOperation )";
         atd = parser.parseAttributeTypeDescription( value );
         assertFalse( atd.isUserModifiable() );
-        assertEquals( UsageEnum.DISTRIBUTED_OPERATION , atd.getUsage() );
-        
-        value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION USAGE userApplications )";
-        try
-        {
-            parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, NO-USER-MODIFICATION requires an operational USAGE" );
-        }
-        catch ( ParseException pe )
-        {
-            // expected
-        }
-        
-        value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION )";
-        try
-        {
-            parser.parseAttributeTypeDescription( value );
-            fail( "Exception expected, NO-USER-MODIFICATION requires an operational USAGE" );
-        }
-        catch ( ParseException pe )
+        assertEquals( UsageEnum.DISTRIBUTED_OPERATION, atd.getUsage() );
+
+        if ( !parser.isQuirksMode() )
         {
-            // expected
+            value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION USAGE userApplications )";
+            try
+            {
+                parser.parseAttributeTypeDescription( value );
+                fail( "Exception expected, NO-USER-MODIFICATION requires an operational USAGE" );
+            }
+            catch ( ParseException pe )
+            {
+                // expected
+            }
+
+            value = "( 1.1 SYNTAX 1.1 NO-USER-MODIFICATION )";
+            try
+            {
+                parser.parseAttributeTypeDescription( value );
+                fail( "Exception expected, NO-USER-MODIFICATION requires an operational USAGE" );
+            }
+            catch ( ParseException pe )
+            {
+                // expected
+            }
         }
     }
-    
-    
+
+
     /**
      * Ensure that element order is ignored
      * 
@@ -861,13 +892,14 @@
         assertEquals( 0, atd.getExtensions().size() );
     }
 
+
     /**
      * Tests the parse of a simple AttributeType
      */
-    public void testAddAttributeType() throws Exception
+    public void testAddAttributeType() throws ParseException
     {
-        String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 NAME ( 'bogus' 'bogusName' ) " +
-                "DESC 'bogus description' SUP name SINGLE-VALUE )";
+        String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 NAME ( 'bogus' 'bogusName' ) "
+            + "DESC 'bogus description' SUP name SINGLE-VALUE )";
         AttributeTypeDescription desc = parser.parseAttributeTypeDescription( substrate );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", desc.getNumericOid() );
         assertEquals( "bogus", desc.getNames().get( 0 ) );
@@ -877,14 +909,14 @@
         assertEquals( true, desc.isSingleValued() );
     }
 
-    
+
     /**
      * Tests the parse of a simple AttributeType with the schema extension.
      */
-    public void testAttributeTypeWithSchemaExtension() throws Exception
+    public void testAttributeTypeWithSchemaExtension() throws ParseException
     {
-        String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 NAME ( 'bogus' 'bogusName' ) " +
-                "DESC 'bogus description' SUP name SINGLE-VALUE X-SCHEMA 'blah' )";
+        String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 NAME ( 'bogus' 'bogusName' ) "
+            + "DESC 'bogus description' SUP name SINGLE-VALUE X-SCHEMA 'blah' )";
         AttributeTypeDescription desc = parser.parseAttributeTypeDescription( substrate );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", desc.getNumericOid() );
         assertEquals( "bogus", desc.getNames().get( 0 ) );
@@ -893,13 +925,13 @@
         assertEquals( "name", desc.getSuperType() );
         assertEquals( true, desc.isSingleValued() );
         assertEquals( "blah", desc.getExtensions().get( "X-SCHEMA" ).get( 0 ) );
-    }    
-    
+    }
+
 
     /**
      * Tests the multithreaded use of a single parser.
      */
-    public void testMultiThreaded() throws Exception
+    public void testMultiThreaded() throws ParseException
     {
         String[] testValues = new String[]
             {
@@ -910,4 +942,88 @@
         SchemaParserTestUtils.testMultiThreaded( parser, testValues );
     }
 
+
+    /**
+     * Tests quirks mode.
+     */
+    public void testQuirksMode() throws ParseException
+    {
+        SchemaParserTestUtils.testQuirksMode( parser, "SYNTAX 1.1" );
+
+        try
+        {
+            String value = null;
+            AttributeTypeDescription atd = null;
+
+            parser.setQuirksMode( true );
+
+            // ensure all other test pass in quirks mode
+            testNumericOid();
+            testNames();
+            testDescription();
+            testObsolete();
+            testSuperType();
+            testEquality();
+            testOrdering();
+            testSubstring();
+            testSyntax();
+            testSingleValue();
+            testCollective();
+            testNoUserModification();
+            testUsage();
+            testExtensions();
+            testFull();
+            testUniqueElements();
+            testRequiredElements();
+            testCollecitveConstraint();
+            testNoUserModificatonConstraint();
+            testIgnoreElementOrder();
+            testRfcUid();
+            testAddAttributeType();
+            testMultiThreaded();
+
+            // NAME with special chars
+            value = "( 1.2.3 SYNTAX te_st NAME 't-e_s.t;' )";
+            atd = parser.parseAttributeTypeDescription( value );
+            Assert.assertEquals( 1, atd.getNames().size() );
+            Assert.assertEquals( "t-e_s.t;", atd.getNames().get( 0 ) );
+
+            // SYNTAX with underscore
+            value = "( 1.1 SYNTAX te_st )";
+            atd = parser.parseAttributeTypeDescription( value );
+            assertEquals( "te_st", atd.getSyntax() );
+
+            // SUPERTYPE with underscore
+            value = "( 1.1 SYNTAX 1.1 SUP te_st )";
+            atd = parser.parseAttributeTypeDescription( value );
+            assertEquals( "te_st", atd.getSuperType() );
+
+            // EQUALITY with underscore
+            value = "( 1.1 SYNTAX 1.1 EQUALITY te_st )";
+            atd = parser.parseAttributeTypeDescription( value );
+            assertEquals( "te_st", atd.getEqualityMatchingRule() );
+
+            // SUBSTR with underscore
+            value = "( 1.1 SYNTAX 1.1 SUBSTR te_st )";
+            atd = parser.parseAttributeTypeDescription( value );
+            assertEquals( "te_st", atd.getSubstringsMatchingRule() );
+
+            // ORDERING with underscore
+            value = "( 1.1 SYNTAX 1.1 ORDERING te_st )";
+            atd = parser.parseAttributeTypeDescription( value );
+            assertEquals( "te_st", atd.getOrderingMatchingRule() );
+
+            // Netscape attribute 
+            value = "( nsAdminGroupName-oid NAME 'nsAdminGroupName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )";
+            atd = parser.parseAttributeTypeDescription( value );
+            assertEquals( "nsAdminGroupName-oid", atd.getNumericOid() );
+            assertEquals( 1, atd.getNames().size() );
+            assertEquals( "nsAdminGroupName", atd.getNames().get( 0 ) );
+        }
+        finally
+        {
+            parser.setQuirksMode( false );
+        }
+    }
+
 }



Mime
View raw message