From d4b8c4a45412fef75de97c9b3bafbc2b50d43f2a Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 09 Nov 2006 20:35:37 +0000
Subject: [PATCH] Add new unit tests that perform validation for message IDs. One test verifies that there are no duplicate message ID assignments, and the other makes sure that all message IDs defined are registered with the server and have a valid default message. This testing is conducted using reflection to examine all declared fields in the message classes.
---
opends/src/server/org/opends/server/messages/SchemaMessages.java | 70 ++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 29 deletions(-)
diff --git a/opends/src/server/org/opends/server/messages/SchemaMessages.java b/opends/src/server/org/opends/server/messages/SchemaMessages.java
index a95c8e7..4d55bd4 100644
--- a/opends/src/server/org/opends/server/messages/SchemaMessages.java
+++ b/opends/src/server/org/opends/server/messages/SchemaMessages.java
@@ -2797,35 +2797,6 @@
/**
- * The message ID for the message that will be used if an authPassword value
- * has an invalid character in the authValue element. This takes a single
- * argument, which is the position of the invalid character.
- */
- public static final int MSGID_ATTR_SYNTAX_AUTHPW_INVALID_AUTH_VALUE_CHAR =
- CATEGORY_MASK_SCHEMA | SEVERITY_MASK_SEVERE_ERROR | 246;
-
-
-
- /**
- * The message ID for the message that will be used if an authPassword value
- * has an empty authValue element. This does not take any arguments.
- */
- public static final int MSGID_ATTR_SYNTAX_AUTHPW_NO_AUTH_VALUE =
- CATEGORY_MASK_SCHEMA | SEVERITY_MASK_SEVERE_ERROR | 247;
-
-
-
- /**
- * The message ID for the message that will be used if an authPassword value
- * has an invalid character after the authValue element. This takes a single
- * argument, which is the position of the invalid character.
- */
- public static final int MSGID_ATTR_SYNTAX_AUTHPW_INVALID_TRAILING_CHAR =
- CATEGORY_MASK_SCHEMA | SEVERITY_MASK_SEVERE_ERROR | 248;
-
-
-
- /**
* The message ID for the message that will be used if a value does not start
* with an opening parenthesis. This takes a single argument, which is the
* provided value string.
@@ -2948,6 +2919,35 @@
/**
+ * The message ID for the message that will be used if an authPassword value
+ * has an invalid character in the authValue element. This takes a single
+ * argument, which is the position of the invalid character.
+ */
+ public static final int MSGID_ATTR_SYNTAX_AUTHPW_INVALID_AUTH_VALUE_CHAR =
+ CATEGORY_MASK_SCHEMA | SEVERITY_MASK_SEVERE_ERROR | 261;
+
+
+
+ /**
+ * The message ID for the message that will be used if an authPassword value
+ * has an empty authValue element. This does not take any arguments.
+ */
+ public static final int MSGID_ATTR_SYNTAX_AUTHPW_NO_AUTH_VALUE =
+ CATEGORY_MASK_SCHEMA | SEVERITY_MASK_SEVERE_ERROR | 262;
+
+
+
+ /**
+ * The message ID for the message that will be used if an authPassword value
+ * has an invalid character after the authValue element. This takes a single
+ * argument, which is the position of the invalid character.
+ */
+ public static final int MSGID_ATTR_SYNTAX_AUTHPW_INVALID_TRAILING_CHAR =
+ CATEGORY_MASK_SCHEMA | SEVERITY_MASK_SEVERE_ERROR | 263;
+
+
+
+ /**
* Associates a set of generic messages with the message IDs defined in this
* class.
*/
@@ -3631,6 +3631,18 @@
"objectclass with OID %s (%s). This objectclass exists " +
"in the server schema but is defined as %s rather than " +
"structural.");
+ registerMessage(MSGID_ATTR_SYNTAX_NAME_FORM_UNKNOWN_REQUIRED_ATTR,
+ "The definition for the name form with OID %s declared " +
+ "that it should include required attribute \"%s\". No " +
+ "attribute type matching this name or OID exists in the " +
+ "server schema, so a default attribute type with the " +
+ "directory string syntax will be used.");
+ registerMessage(MSGID_ATTR_SYNTAX_NAME_FORM_UNKNOWN_OPTIONAL_ATTR,
+ "The definition for the name form with OID %s declared " +
+ "that it should include optional attribute \"%s\". No " +
+ "attribute type matching this name or OID exists in the " +
+ "server schema, so a default attribute type with the " +
+ "directory string syntax will be used.");
registerMessage(MSGID_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS,
"The provided value \"%s\" could not be parsed as a name " +
"form description because it does not specify the " +
--
Gitblit v1.10.0