| | |
| | | |
| | | |
| | | |
| | | import static org.opends.server.schema.SchemaConstants.AMR_DOUBLE_METAPHONE_NAME; |
| | | import static org.opends.sdk.schema.SchemaConstants.AMR_DOUBLE_METAPHONE_NAME; |
| | | import static org.testng.Assert.assertEquals; |
| | | |
| | | import org.opends.sdk.ConditionResult; |
| | |
| | | */ |
| | | public class ApproximateMatchingRuleTest extends SchemaTestCase |
| | | { |
| | | MatchingRule metaphone = |
| | | Schema.getCoreSchema().getMatchingRule(AMR_DOUBLE_METAPHONE_NAME); |
| | | MatchingRule metaphone = Schema.getCoreSchema().getMatchingRule( |
| | | AMR_DOUBLE_METAPHONE_NAME); |
| | | |
| | | |
| | | |
| | |
| | | throws Exception |
| | | { |
| | | // normalize the 2 provided values |
| | | ByteString normalizedValue1 = |
| | | rule.normalizeAttributeValue(ByteString.valueOf(value1)); |
| | | ByteString normalizedValue1 = rule |
| | | .normalizeAttributeValue(ByteString.valueOf(value1)); |
| | | |
| | | // check that the approximatelyMatch return the expected result. |
| | | ConditionResult liveResult = |
| | | rule.getAssertion(ByteString.valueOf(value2)).matches( |
| | | normalizedValue1); |
| | | ConditionResult liveResult = rule.getAssertion( |
| | | ByteString.valueOf(value2)).matches(normalizedValue1); |
| | | assertEquals(result, liveResult); |
| | | } |
| | | } |