directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r359020 - /directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DnParserTest.java
Date Mon, 26 Dec 2005 00:28:44 GMT
Author: elecharny
Date: Sun Dec 25 16:28:39 2005
New Revision: 359020

URL: http://svn.apache.org/viewcvs?rev=359020&view=rev
Log:
Renamed to DnParserTest

Added:
    directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DnParserTest.java
      - copied, changed from r359016, directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DNParserTest.java

Copied: directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DnParserTest.java
(from r359016, directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DNParserTest.java)
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DnParserTest.java?p2=directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DnParserTest.java&p1=directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DNParserTest.java&r1=359016&r2=359020&rev=359020&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DNParserTest.java
(original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/test/org/apache/ldap/common/name/DnParserTest.java
Sun Dec 25 16:28:39 2005
@@ -24,7 +24,7 @@
 import junit.framework.TestCase;
 
 import org.apache.asn1.codec.util.StringUtils;
-import org.apache.ldap.common.name.DNParser;
+import org.apache.ldap.common.name.DnParser;
 import org.apache.ldap.common.name.LdapDN;
 
 /**
@@ -32,7 +32,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DNParserTest extends TestCase
+public class DnParserTest extends TestCase
 {
     //~ Methods ------------------------------------------------------------------------------------
 
@@ -50,7 +50,7 @@
      */
     public void testLdapDNEmpty() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
     	
         Assert.assertEquals( "", (( LdapDN )dnParser.parse( "" )).getName() );
     }
@@ -60,7 +60,7 @@
      */
     public void testLdapDNSimple() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
 
     	Assert.assertEquals( "a = b", (( LdapDN )dnParser.parse( "a = b" )).getName() );
         Assert.assertEquals( "a=b", (( LdapDN )dnParser.parse( "a = b" )).getString() );
@@ -71,7 +71,7 @@
      */
     public void testLdapDNComposite() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a = b, c = d" );
         Assert.assertEquals( "a=b,c=d", dn.toString() );
         Assert.assertEquals( "a = b, c = d", dn.getName() );
@@ -82,7 +82,7 @@
      */
     public void testLdapDNCompositeWithSpace() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a=b, a =b, a= b, a = b, a  =  b" );
         Assert.assertEquals( "a=b,a=b,a=b,a=b,a=b", dn.toString() );
         Assert.assertEquals( "a=b, a =b, a= b, a = b, a  =  b", dn.getName() );
@@ -94,7 +94,7 @@
      */
     public void testLdapDNCompositeSepators() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
     	LdapDN dn = ( LdapDN )dnParser.parse( "a=b;c=d,e=f" );
         Assert.assertEquals( "a=b,c=d,e=f", dn.toString() );
         Assert.assertEquals( "a=b;c=d,e=f", dn.getName() );
@@ -105,7 +105,7 @@
      */
     public void testLdapDNSimpleMultivaluedAttribute() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a = b + c = d" );
         Assert.assertEquals( "a=b+c=d", dn.toString() );
         Assert.assertEquals( "a = b + c = d", dn.getName() );
@@ -116,7 +116,7 @@
      */
     public void testLdapDNCompositeMultivaluedAttribute() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a=b+c=d, e=f + g=h + i=j" );
         Assert.assertEquals( "a=b+c=d,e=f+g=h+i=j", dn.toString() );
         Assert.assertEquals( "a=b+c=d, e=f + g=h + i=j", dn.getName() );
@@ -127,7 +127,7 @@
      */
     public void testLdapDNOidUpper() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "OID.12.34.56 = azerty" );
         Assert.assertEquals( "oid.12.34.56=azerty", dn.toString() );
         Assert.assertEquals( "OID.12.34.56 = azerty", dn.getName() );
@@ -138,7 +138,7 @@
      */
     public void testLdapDNOidLower() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "oid.12.34.56 = azerty" );
         Assert.assertEquals( "oid.12.34.56=azerty", dn.toString() );
         Assert.assertEquals( "oid.12.34.56 = azerty", dn.getName() );
@@ -149,7 +149,7 @@
      */
     public void testLdapDNOidWithoutPrefix() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "12.34.56 = azerty" );
         Assert.assertEquals( "12.34.56=azerty", dn.toString() );
         Assert.assertEquals( "12.34.56 = azerty", dn.getName() );
@@ -160,7 +160,7 @@
      */
     public void testLdapDNCompositeOidWithoutPrefix() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "12.34.56 = azerty; 7.8 = test" );
         Assert.assertEquals( "12.34.56=azerty,7.8=test", dn.toString() );
         Assert.assertEquals( "12.34.56 = azerty; 7.8 = test", dn.getName() );
@@ -171,7 +171,7 @@
      */
     public void testLdapDNPairCharAttributeValue() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00"
);
         Assert.assertEquals( "a=\\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.toString()
);
         Assert.assertEquals( "a = \\,\\=\\+\\<\\>\\#\\;\\\\\\\"\\A0\\00", dn.getName()
);
@@ -182,7 +182,7 @@
      */
     public void testLdapDNHexStringAttributeValue() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a = #0010A0AAFF" );
         Assert.assertEquals( "a=#0010A0AAFF", dn.toString() );
         Assert.assertEquals( "a = #0010A0AAFF", dn.getName() );
@@ -193,7 +193,7 @@
      */
     public void testLdapDNQuotedAttributeValue() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "a = quoted \\\"value" );
         Assert.assertEquals( "a=quoted \\\"value", dn.toString() );
         Assert.assertEquals( "a = quoted \\\"value", dn.getName() );
