From f2160f4bd1c8ac67e5a86a6710d431e8932877f9 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 28 May 2010 11:47:51 +0000
Subject: [PATCH] Synchronize SDK on java.net with internal repository.
---
sdk/tests/unit-tests-testng/src/org/opends/sdk/schema/ApproximateMatchingRuleTest.java | 46 ++++++++++++++++++++++------------------------
1 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/sdk/tests/unit-tests-testng/src/org/opends/sdk/schema/ApproximateMatchingRuleTest.java b/sdk/tests/unit-tests-testng/src/org/opends/sdk/schema/ApproximateMatchingRuleTest.java
index ce6a792..a8ce15a 100644
--- a/sdk/tests/unit-tests-testng/src/org/opends/sdk/schema/ApproximateMatchingRuleTest.java
+++ b/sdk/tests/unit-tests-testng/src/org/opends/sdk/schema/ApproximateMatchingRuleTest.java
@@ -31,12 +31,11 @@
import static org.opends.sdk.schema.SchemaConstants.AMR_DOUBLE_METAPHONE_NAME;
import static org.testng.Assert.assertEquals;
+import org.opends.sdk.ByteString;
import org.opends.sdk.ConditionResult;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import org.opends.sdk.ByteString;
-
/**
@@ -50,6 +49,26 @@
/**
+ * Test the normalization and the approximate comparison.
+ */
+ @Test(dataProvider = "approximatematchingrules")
+ public void approximateMatchingRules(final MatchingRule rule,
+ final String value1, final String value2, final ConditionResult result)
+ throws Exception
+ {
+ // normalize the 2 provided values
+ final ByteString normalizedValue1 = rule.normalizeAttributeValue(ByteString
+ .valueOf(value1));
+
+ // check that the approximatelyMatch return the expected result.
+ final ConditionResult liveResult = rule.getAssertion(
+ ByteString.valueOf(value2)).matches(normalizedValue1);
+ assertEquals(result, liveResult);
+ }
+
+
+
+ /**
* Build the data for the approximateMatchingRules test.
*/
@DataProvider(name = "approximatematchingrules")
@@ -132,8 +151,7 @@
{ metaphone, "algorithme", "algorizm", ConditionResult.TRUE },
{ metaphone, "testing", "testng", ConditionResult.TRUE },
{ metaphone, "announce", "annonce", ConditionResult.TRUE },
- { metaphone, "automaticly", "automatically",
- ConditionResult.TRUE },
+ { metaphone, "automaticly", "automatically", ConditionResult.TRUE },
{ metaphone, "modifyd", "modified", ConditionResult.TRUE },
{ metaphone, "bouteille", "butaille", ConditionResult.TRUE },
{ metaphone, "xeon", "zeon", ConditionResult.TRUE },
@@ -142,24 +160,4 @@
{ metaphone, "thimble", "thimblle", ConditionResult.TRUE },
{ metaphone, "", "", ConditionResult.TRUE }, };
}
-
-
-
- /**
- * Test the normalization and the approximate comparison.
- */
- @Test(dataProvider = "approximatematchingrules")
- public void approximateMatchingRules(MatchingRule rule,
- String value1, String value2, ConditionResult result)
- throws Exception
- {
- // normalize the 2 provided values
- ByteString normalizedValue1 = rule
- .normalizeAttributeValue(ByteString.valueOf(value1));
-
- // check that the approximatelyMatch return the expected result.
- ConditionResult liveResult = rule.getAssertion(
- ByteString.valueOf(value2)).matches(normalizedValue1);
- assertEquals(result, liveResult);
- }
}
--
Gitblit v1.10.0