From e8b4efeab26a83eb96203bf1c67f85ffc85cdad5 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 25 Feb 2015 12:55:14 +0000
Subject: [PATCH] Code cleanup. Removed unchecked calls to getters in test.
---
opendj-server-legacy/src/test/java/org/opends/server/schema/BinaryAttributeSyntaxTest.java | 27 +++++++--------------------
1 files changed, 7 insertions(+), 20 deletions(-)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/schema/BinaryAttributeSyntaxTest.java b/opendj-server-legacy/src/test/java/org/opends/server/schema/BinaryAttributeSyntaxTest.java
index 08250fb..a4415ad 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/schema/BinaryAttributeSyntaxTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/schema/BinaryAttributeSyntaxTest.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2012-2014 ForgeRock AS
+ * Portions Copyright 2012-2015 ForgeRock AS
*/
package org.opends.server.schema;
@@ -48,9 +48,9 @@
public abstract Object[][] createAcceptableValues();
/**
- * Get an instance of the attribute syntax that muste be tested.
+ * Get an instance of the attribute syntax that must be tested.
*
- * @return An instance of the attribute syntax that muste be tested.
+ * @return An instance of the attribute syntax that must be tested.
*/
protected abstract AttributeSyntax getRule();
@@ -58,29 +58,16 @@
* Test the normalization and the approximate comparison.
*/
@Test(dataProvider= "acceptableValues")
- public void testAcceptableValues(ByteString value, Boolean result)
+ public void testAcceptableValues(ByteString value, boolean expectedResult)
throws Exception
{
// Make sure that the specified class can be instantiated as a task.
AttributeSyntax syntax = getRule();
LocalizableMessageBuilder reason = new LocalizableMessageBuilder();
- // test the valueIsAcceptable method
- Boolean liveResult =
- syntax.valueIsAcceptable(value, reason);
- if (liveResult != result)
- fail(syntax + ".valueIsAcceptable gave bad result for " + value.toString() +
- "reason : " + reason);
-
- // call the getters
- syntax.getApproximateMatchingRule();
- syntax.getDescription();
- syntax.getEqualityMatchingRule();
- syntax.getOID();
- syntax.getOrderingMatchingRule();
- syntax.getSubstringMatchingRule();
- syntax.getName();
- syntax.toString();
+ boolean liveResult = syntax.valueIsAcceptable(value, reason);
+ assertEquals(liveResult, expectedResult,
+ syntax + ".valueIsAcceptable gave bad result for " + value + "reason : " + reason);
}
}
--
Gitblit v1.10.0