directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r151223 - incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java
Date Thu, 03 Feb 2005 20:36:46 GMT
Author: akarasulu
Date: Thu Feb  3 12:36:44 2005
New Revision: 151223

URL: http://svn.apache.org/viewcvs?view=rev&rev=151223
Log:
format and uncomment

Modified:
    incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java

Modified: incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java
URL: http://svn.apache.org/viewcvs/incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java?view=diff&r1=151222&r2=151223
==============================================================================
--- incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java
(original)
+++ incubator/directory/ldap/trunk/common/src/test/org/apache/ldap/common/name/DnParserTest.java
Thu Feb  3 12:36:44 2005
@@ -204,207 +204,213 @@
  */
 package org.apache.ldap.common.name;
 
-import junit.framework.TestCase;
-
-import org.apache.ldap.common.schema.DnNormalizer;
 
 import javax.naming.Name;
 import javax.naming.NamingException;
 
+import junit.framework.TestCase;
+import org.apache.ldap.common.schema.DnNormalizer;
+
 
 /**
  * Test case for DN Parser class
  *
- * @author  Emmanuel Lécharny
+ * @author Emmanuel Lécharny
  */
 public class DnParserTest extends TestCase
 {
+    public static final String TESTDN_1779_1 = "CN=Marshall T. Rose, O=Dover Beach Consulting,
L=Santa Clara, ST=California, C=US";
+
     //~ Methods ----------------------------------------------------------------
 
     /**
      * Class under test for void DnParser()
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testDnParser() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        assertNotNull(parser);
+        assertNotNull( parser );
     }
 
+
     /**
      * Class under test for void DnParser(NameComponentNormalizer)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testDnParserNameComponentNormalizer() throws NamingException
     {
-        SimpleNameComponentNormalizer normalizer = new SimpleNameComponentNormalizer(
-                new DnNormalizer());
+        SimpleNameComponentNormalizer normalizer = new SimpleNameComponentNormalizer( new
DnNormalizer() );
 
-        DnParser parser = new DnParser(normalizer);
+        DnParser parser = new DnParser( normalizer );
 
-        assertNotNull(parser);
+        assertNotNull( parser );
     }
 
+
     /**
      * Class under test for void isNormizing() : Control that the Normalize flag
      * is set correctly
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testIsNormizing() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        SimpleNameComponentNormalizer normalizer = new SimpleNameComponentNormalizer(
-                new DnNormalizer());
+        SimpleNameComponentNormalizer normalizer = new SimpleNameComponentNormalizer( new
DnNormalizer() );
+
+        DnParser parserNormalized = new DnParser( normalizer );
 
-        DnParser parserNormalized = new DnParser(normalizer);
+        assertEquals( parser.isNormizing(), false );
 
-        assertEquals(parser.isNormizing(), false);
-        assertEquals(parserNormalized.isNormizing(), true);
+        assertEquals( parserNormalized.isNormizing(), true );
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringEmpty() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameEmpty = parser.parse("");
+        Name nameEmpty = parser.parse( "" );
+
+        assertNotNull( nameEmpty );
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringNull() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameNull = parser.parse(null);
+        Name nameNull = parser.parse( null );
 
-        assertEquals("Null DN are legal : ", "", nameNull.toString());
+        assertEquals( "Null DN are legal : ", "", nameNull.toString() );
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC1779_1() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameRFC1779_1 = parser.parse(
-                "CN=Marshall T. Rose, O=Dover Beach Consulting, L=Santa Clara, ST=California,
C=US");
+        Name nameRFC1779_1 = parser.parse( TESTDN_1779_1 );
 
-        assertEquals("RFC1779_1 : ",
-            "CN=Marshall T. Rose,O=Dover Beach Consulting,L=Santa Clara,ST=California,C=US",
-            nameRFC1779_1.toString());
+        assertEquals( "RFC1779_1 : ", TESTDN_1779_1, nameRFC1779_1.toString() );
 
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC2253_1() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameRFC2253_1 = parser.parse("CN=Steve Kille,O=Isode limited,C=GB");
+        Name nameRFC2253_1 = parser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );
 
-        assertEquals("RFC2253_1 : ",
-            "CN=Steve Kille,O=Isode limited,C=GB",
-            nameRFC2253_1.toString());
+        assertEquals( "RFC2253_1 : ",
+                "CN=Steve Kille,O=Isode limited,C=GB",
+                nameRFC2253_1.toString() );
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC2253_2() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameRFC2253_2 = parser.parse(
-                "CN = Sales + CN =   J. Smith , O = Widget Inc. , C = US");
+        Name nameRFC2253_2 = parser.parse( "CN = Sales + CN =   J. Smith , O = Widget Inc.
, C = US" );
 
-        assertEquals("RFC2253_2 : ",
-            "CN=Sales+CN=J. Smith,O=Widget Inc.,C=US",
-            nameRFC2253_2.toString());
+        assertEquals( "RFC2253_2 : ",
+                "CN=Sales+CN=J. Smith,O=Widget Inc.,C=US",
+                nameRFC2253_2.toString() );
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC2253_3() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameRFC2253_3 = parser.parse("CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB");
+        Name nameRFC2253_3 = parser.parse( "CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB" );
 
-        assertEquals("RFC2253_3 : ",
-            "CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB",
-            nameRFC2253_3.toString());
+        assertEquals( "RFC2253_3 : ", "CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB", nameRFC2253_3.toString()
);
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC2253_4() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        // Name nameRFC2253_4 = parser.parse("CN=Before\0DAfter,O=Test,C=GB");
+        Name nameRFC2253_4 = parser.parse( "CN=Before\0DAfter,O=Test,C=GB" );
 
-        // assertEquals("RFC2253_4 : ",
-        // "CN=Before\0DAfter,O=Test,C=GB",
-        // nameRFC2253_4.toString());
+        assertEquals( "RFC2253_4 : ", "CN=Before\0DAfter,O=Test,C=GB", nameRFC2253_4.toString()
);
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC2253_5() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameRFC2253_5 = parser.parse("1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB");
+        Name nameRFC2253_5 = parser.parse( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
 
-        assertEquals("RFC2253_5 : ",
-            "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB",
-            nameRFC2253_5.toString());
+        assertEquals( "RFC2253_5 : ",
+                "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB",
+                nameRFC2253_5.toString() );
     }
 
+
     /**
      * Class under test for Name parse(String)
      *
-     * @throws  NamingException  if anything goes wrong
+     * @throws NamingException if anything goes wrong
      */
     public final void testParseStringRFC2253_6() throws NamingException
     {
         DnParser parser = new DnParser();
 
-        Name nameRFC2253_6 = parser.parse("SN=Lu\\C4\\8Di\\C4\\87");
+        Name nameRFC2253_6 = parser.parse( "SN=Lu\\C4\\8Di\\C4\\87" );
 
-        assertEquals("RFC2253_6 : ",
-            "SN=Lu\\C4\\8Di\\C4\\87",
-            nameRFC2253_6.toString());
+        assertEquals( "RFC2253_6 : ",
+                "SN=Lu\\C4\\8Di\\C4\\87",
+                nameRFC2253_6.toString() );
     }
 }  // end class DnParserTest



Mime
View raw message