@@ -205,7 +205,7 @@
      */
     public void testNameToBytes() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN dn = ( LdapDN )dnParser.parse( "cn = John, ou = People, OU = Marketing" );
         
         byte[] bytes = dn.getBytes();
@@ -216,7 +216,7 @@
     
     public void testStringParser() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN name = ( LdapDN )dnParser.parse( "CN = Emmanuel  Lécharny" );
         
         Assert.assertEquals( "CN = Emmanuel  Lécharny", name.getName() );
@@ -225,7 +225,7 @@
 
     public void testVsldapExtras() throws NamingException
     {
-    	NameParser dnParser = DNParser.getNameParser();
+    	NameParser dnParser = DnParser.getNameParser();
         LdapDN name = ( LdapDN )dnParser.parse( "cn=Billy Bakers, OID.2.5.4.11=Corporate
Tax, ou=Fin-Accounting, ou=Americas, ou=Search, o=IMC, c=US" );
         
         Assert.assertEquals( "cn=Billy Bakers, OID.2.5.4.11=Corporate Tax, ou=Fin-Accounting,
ou=Americas, ou=Search, o=IMC, c=US", name.getName() );
@@ -241,7 +241,7 @@
      */
     public final void testDnParser() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         assertNotNull( parser );
     }
@@ -254,7 +254,7 @@
      */
     public final void testParseStringEmpty() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameEmpty = parser.parse( "" );
 
@@ -269,7 +269,7 @@
      */
     public final void testParseStringNull() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameNull = parser.parse( null );
 
@@ -284,7 +284,7 @@
      */
     public final void testParseStringRFC1779_1() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC1779_1 = parser.parse( "CN=Marshall T. Rose, O=Dover Beach Consulting,
L=Santa Clara, ST=California, C=US" );
 
@@ -299,7 +299,7 @@
      */
     public final void testParseStringRFC2253_1() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC2253_1 = parser.parse( "CN=Steve Kille,O=Isode limited,C=GB" );
 
@@ -316,7 +316,7 @@
      */
     public final void testParseStringRFC2253_2() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC2253_2 = parser.parse( "CN = Sales + CN =   J. Smith , O = Widget Inc.
, C = US" );
 
@@ -336,7 +336,7 @@
      */
     public final void testParseStringRFC2253_3() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC2253_3 = parser.parse( "CN=L. Eagle,   O=Sue\\, Grabbit and Runn, C=GB"
);
 
@@ -352,7 +352,7 @@
      */
     public final void testParseStringRFC2253_4() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC2253_4 = parser.parse( "CN=Before\\0DAfter,O=Test,C=GB" );
         assertEquals( "RFC2253_4 : ", "CN=Before\\0DAfter,O=Test,C=GB", ((LdapDN)nameRFC2253_4).toUpName()
);
@@ -366,7 +366,7 @@
      */
     public final void testParseStringRFC2253_5() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC2253_5 = parser.parse( "1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB" );
 
@@ -383,7 +383,7 @@
      */
     public final void testParseStringRFC2253_6() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         Name nameRFC2253_6 = parser.parse( "SN=Lu\\C4\\8Di\\C4\\87" );
 
@@ -400,7 +400,7 @@
      */
     public final void testParseInvalidString() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
 
         try
         {
@@ -424,7 +424,7 @@
      */
     public final void testPreserveSpaceAfterEscape() throws NamingException
     {
-    	NameParser parser = DNParser.getNameParser();
+    	NameParser parser = DnParser.getNameParser();
         String input = "ou=some test\\,  something else";
         String result = parser.parse( input ).toString();
         assertEquals( input, result );
@@ -434,7 +434,7 @@
     {
         // '\' should be escaped as stated in RFC 2253
         String path = "windowsFilePath=C:\\\\cygwin";
-        NameParser parser = DNParser.getNameParser();
+        NameParser parser = DnParser.getNameParser();
         Name result = parser.parse( path );
         assertEquals( path, ((LdapDN)result).toUpName() );
         assertEquals( "windowsfilepath=C:\\\\cygwin", result.toString() );
@@ -445,7 +445,7 @@
         String cn = new String(
                 new byte[] { 'c', 'n', '=', 0x4A, (byte) 0xC3, (byte) 0xA9, 0x72, (byte)
0xC3, (byte) 0xB4, 0x6D, 0x65 });
 
-        NameParser parser = DNParser.getNameParser();
+        NameParser parser = DnParser.getNameParser();
         String result = parser.parse( cn ).toString();
         
         assertEquals( cn, result.toString() );
@@ -458,7 +458,7 @@
                     (byte)0x9C, (byte)0xC3, (byte)0x9F, (byte)0xC3, (byte)0xA4, (byte)0xC3,
(byte)0xB6, (byte)0xC3, (byte)0xBC}, "UTF-8");
         
 
-        NameParser parser = DNParser.getNameParser();
+        NameParser parser = DnParser.getNameParser();
         String result = parser.parse( cn ).toString();
         
         assertEquals( cn, result.toString() );
@@ -472,7 +472,7 @@
                 (byte)0xC3, (byte)0x9C, (byte)0xC3, (byte)0xBC, 
                 (byte)0xC4, (byte)0x9E, (byte)0xC4, (byte)0x9F }, "UTF-8");
 
-        NameParser parser = DNParser.getNameParser();
+        NameParser parser = DnParser.getNameParser();
         String result = parser.parse( cn ).toString();
         
         assertEquals( cn, result.toString() );



Mime
View raw message