directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r544542 - /directory/shared/trunk/asn1/src/test/java/org/apache/directory/shared/asn1/primitives/OIDTest.java
Date Tue, 05 Jun 2007 16:22:24 GMT
Author: elecharny
Date: Tue Jun  5 09:22:23 2007
New Revision: 544542

URL: http://svn.apache.org/viewvc?view=rev&rev=544542
Log:
Added some tests for OID comparisons

Modified:
    directory/shared/trunk/asn1/src/test/java/org/apache/directory/shared/asn1/primitives/OIDTest.java

Modified: directory/shared/trunk/asn1/src/test/java/org/apache/directory/shared/asn1/primitives/OIDTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/test/java/org/apache/directory/shared/asn1/primitives/OIDTest.java?view=diff&rev=544542&r1=544541&r2=544542
==============================================================================
--- directory/shared/trunk/asn1/src/test/java/org/apache/directory/shared/asn1/primitives/OIDTest.java
(original)
+++ directory/shared/trunk/asn1/src/test/java/org/apache/directory/shared/asn1/primitives/OIDTest.java
Tue Jun  5 09:22:23 2007
@@ -354,4 +354,36 @@
             Assert.fail();
         }
     }
+
+    /**
+     * Test OID Equals
+     */
+    public void testOidEquals() throws DecoderException
+    {
+        OID oid1 = new OID();
+        OID oid2 = new OID();
+        OID oid3 = new OID( "1.1" );
+
+        assertTrue( oid1.equals( oid2 ) );
+        assertFalse( oid1.equals( oid3 ) );
+        assertFalse( oid2.equals( oid3 ) );
+    }
+
+    /**
+     * Test OID Equals
+     */
+    public void testOidEqualsPerf() throws DecoderException
+    {
+    	String s1 = "1.2.840.113554.1.2.2.1.2.840.113554.1.2.2.1.2.840.113554.1.2.2";
+    	String s2 = "1.2.840.113554.1.2.2.1.2.840.113554.1.2.2.1.2.840.113554.1.2.2";
+    	String s3 = "1.3.6.1.5.5.2";
+    	
+        OID oid1 = new OID( s1 );
+        OID oid2 = new OID( s2 );
+        OID oid3 = new OID( s3 );
+        
+        assertTrue( oid1.equals( oid2 ) );
+        assertFalse( oid1.equals( oid3 ) );
+        assertFalse( oid2.equals( oid3 ) );
+    }
 }



Mime
View raw message