directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r957256 - /directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/MatchingRuleTest.java
Date Wed, 23 Jun 2010 15:55:59 GMT
Author: elecharny
Date: Wed Jun 23 15:55:59 2010
New Revision: 957256

URL: http://svn.apache.org/viewvc?rev=957256&view=rev
Log:
applied commit http://svn.apache.org/viewvc?rev=956333&view=rev

Modified:
    directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/MatchingRuleTest.java

Modified: directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/MatchingRuleTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/MatchingRuleTest.java?rev=957256&r1=957255&r2=957256&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/MatchingRuleTest.java
(original)
+++ directory/shared/trunk/ldap-schema-manager/src/test/java/org/apache/directory/shared/ldap/schema/loader/ldif/MatchingRuleTest.java
Wed Jun 23 15:55:59 2010
@@ -198,19 +198,33 @@ public class MatchingRuleTest
     {
         MatchingRule mr1 = schemaManager.lookupMatchingRuleRegistry( "generalizedTimeMatch"
);
         assertEquals( GeneralizedTimeNormalizer.class.getName(), mr1.getNormalizer().getClass().getName()
);
-        assertEquals( "20100314150000.000Z", mr1.getNormalizer().normalize( "2010031415Z"
) );
+
+        String normalized = mr1.getNormalizer().normalize( "2010031415Z" );
+        assertTrue( "20100314150000.000Z".equals( normalized ) || "20100314153000.000Z".equals(
normalized )
+            || "20100314154500.000Z".equals( normalized ) );
         assertEquals( "20100314133102.003Z", mr1.getNormalizer().normalize( "20100314150102.003+0130"
) );
         assertEquals( GeneralizedTimeComparator.class.getName(), mr1.getLdapComparator().getClass().getName()
);
-        assertEquals( 0, mr1.getLdapComparator().compare( "2010031415Z", "20100314150000.000+0000"
) );
+
+        // Deal with +HH:30 and +HH:45 TZ
+        int compare1 = mr1.getLdapComparator().compare( "2010031415Z", "20100314150000.000+0000"
);
+        int compare2 = mr1.getLdapComparator().compare( "2010031415Z", "20100314153000.000+0000"
);
+        int compare3 = mr1.getLdapComparator().compare( "2010031415Z", "20100314154500.000+0000"
);
+        assertTrue( ( compare1 == 0 ) || ( compare2 == 0 ) || ( compare3 == 0 ) );
 
         MatchingRule mr2 = schemaManager.lookupMatchingRuleRegistry( "generalizedTimeOrderingMatch"
);
         assertEquals( GeneralizedTimeNormalizer.class.getName(), mr2.getNormalizer().getClass().getName()
);
-        assertEquals( "20100314150000.000Z", mr2.getNormalizer().normalize( "2010031415Z"
) );
+        normalized = mr2.getNormalizer().normalize( "2010031415Z" );
+        assertTrue( "20100314150000.000Z".equals( normalized ) || "20100314153000.000Z".equals(
normalized )
+            || "20100314154500.000Z".equals( normalized ) );
         assertEquals( "20100314133102.003Z", mr2.getNormalizer().normalize( "20100314150102.003+0130"
) );
         assertEquals( GeneralizedTimeComparator.class.getName(), mr2.getLdapComparator().getClass().getName()
);
-        assertEquals( 0, mr2.getLdapComparator().compare( "2010031415Z", "20100314150000.000+0000"
) );
+
+        // Deal with +HH:30 and +HH:45 TZ
+        compare1 = mr2.getLdapComparator().compare( "2010031415Z", "20100314150000.000+0000"
);
+        compare2 = mr2.getLdapComparator().compare( "2010031415Z", "20100314153000.000+0000"
);
+        compare3 = mr2.getLdapComparator().compare( "2010031415Z", "20100314154500.000+0000"
);
+        assertTrue( ( compare1 == 0 ) || ( compare2 == 0 ) || ( compare3 == 0 ) );
         assertTrue( mr2.getLdapComparator().compare( "2010031415Z", "2010031414Z" ) >
0 );
         assertTrue( mr2.getLdapComparator().compare( "2010031415Z", "2010031416Z" ) <
0 );
     }
-
 }



Mime
View raw message