From 80c58327faaa4873369f6bb949e62792c2f708e0 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPException.java | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPException.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPException.java
index 1d4a3c8..b2a48ae 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPException.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPException.java
@@ -28,9 +28,9 @@
package org.opends.server.protocols.ldap;
import org.testng.annotations.Test;
-import static org.opends.server.messages.MessageHandler.getMessage;
-import static org.opends.server.messages.ProtocolMessages.MSGID_ECN_INVALID_ELEMENT_TYPE;
-import static org.opends.server.messages.ProtocolMessages.MSGID_ECN_CANNOT_DECODE_VALUE;
+import static org.opends.messages.ProtocolMessages.ERR_ECN_INVALID_ELEMENT_TYPE;
+import static org.opends.messages.ProtocolMessages.ERR_ECN_CANNOT_DECODE_VALUE;
+import org.opends.messages.MessageDescriptor;
import static org.testng.Assert.*;
import org.opends.server.types.LDAPException;
@@ -38,22 +38,19 @@
@Test()
public void testLDAPException() {
- int msgID = MSGID_ECN_INVALID_ELEMENT_TYPE;
- String message = getMessage(msgID);
- LDAPException ex=new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
+ MessageDescriptor.Arg1<CharSequence> msgDesc = ERR_ECN_INVALID_ELEMENT_TYPE;
+ LDAPException ex=new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgDesc.get(""));
assertTrue(ex.getResultCode() == LDAPResultCode.PROTOCOL_ERROR);
- assertTrue(ex.getMessageID() == msgID);
+ assertTrue(ex.getMessageObject().getDescriptor() == msgDesc);
}
@Test()
public void testLDAPExceptionThrowable() {
- int msgID = MSGID_ECN_INVALID_ELEMENT_TYPE;
- String message = getMessage(msgID);
- LDAPException ex=new LDAPException(LDAPResultCode.OTHER, msgID, message);
- int msgID1 = MSGID_ECN_CANNOT_DECODE_VALUE;
- String message1 = getMessage(msgID);
- new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID1, message1,ex);
+ MessageDescriptor.Arg1<CharSequence> msgID = ERR_ECN_INVALID_ELEMENT_TYPE;
+ LDAPException ex=new LDAPException(LDAPResultCode.OTHER, msgID.get(""));
+ MessageDescriptor.Arg1<CharSequence> msgID1 = ERR_ECN_CANNOT_DECODE_VALUE;
+ new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID1.get(""), ex);
assertTrue(ex.getResultCode() == LDAPResultCode.OTHER);
- assertTrue(ex.getMessageID() == msgID);
+ assertTrue(ex.getMessageObject().getDescriptor() == msgID);
}
}
--
Gitblit v1.10.0