james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwiederk...@apache.org
Subject svn commit: r737040 - in /james/mime4j/trunk: examples/src/java/org/apache/james/mime4j/samples/tree/ src/main/java/org/apache/james/mime4j/field/address/ src/test/java/org/apache/james/mime4j/field/address/
Date Fri, 23 Jan 2009 15:00:54 GMT
Author: mwiederkehr
Date: Fri Jan 23 07:00:54 2009
New Revision: 737040

URL: http://svn.apache.org/viewvc?rev=737040&view=rev
Log:
MIME4J-107: removed NamedMailbox; addresses are serializable; added Address.getDisplayString();
added Mailbox.getAddress()

Removed:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/NamedMailbox.java
Modified:
    james/mime4j/trunk/examples/src/java/org/apache/james/mime4j/samples/tree/MessageTree.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Address.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/AddressList.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Builder.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/DomainList.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Group.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Mailbox.java
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/MailboxList.java
    james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java

Modified: james/mime4j/trunk/examples/src/java/org/apache/james/mime4j/samples/tree/MessageTree.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/examples/src/java/org/apache/james/mime4j/samples/tree/MessageTree.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/examples/src/java/org/apache/james/mime4j/samples/tree/MessageTree.java
(original)
+++ james/mime4j/trunk/examples/src/java/org/apache/james/mime4j/samples/tree/MessageTree.java
Fri Jan 23 07:00:54 2009
@@ -315,7 +315,7 @@
                 StringBuilder sb = new StringBuilder();
                 for (int i = 0; i < list.size(); i++) {
                     Mailbox mb = list.get(i);
-                    sb.append(mb.getAddressString() + "\n");
+                    sb.append(mb.getDisplayString() + "\n");
                 }
                 textView.setText(sb.toString());
                 

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Address.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Address.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Address.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Address.java Fri
Jan 23 07:00:54 2009
@@ -19,15 +19,14 @@
 
 package org.apache.james.mime4j.field.address;
 
+import java.io.Serializable;
 import java.util.List;
 
 /**
  * The abstract base for classes that represent RFC2822 addresses. This includes
  * groups and mailboxes.
- * 
- * Currently, no public methods are introduced on this class.
  */
