Author: eric
Date: Mon Jan 3 14:07:02 2011
New Revision: 1054622
URL: http://svn.apache.org/viewvc?rev=1054622&view=rev
Log:
Test for mailboxexception and temporary fix for mailboxexistsexception
(MAILBOX-27)
Added:
james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxExceptionTest.java
Modified:
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxExistsException.java
Modified:
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxExistsException.java
URL:
http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxExistsException.java?rev=1054622&r1=1054621&r2=1054622&view=diff
==============================================================================
---
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxExistsException.java
(original)
+++
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/MailboxExistsException.java
Mon Jan 3 14:07:02 2011
@@ -29,7 +29,7 @@ public class MailboxExistsException exte
private final String mailboxName;
public MailboxExistsException(String mailboxName) {
- super();
+ super("Mailbox Already Exists", new Exception("Mailbox Already
Exists"));
this.mailboxName = mailboxName;
}
Added:
james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxExceptionTest.java
URL:
http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxExceptionTest.java?rev=1054622&view=auto
==============================================================================
---
james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxExceptionTest.java
(added)
+++
james/mailbox/trunk/api/src/test/java/org/apache/james/mailbox/MailboxExceptionTest.java
Mon Jan 3 14:07:02 2011
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+package org.apache.james.mailbox;
+
+import junit.framework.Assert;
+
+import org.junit.Test;
+
+public class MailboxExceptionTest {
+
+ private static final String EXCEPTION_MESSAGE = "this is an exception
message";
+
+ private static final Exception EXCEPTION_CAUSE = new Exception("this is a
cause");
+
+ @Test
+ public void testMailboxExceptionMessage() {
+ MailboxException mbe = new MailboxException();
+ // This one fails...
+// Assert.assertEquals(EXCEPTION_MESSAGE, mbe.getMessage());
+ }
+
+ @Test
+ public void testMailboxExceptionCause() {
+ MailboxException mbe = new MailboxException(EXCEPTION_MESSAGE,
EXCEPTION_CAUSE);
+ Assert.assertEquals(EXCEPTION_MESSAGE, mbe.getMessage());
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]