| | |
| | | package org.opends.server.schema; |
| | | |
| | | import org.opends.server.api.EqualityMatchingRule; |
| | | import org.opends.server.core.DirectoryException; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.AcceptRejectWarn; |
| | | import org.opends.server.types.ByteString; |
| | | import org.opends.server.types.ConditionResult; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.testng.annotations.DataProvider; |
| | | import org.testng.annotations.Test; |
| | | |
| | |
| | | |
| | | /** |
| | | * Get an instance of the matching rule. |
| | | * |
| | | * |
| | | * @return An instance of the matching rule to test. |
| | | */ |
| | | public abstract EqualityMatchingRule getRule(); |
| | |
| | | assertEquals(result, liveResult); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Generate data for the EqualityMatching Rule test in warn mode. |
| | | * |
| | |
| | | { |
| | | return new Object[][] {}; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Test the normalization and the comparison in the warning mode |
| | | * Test the normalization and the comparison in the warning mode |
| | | */ |
| | | @Test(dataProvider= "warnmodeEqualityMatchingRule") |
| | | public void warnmodeEqualityMatchingRules( |
| | |
| | | { |
| | | AcceptRejectWarn accept = DirectoryServer.getSyntaxEnforcementPolicy(); |
| | | DirectoryServer.setSyntaxEnforcementPolicy(AcceptRejectWarn.WARN); |
| | | try |
| | | try |
| | | { |
| | | equalityMatchingRules(value1, value2, result); |
| | | } |
| | | finally |
| | | { |
| | | DirectoryServer.setSyntaxEnforcementPolicy(accept); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | " should detect that value \"" + value + "\" is invalid"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Generate data for the EqualityMatching Rule test. |
| | | * |
| | |
| | | { |
| | | return new Object[][] {}; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Test the valuesMatch method used for extensible filters. |
| | | */ |
| | |
| | | assertEquals(ConditionResult.TRUE, liveResult); |
| | | else |
| | | assertEquals(ConditionResult.FALSE, liveResult); |
| | | |
| | | |
| | | } |
| | | |
| | | } |