-public abstract class Address {
+public abstract class Address implements Serializable {
 
     /**
      * Adds any mailboxes represented by this address into the given List. Note
@@ -44,4 +43,44 @@
      */
     protected abstract void doAddMailboxesTo(List<Mailbox> results);
 
-}
+    /**
+     * Formats the address as a human readable string, not including the route.
+     * The resulting string is intended for display purposes only and cannot be
+     * used for transport purposes.
+     * 
+     * @return a string representation of this address intended to be displayed
+     * @see #getDisplayString(boolean)
+     */
+    public final String getDisplayString() {
+        return getDisplayString(false);
+    }
+
+    /**
+     * Formats the address as a human readable string, not including the route.
+     * The resulting string is intended for display purposes only and cannot be
+     * used for transport purposes.
+     * 
+     * For example, if the unparsed address was
+     * 
+     * <"Joe Cheng"@joecheng.com>
+     * 
+     * this method would return
+     * 
+     * <Joe Cheng@joecheng.com>
+     * 
+     * which is not valid for transport; the local part would need to be
+     * re-quoted.
+     * 
+     * @param includeRoute
+     *            <code>true</code> if the route should be included if it
+     *            exists, <code>false</code> otherwise.
+     * @return a string representation of this address intended to be displayed.
+     */
+    public abstract String getDisplayString(boolean includeRoute);
+
+    @Override
+    public String toString() {
+        return getDisplayString(false);
+    }
+
+}
\ No newline at end of file

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/AddressList.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/AddressList.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/AddressList.java
(original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/AddressList.java
Fri Jan 23 07:00:54 2009
@@ -22,6 +22,7 @@
 import org.apache.james.mime4j.field.address.parser.AddressListParser;
 import org.apache.james.mime4j.field.address.parser.ParseException;
 
+import java.io.Serializable;
 import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -31,9 +32,11 @@
 /**
  * An immutable, random-access list of Address objects.
  */
-public class AddressList implements Iterable<Address> {
+public class AddressList implements Iterable<Address>, Serializable {
 
-    private List<? extends Address> addresses;
+    private static final long serialVersionUID = 1L;
+
+    private final List<? extends Address> addresses;
 
     /**
      * @param addresses
@@ -47,7 +50,7 @@
             this.addresses = dontCopy ? addresses : new ArrayList<Address>(
                     addresses);
         else
-            this.addresses = new ArrayList<Address>(0);
+            this.addresses = Collections.emptyList();
     }
 
     /**
@@ -68,7 +71,7 @@
 
     /**
      * Returns an iterator over the addresses in this list.
-     *
+     * 
      * @return an iterator over the addresses in this list.
      */
     public Iterator<Address> iterator() {

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Builder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Builder.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Builder.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Builder.java Fri
Jan 23 07:00:54 2009
@@ -75,8 +75,7 @@
                 return new Group(name, buildGroupBody((ASTgroup_body) n2));
             } else if (n2 instanceof ASTangle_addr) {
                 name = DecoderUtil.decodeEncodedWords(name);
-                return new NamedMailbox(name,
-                        buildAngleAddr((ASTangle_addr) n2));
+                return new Mailbox(name, buildAngleAddr((ASTangle_addr) n2));
             } else {
                 throw new IllegalStateException();
             }
@@ -112,7 +111,7 @@
         }
     }
 
-    private NamedMailbox buildNameAddr(ASTname_addr node) {
+    private Mailbox buildNameAddr(ASTname_addr node) {
         ChildNodeIterator it = new ChildNodeIterator(node);
         Node n = it.next();
         String name;
@@ -125,7 +124,7 @@
         n = it.next();
         if (n instanceof ASTangle_addr) {
             name = DecoderUtil.decodeEncodedWords(name);
-            return new NamedMailbox(name, buildAngleAddr((ASTangle_addr) n));
+            return new Mailbox(name, buildAngleAddr((ASTangle_addr) n));
         } else {
             throw new IllegalStateException();
         }

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/DomainList.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/DomainList.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/DomainList.java
(original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/DomainList.java
Fri Jan 23 07:00:54 2009
@@ -19,6 +19,7 @@
 
 package org.apache.james.mime4j.field.address;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -28,8 +29,11 @@
  * An immutable, random-access list of Strings (that are supposedly domain names
  * or domain literals).
  */
-public class DomainList implements Iterable<String> {
-    private List<String> domains;
+public class DomainList implements Iterable<String>, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private final List<String> domains;
 
     /**
      * @param domains
@@ -42,7 +46,7 @@
         if (domains != null)
             this.domains = dontCopy ? domains : new ArrayList<String>(domains);
         else
-            this.domains = new ArrayList<String>(0);
+            this.domains = Collections.emptyList();
     }
 
     /**
@@ -66,25 +70,30 @@
 
     /**
      * Returns an iterator over the domains in this list.
-     *
+     * 
      * @return an iterator over the domains in this list.
      */
     public Iterator<String> iterator() {
         return Collections.unmodifiableList(domains).iterator();
     }
-    
+
     /**
      * Returns the list of domains formatted as a route string (not including
      * the trailing ':').
      */
     public String toRouteString() {
-        StringBuilder out = new StringBuilder();
-        for (int i = 0; i < domains.size(); i++) {
-            out.append("@");
-            out.append(get(i));
-            if (i + 1 < domains.size())
-                out.append(",");
+        StringBuilder sb = new StringBuilder();
+
+        for (String domain : domains) {
+            if (sb.length() > 0) {
+                sb.append(',');
+            }
+
+            sb.append("@");
+            sb.append(domain);
         }
-        return out.toString();
+
+        return sb.toString();
     }
+
 }

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Group.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Group.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Group.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Group.java Fri
Jan 23 07:00:54 2009
@@ -25,8 +25,11 @@
  * A named group of zero or more mailboxes.
  */
 public class Group extends Address {
-    private String name;
-    private MailboxList mailboxList;
+
+    private static final long serialVersionUID = 1L;
+
+    private final String name;
+    private final MailboxList mailboxList;
 
     /**
      * @param name
@@ -35,6 +38,11 @@
      *            The mailboxes in this group.
      */
     public Group(String name, MailboxList mailboxes) {
+        if (name == null)
+            throw new IllegalArgumentException();
+        if (mailboxes == null)
+            throw new IllegalArgumentException();
+
         this.name = name;
         this.mailboxList = mailboxes;
     }
@@ -54,17 +62,23 @@
     }
 
     @Override
-    public String toString() {
-        StringBuilder buf = new StringBuilder();
-        buf.append(name);
-        buf.append(":");
-        for (int i = 0; i < mailboxList.size(); i++) {
-            buf.append(mailboxList.get(i).toString());
-            if (i + 1 < mailboxList.size())
-                buf.append(",");
+    public String getDisplayString(boolean includeRoute) {
+        StringBuilder sb = new StringBuilder();
+
+        for (Mailbox mailbox : mailboxList) {
+            if (sb.length() == 0) {
+                sb.append(name);
+                sb.append(':');
+            } else {
+                sb.append(',');
+            }
+
+            sb.append(mailbox.getDisplayString(includeRoute));
         }
-        buf.append(";");
-        return buf.toString();
+
+        sb.append(";");
+
+        return sb.toString();
     }
 
     @Override
@@ -73,4 +87,5 @@
             results.add(mailbox);
         }
     }
+
 }

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Mailbox.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Mailbox.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Mailbox.java (original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/Mailbox.java Fri
Jan 23 07:00:54 2009
@@ -19,18 +19,26 @@
 
 package org.apache.james.mime4j.field.address;
 
+import java.util.Collections;
 import java.util.List;
 
 /**
  * Represents a single e-mail address.
  */
 public class Mailbox extends Address {
-    private DomainList route;
-    private String localPart;
-    private String domain;
+
+    private static final long serialVersionUID = 1L;
+
+    private static final DomainList EMPTY_ROUTE_LIST = new DomainList(
+            Collections.<String> emptyList(), true);
+
+    private final String name;
+    private final DomainList route;
+    private final String localPart;
+    private final String domain;
 
     /**
-     * Creates a mailbox without a route. Routes are obsolete.
+     * Creates an unnamed mailbox without a route. Routes are obsolete.
      * 
      * @param localPart
      *            The part of the e-mail address to the left of the "@".
@@ -38,27 +46,82 @@
      *            The part of the e-mail address to the right of the "@".
      */
     public Mailbox(String localPart, String domain) {
-        this(null, localPart, domain);
+        this(null, null, localPart, domain);
     }
 
     /**
-     * Creates a mailbox with a route. Routes are obsolete.
+     * Creates an unnamed mailbox with a route. Routes are obsolete.
      * 
      * @param route
-     *            The zero or more domains that make up the route. Can be null.
+     *            The zero or more domains that make up the route. May be
+     *            <code>null</code>.
      * @param localPart
      *            The part of the e-mail address to the left of the "@".
      * @param domain
      *            The part of the e-mail address to the right of the "@".
      */
     public Mailbox(DomainList route, String localPart, String domain) {
-        this.route = route;
+        this(null, route, localPart, domain);
+    }
+
+    /**
+     * Creates a named mailbox without a route. Routes are obsolete.
+     * 
+     * @param name
+     *            the name of the e-mail address. May be <code>null</code>.
+     * @param localPart
+     *            The part of the e-mail address to the left of the "@".
+     * @param domain
+     *            The part of the e-mail address to the right of the "@".
+     */
+    public Mailbox(String name, String localPart, String domain) {
+        this(name, null, localPart, domain);
+    }
+
+    /**
+     * Creates a named mailbox with a route. Routes are obsolete.
+     * 
+     * @param name
+     *            the name of the e-mail address. May be <code>null</code>.
+     * @param route
+     *            The zero or more domains that make up the route. May be
+     *            <code>null</code>.
+     * @param localPart
+     *            The part of the e-mail address to the left of the "@".
+     * @param domain
+     *            The part of the e-mail address to the right of the "@".
+     */
+    public Mailbox(String name, DomainList route, String localPart,
+            String domain) {
+        if (localPart == null || localPart.length() == 0)
+            throw new IllegalArgumentException();
+
+        this.name = name == null || name.length() == 0 ? null : name;
+        this.route = route == null ? EMPTY_ROUTE_LIST : route;
         this.localPart = localPart;
-        this.domain = domain;
+        this.domain = domain == null || domain.length() == 0 ? null : domain;
+    }
+
+    /**
+     * Creates a named mailbox based on an unnamed mailbox. Package private;
+     * internally used by Builder.
+     */
+    Mailbox(String name, Mailbox baseMailbox) {
+        this(name, baseMailbox.getRoute(), baseMailbox.getLocalPart(),
+                baseMailbox.getDomain());
     }
 
     /**
-     * Returns the route list.
+     * Returns the name of the mailbox or <code>null</code> if it does not
+     * have a name.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Returns the route list. If the mailbox does not have a route an empty
+     * domain list is returned.
      */
     public DomainList getRoute() {
         return route;
@@ -79,37 +142,51 @@
     }
 
     /**
-     * Formats the address as a string, not including the route.
+     * Returns the address in the form <i>localPart@domain</i>.
      * 
-     * @see #getAddressString(boolean)
+     * @return the address part of this mailbox.
      */
-    public String getAddressString() {
-        return getAddressString(false);
+    public String getAddress() {
+        if (domain == null) {
+            return localPart;
+        } else {
+            return localPart + '@' + domain;
+        }
     }
 
-    /**
-     * Note that this value may not be usable for transport purposes, only
-     * display purposes.
-     * 
-     * For example, if the unparsed address was
-     * 
-     * <"Joe Cheng"@joecheng.com>
-     * 
-     * this method would return
-     * 
-     * <Joe Cheng@joecheng.com>
-     * 
-     * which is not valid for transport; the local part would need to be
-     * re-quoted.
-     * 
-     * @param includeRoute
-     *            true if the route should be included if it exists.
-     */
-    public String getAddressString(boolean includeRoute) {
-        return "<"
-                + (!includeRoute || route == null ? "" : route.toRouteString()
-                        + ":") + localPart + (domain == null ? "" : "@")
-                + domain + ">";
+    @Override
+    public String getDisplayString(boolean includeRoute) {
+        includeRoute &= route != null;
+        boolean includeAngleBrackets = name != null || includeRoute;
+
+        StringBuilder sb = new StringBuilder();
+
+        if (name != null) {
+            sb.append(name);
+            sb.append(' ');
+        }
+
+        if (includeAngleBrackets) {
+            sb.append('<');
+        }
+
+        if (includeRoute) {
+            sb.append(route.toRouteString());
+            sb.append(':');
+        }
+
+        sb.append(localPart);
+
+        if (domain != null) {
+            sb.append('@');
+            sb.append(domain);
+        }
+
+        if (includeAngleBrackets) {
+            sb.append('>');
+        }
+
+        return sb.toString();
     }
 
     @Override
@@ -117,8 +194,4 @@
         results.add(this);
     }
 
-    @Override
-    public String toString() {
-        return getAddressString();
-    }
 }

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/MailboxList.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/MailboxList.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/MailboxList.java
(original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/field/address/MailboxList.java
Fri Jan 23 07:00:54 2009
@@ -19,6 +19,7 @@
 
 package org.apache.james.mime4j.field.address;
 
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -27,9 +28,11 @@
 /**
  * An immutable, random-access list of Mailbox objects.
  */
-public class MailboxList implements Iterable<Mailbox> {
+public class MailboxList implements Iterable<Mailbox>, Serializable {
 
-    private List<Mailbox> mailboxes;
+    private static final long serialVersionUID = 1L;
+
+    private final List<Mailbox> mailboxes;
 
     /**
      * @param mailboxes
@@ -43,7 +46,7 @@
             this.mailboxes = dontCopy ? mailboxes : new ArrayList<Mailbox>(
                     mailboxes);
         else
-            this.mailboxes = new ArrayList<Mailbox>(0);
+            this.mailboxes = Collections.emptyList();
     }
 
     /**
@@ -64,7 +67,7 @@
 
     /**
      * Returns an iterator over the mailboxes in this list.
-     *
+     * 
      * @return an iterator over the mailboxes in this list.
      */
     public Iterator<Mailbox> iterator() {

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java?rev=737040&r1=737039&r2=737040&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java
(original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/field/address/AddressTest.java
Fri Jan 23 07:00:54 2009
@@ -45,7 +45,7 @@
     public void testParse1() throws ParseException {
         AddressList addrList = AddressList.parse("John Doe <jdoe@machine(comment).  example>");
         assertEquals(1, addrList.size());
-        NamedMailbox mailbox = (NamedMailbox)addrList.get(0);
+        Mailbox mailbox = (Mailbox)addrList.get(0);
         assertEquals("John Doe", mailbox.getName());
         assertEquals("jdoe", mailbox.getLocalPart());
         assertEquals("machine.example", mailbox.getDomain());
@@ -54,7 +54,7 @@
     public void testParse2() throws ParseException {
         AddressList addrList = AddressList.parse("Mary Smith \t    \t\t  <mary@example.net>");
         assertEquals(1, addrList.size());
-        NamedMailbox mailbox = (NamedMailbox)addrList.get(0);
+        Mailbox mailbox = (Mailbox)addrList.get(0);
         assertEquals("Mary Smith", mailbox.getName());
         assertEquals("mary", mailbox.getLocalPart());
         assertEquals("example.net", mailbox.getDomain());
@@ -76,19 +76,18 @@
         assertEquals("Marketing  folks", group.getName());
         assertEquals(2, group.getMailboxes().size());
 
-        NamedMailbox namedMailbox1 = (NamedMailbox)group.getMailboxes().get(0);
-        NamedMailbox namedMailbox2 = (NamedMailbox)group.getMailboxes().get(1);
+        Mailbox mailbox1 = (Mailbox)group.getMailboxes().get(0);
+        Mailbox mailbox2 = (Mailbox)group.getMailboxes().get(1);
 
-        assertEquals("Jane Smith", namedMailbox1.getName());
-        assertEquals("jane", namedMailbox1.getLocalPart());
-        assertEquals("example.net", namedMailbox1.getDomain());
-
-        assertEquals(" Jack \"Jackie\" Jones ", namedMailbox2.getName());
-        assertEquals("jjones", namedMailbox2.getLocalPart());
-        assertEquals("example.com", namedMailbox2.getDomain());
+        assertEquals("Jane Smith", mailbox1.getName());
+        assertEquals("jane", mailbox1.getLocalPart());
+        assertEquals("example.net", mailbox1.getDomain());
+
+        assertEquals(" Jack \"Jackie\" Jones ", mailbox2.getName());
+        assertEquals("jjones", mailbox2.getLocalPart());
+        assertEquals("example.com", mailbox2.getDomain());
 
         Mailbox mailbox = (Mailbox)addrList.get(1);
-        assertFalse(mailbox instanceof NamedMailbox);
         assertEquals("john", mailbox.getLocalPart());
         assertEquals("example.net", mailbox.getDomain());
         assertEquals(2, mailbox.getRoute().size());
@@ -353,13 +352,13 @@
     public void testGroupSerialization() {
         List<Mailbox> al = new ArrayList<Mailbox>();
         al.add(new Mailbox("test", "example.com"));
-        al.add(new NamedMailbox("Foo!", "foo", "example.com"));
+        al.add(new Mailbox("Foo!", "foo", "example.com"));
         DomainList dl = new DomainList(new ArrayList<String>(Arrays.asList(new String[]
{"foo.example.com"})), true);
-        NamedMailbox namedMailbox = new NamedMailbox("Foo Bar", dl, "foo2", "example.com");
-        assertSame(dl, namedMailbox.getRoute());
-        al.add(namedMailbox);
+        Mailbox mailbox = new Mailbox("Foo Bar", dl, "foo2", "example.com");
+        assertSame(dl, mailbox.getRoute());
+        al.add(mailbox);
         Group g = new Group("group", new MailboxList(al, false));
-        assertEquals("group:<test@example.com>,Foo! <foo@example.com>,Foo Bar
<foo2@example.com>;", g.toString());
+        assertEquals("group:test@example.com,Foo! <foo@example.com>,Foo Bar <foo2@example.com>;",
g.getDisplayString());
     }
     
     public void testEmptyQuotedStringBeforeDotAtomInLocalPart() throws Exception {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message