directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r161412 - directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/utils/DNUtilsTest.java
Date Fri, 15 Apr 2005 06:00:28 GMT
Author: elecharny
Date: Thu Apr 14 23:00:25 2005
New Revision: 161412

URL: http://svn.apache.org/viewcvs?view=rev&rev=161412
Log:
As DN are stored in a MutableString, the test have been changed

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/utils/DNUtilsTest.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/utils/DNUtilsTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/utils/DNUtilsTest.java?view=diff&r1=161411&r2=161412
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/utils/DNUtilsTest.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/utils/DNUtilsTest.java
Thu Apr 14 23:00:25 2005
@@ -45,7 +45,7 @@
     public void testAreEqualsFull()
     {
         // Full compare
-        Assert.assertEquals( 6, DNUtils.areEquals( getChars("azerty"), 0, "azerty" ) );
+        Assert.assertEquals( 6, DNUtils.areEquals( "azerty".getBytes(), 0, "azerty" ) );
     }
 
     /**
@@ -54,7 +54,7 @@
     public void testAreEqualsDiff()
     {
         // First character is !=
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "Azerty" ) );
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "Azerty" ) );
     }
 
     /**
@@ -63,7 +63,7 @@
     public void testAreEqualsEmpty()
     {
         // Compare to an empty string
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "" ) );
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "" ) );
     }
 
     /**
@@ -72,7 +72,7 @@
     public void testAreEqualsFirstCharDiff()
     {
         // First character is !=
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "Azerty" ) );
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "Azerty" ) );
     }
     
     /**
@@ -81,7 +81,7 @@
     public void testAreEqualsMiddleCharDiff()
     {
         // First character is !=
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "azeRty" ) );
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "azeRty" ) );
     }
     
     /**
@@ -90,7 +90,7 @@
     public void testAreEqualsLastCharDiff()
     {
         // First character is !=
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "azertY" ) );
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "azertY" ) );
     }
     
     /**
@@ -99,12 +99,12 @@
     public void testAreEqualsCharByChar()
     {
         // Index must be incremented after each comparison
-        Assert.assertEquals( 1, DNUtils.areEquals( getChars("azerty"), 0, "a" ) );
-        Assert.assertEquals( 2, DNUtils.areEquals( getChars("azerty"), 1, "z" ) );
-        Assert.assertEquals( 3, DNUtils.areEquals( getChars("azerty"), 2, "e" ) );
-        Assert.assertEquals( 4, DNUtils.areEquals( getChars("azerty"), 3, "r" ) );
-        Assert.assertEquals( 5, DNUtils.areEquals( getChars("azerty"), 4, "t" ) );
-        Assert.assertEquals( 6, DNUtils.areEquals( getChars("azerty"), 5, "y" ) );
+        Assert.assertEquals( 1, DNUtils.areEquals( "azerty".getBytes(), 0, "a" ) );
+        Assert.assertEquals( 2, DNUtils.areEquals( "azerty".getBytes(), 1, "z" ) );
+        Assert.assertEquals( 3, DNUtils.areEquals( "azerty".getBytes(), 2, "e" ) );
+        Assert.assertEquals( 4, DNUtils.areEquals( "azerty".getBytes(), 3, "r" ) );
+        Assert.assertEquals( 5, DNUtils.areEquals( "azerty".getBytes(), 4, "t" ) );
+        Assert.assertEquals( 6, DNUtils.areEquals( "azerty".getBytes(), 5, "y" ) );
     }
 
     /**
@@ -113,7 +113,7 @@
     public void testAreEqualsTooShort()
     {
         // length too short
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "azertyiop" )
);
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "azertyiop" )
);
     }
 
     /**
@@ -122,7 +122,7 @@
     public void testAreEqualsTooShortMiddle()
     {
         // length too short
-        Assert.assertEquals( -1, DNUtils.areEquals( getChars("azerty"), 0, "ertyiop" ) );
+        Assert.assertEquals( -1, DNUtils.areEquals( "azerty".getBytes(), 0, "ertyiop" ) );
     }
 
     /**
@@ -131,7 +131,7 @@
     public void testAreEqualsLastChar()
     {
         // last character
-        Assert.assertEquals( 6, DNUtils.areEquals( getChars("azerty"), 5, "y" ) );
+        Assert.assertEquals( 6, DNUtils.areEquals( "azerty".getBytes(), 5, "y" ) );
     }
 
     /**
@@ -140,6 +140,6 @@
     public void testAreEqualsMiddle()
     {
         // In the middle
-        Assert.assertEquals( 4, DNUtils.areEquals( getChars("azerty"), 2, "er" ) );
+        Assert.assertEquals( 4, DNUtils.areEquals( "azerty".getBytes(), 2, "er" ) );
     }
 }



Mime
View raw message