You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(99) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Stig T. <jw...@us...> - 2005-03-20 15:05:45
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19482/net/sf/mailsomething/mail Modified Files: Hierachy.java Log Message: Index: Hierachy.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Hierachy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Hierachy.java 3 Apr 2004 07:56:48 -0000 1.1 --- Hierachy.java 20 Mar 2005 15:05:37 -0000 1.2 *************** *** 49,57 **** ! public int getChildCount(); ! public Object getChild(int index); ! public Object[] getChildren(); public void delete(); --- 49,57 ---- ! //public int getChildCount(); ! //public Object getChild(int index); ! //public Object[] getChildren(); public void delete(); *************** *** 62,68 **** ! public void setFlags(Flags flags); ! public Flags getFlags(); --- 62,68 ---- ! //public void setFlags(Flags flags); ! //public Flags getFlags(); |
From: Stig T. <jw...@us...> - 2005-03-20 15:05:29
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19435/net/sf/mailsomething/mail Removed Files: Flags.java Log Message: --- Flags.java DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-20 15:05:10
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19139/net/sf/mailsomething/mail Removed Files: Examples.java Log Message: --- Examples.java DELETED --- |
From: Stig T. <jw...@us...> - 2005-03-20 15:04:35
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18828/net/sf/mailsomething/gui/mail Modified Files: MessageViewer.java MailEditor.java MailboxTree.java Log Message: Index: MessageViewer.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MessageViewer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MessageViewer.java 11 Mar 2005 13:18:48 -0000 1.3 --- MessageViewer.java 20 Mar 2005 15:04:23 -0000 1.4 *************** *** 19,22 **** --- 19,23 ---- import net.sf.mailsomething.mail.Message; import net.sf.mailsomething.mail.MessageConstants; + import net.sf.mailsomething.mail.actions.GetMessageBodyAction; import net.sf.mailsomething.text.MailEditorKit; *************** *** 1137,1160 **** MessageHolder mailbox = table.getMailbox(); ! Request r = new Request( Request.FETCH_BODY, mailbox, ! message.getField(MessageConstants.MESSAGE_ID)); //if theres some problem we dont need to keep this //request - it will appear again when user wants //to see the message ! r.setDismissable(true); ! r.setUrgent(true); statusBar = new StatusBar(); ! r.addProgressListener(statusBar); //this is not correct, but keeping it so far. ! ((Mailbox) mailbox).handleRequest(r); bodyWaiter = new IsBodyFetchedListener(message); --- 1138,1166 ---- MessageHolder mailbox = table.getMailbox(); + + GetMessageBodyAction gam = new GetMessageBodyAction(mailbox, message); + + + ! /*Request r = new Request( Request.FETCH_BODY, mailbox, ! message.getField(MessageConstants.MESSAGE_ID));*/ //if theres some problem we dont need to keep this //request - it will appear again when user wants //to see the message ! //r.setDismissable(true); ! //r.setUrgent(true); statusBar = new StatusBar(); ! gam.addProgressListener(statusBar); //this is not correct, but keeping it so far. ! ((Mailbox) mailbox).addAction(gam); bodyWaiter = new IsBodyFetchedListener(message); Index: MailEditor.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailEditor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MailEditor.java 14 Mar 2005 20:26:42 -0000 1.2 --- MailEditor.java 20 Mar 2005 15:04:23 -0000 1.3 *************** *** 34,37 **** --- 34,38 ---- import net.sf.mailsomething.mail.*; + import net.sf.mailsomething.mail.actions.StoreMessageAction; import net.sf.mailsomething.util.event.*; *************** *** 1158,1163 **** try { ! ((Mailbox) drafts).store(message); } catch (ClassCastException f) { --- 1159,1167 ---- try { + + StoreMessageAction a = + new StoreMessageAction(drafts, message); ! ((Mailbox) drafts).addAction(a); } catch (ClassCastException f) { Index: MailboxTree.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxTree.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailboxTree.java 20 Mar 2005 15:04:23 -0000 1.2 *************** *** 16,19 **** --- 16,20 ---- import net.sf.mailsomething.mail.*; + import net.sf.mailsomething.mail.actions.GetMessagesAction; import net.sf.mailsomething.search.impl.MailboxSearchable; import net.sf.mailsomething.util.*; *************** *** 724,728 **** account.setPassword(dialog.getPassword()); ! messageHolder.updateMessages(ImapAccount.DEFAULT); } --- 725,729 ---- account.setPassword(dialog.getPassword()); ! messageHolder.updateMessages(GetMessagesAction.DEFAULT); } *************** *** 735,739 **** if(messageHolder != null) ! messageHolder.updateMessages(ImapAccount.DEFAULT); if(messageHolder instanceof MailboxHolder) { --- 736,740 ---- if(messageHolder != null) ! messageHolder.updateMessages(GetMessagesAction.DEFAULT); if(messageHolder instanceof MailboxHolder) { *************** *** 755,759 **** if(messageHolder != null) ! messageHolder.updateMessages(ImapAccount.DEFAULT); else --- 756,760 ---- if(messageHolder != null) ! messageHolder.updateMessages(GetMessagesAction.DEFAULT); else *************** *** 1005,1009 **** public void actionPerformed(ActionEvent e) { if (messageHolder != null) { ! messageHolder.updateMessages(ImapAccount.SYNC); } --- 1006,1017 ---- public void actionPerformed(ActionEvent e) { if (messageHolder != null) { ! ! /*GetMessagesAction action = new GetMessagesAction(); ! ! action.setMailbox(messageHolder); ! action.setType(GetMessagesAction.SYNC);*/ ! ! ! messageHolder.updateMessages(GetMessagesAction.SYNC); } |
From: kris <k_...@us...> - 2005-03-17 03:34:34
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8601/net/sf/mailsomething/mail Modified Files: MailAddress.java Log Message: Index: MailAddress.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAddress.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailAddress.java 16 Mar 2005 18:53:38 -0000 1.4 --- MailAddress.java 17 Mar 2005 03:34:24 -0000 1.5 *************** *** 217,228 **** } ! } else { // mail address is malformed ! ! //I think this is wrong. If im not wrong, I think a ! //mail address can also be for example: ! // stig <xx@xx.xx> ! //ie without the "" or without a name at all. ! throw new MalformedMailAddressException("Malformed Mail Address"); ! } int first = 0; --- 217,221 ---- } ! } int first = 0; |
From: Stig T. <jw...@us...> - 2005-03-16 20:21:32
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14740/net/sf/mailsomething/mail/parsers Modified Files: MailDecoder.java Log Message: Index: MailDecoder.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/MailDecoder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailDecoder.java 16 Mar 2005 18:19:36 -0000 1.4 --- MailDecoder.java 16 Mar 2005 20:21:17 -0000 1.5 *************** *** 22,29 **** import java.text.*; - import java.io.File; - import java.io.FileWriter; - import java.io.IOException; - import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.io.ByteArrayOutputStream; --- 22,25 ---- *************** *** 1289,1295 **** String rest = value.substring(k + 1, j + 1); ! ! //System.out.println("rest= " + rest); ! StringTokenizer t = new StringTokenizer(rest, "?"); --- 1285,1289 ---- String rest = value.substring(k + 1, j + 1); ! StringTokenizer t = new StringTokenizer(rest, "?"); *************** *** 1302,1309 **** String tobedecoded = t.nextToken(); - /*System.out.println("charset = " + charset); - System.out.println("encoding = " + encoding); - System.out.println("tobedecoded = " + tobedecoded);*/ - rest = tobedecoded; --- 1296,1299 ---- *************** *** 1316,1326 **** String cc = rest.substring(k + 1, k + 3); - //System.out.println(cc); - String newValue = QuotedPrintable.decodeChar(cc, charset); - //System.out.println("newvalue= " + newValue); - returnvalue += rest.substring(0, k); returnvalue += newValue; --- 1306,1312 ---- |
From: Stig T. <jw...@us...> - 2005-03-16 18:53:48
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28332/net/sf/mailsomething/mail Modified Files: MailAddress.java Log Message: Index: MailAddress.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAddress.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailAddress.java 16 Mar 2005 18:18:56 -0000 1.3 --- MailAddress.java 16 Mar 2005 18:53:38 -0000 1.4 *************** *** 96,100 **** */ public String getUser() { ! return user; --- 96,100 ---- */ public String getUser() { ! return user; *************** *** 123,128 **** public void setUser(String user) { ! ! this.user = user; } --- 123,131 ---- public void setUser(String user) { ! ! user = user.trim(); ! ! if(user.indexOf(" ") == -1) ! this.user = user; } *************** *** 192,195 **** --- 195,201 ---- public static MailAddress parse(String headerstring) throws MalformedMailAddressException{ + if(headerstring == null) + throw new MalformedMailAddressException("Method dont take null argument"); + String alias = null; String email_address = null; |
From: Stig T. <jw...@us...> - 2005-03-16 18:52:28
|
Update of /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27972/net/sf/mailsomething/mail Modified Files: MailAddressTest.java Log Message: Index: MailAddressTest.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail/MailAddressTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MailAddressTest.java 16 Mar 2005 05:11:19 -0000 1.5 --- MailAddressTest.java 16 Mar 2005 18:52:17 -0000 1.6 *************** *** 7,10 **** --- 7,13 ---- package net.sf.mailsomething.mail; + import org.hansel.CoverageDecorator; + + import junit.framework.Test; import junit.framework.TestCase; *************** *** 63,74 **** ! /* ! * @see TestCase#setUp() ! */ ! protected void setUp() throws Exception { ! super.setUp(); ! } ! public final void testParse(){ for (int i = 0; i < addresses.length; i++){ --- 66,73 ---- ! ! public void testParse(){ ! for (int i = 0; i < addresses.length; i++){ *************** *** 88,94 **** } } ! public final void testToString(){ String alias=""; --- 87,125 ---- } + + try { + + MailAddress.parse(null); + + fail(); + + } catch (MalformedMailAddressException f) { + + + } + + + try { + + MailAddress.parse("test <joe¤doe.com>"); + + fail(); + + } catch (MalformedMailAddressException f) { + + + } + } + + + public static Test suite() { + return new CoverageDecorator(MailAddressTest.class, + new Class[] { MailAddress.class }); + } + + ! public void testToString(){ String alias=""; *************** *** 114,131 **** } ! /* ! * @see TestCase#tearDown() ! */ ! protected void tearDown() throws Exception { ! super.tearDown(); ! } ! /** ! * Constructor for MailAddressTest. ! * @param arg0 ! */ ! public MailAddressTest(String arg0) { ! super(arg0); ! } /* --- 145,151 ---- } ! ! /* *************** *** 134,137 **** --- 154,203 ---- public void testMailAddress() { } + + + public void testSetAlias() { + + MailAddress address = new MailAddress(); + + String correct = "Joe doe"; + + address.setAlias(correct); + + assertEquals(correct, address.getAlias()); + + } + + + public void testSetUser() { + + MailAddress address = new MailAddress(); + + String notcorrect = "Joe doe"; + + address.setUser(notcorrect); + + assertNotSame(notcorrect, address.getUser()); + + String correct = "joe"; + + address.setUser(correct); + + assertEquals(correct, address.getUser()); + + } + + + public void testSetHost() { + + MailAddress address = new MailAddress(); + + String correct = "Joe doe"; + + address.setHost(correct); + + assertNotSame(correct, address.getUser()); + + } + } |
From: Stig T. <jw...@us...> - 2005-03-16 18:19:47
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20777/net/sf/mailsomething/mail/parsers Modified Files: MailDecoder.java Log Message: Index: MailDecoder.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/MailDecoder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailDecoder.java 12 Mar 2005 15:31:45 -0000 1.3 --- MailDecoder.java 16 Mar 2005 18:19:36 -0000 1.4 *************** *** 824,830 **** public static void decodeFrom(String value, MimeTypeHeader header) { ! MailAddress address = MailAddress.parse(value); ! ! header.setFrom(address); } --- 824,838 ---- public static void decodeFrom(String value, MimeTypeHeader header) { ! ! try { ! ! MailAddress address = MailAddress.parse(value); ! ! header.setFrom(address); ! ! } catch (MalformedMailAddressException f) { ! ! f.printStackTrace(); ! } } |
From: Stig T. <jw...@us...> - 2005-03-16 18:19:27
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20650/net/sf/mailsomething/mail Modified Files: MailAddress.java AddressList.java Log Message: Index: MailAddress.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAddress.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MailAddress.java 16 Mar 2005 03:01:16 -0000 1.2 --- MailAddress.java 16 Mar 2005 18:18:56 -0000 1.3 *************** *** 181,184 **** --- 181,189 ---- * or similar. * + * One note: When u change a method signature like this, you + * should make sure it doesnt give errors other places, and if it + * does, you should fix them. I think for an open source project + * like this, thats the best, that no developers introduce errors + * in the code and then doesnt fix it so it at least compiles. * * @param headerstring a rfc822 headerstring containing an address *************** *** 208,211 **** --- 213,220 ---- } else { // mail address is malformed + //I think this is wrong. If im not wrong, I think a + //mail address can also be for example: + // stig <xx@xx.xx> + //ie without the "" or without a name at all. throw new MalformedMailAddressException("Malformed Mail Address"); } Index: AddressList.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/AddressList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AddressList.java 11 Mar 2005 13:19:17 -0000 1.2 --- AddressList.java 16 Mar 2005 18:18:56 -0000 1.3 *************** *** 104,109 **** --- 104,117 ---- String token = tokenizer.nextToken(); if (!token.trim().equals("")) { + + try { + MailAddress address = MailAddress.parse(token); list.addMailAddress(address); + + } catch (MalformedMailAddressException f) { + + f.printStackTrace(); + } } } |
From: Stig T. <jw...@us...> - 2005-03-16 18:18:52
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/contacts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20544/net/sf/mailsomething/gui/contacts Modified Files: ContactTableModel.java Log Message: Index: ContactTableModel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/contacts/ContactTableModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ContactTableModel.java 3 Apr 2004 07:56:51 -0000 1.1 --- ContactTableModel.java 16 Mar 2005 18:18:23 -0000 1.2 *************** *** 15,18 **** --- 15,19 ---- import net.sf.mailsomething.contact.ContactListListener; import net.sf.mailsomething.mail.MailAddress; + import net.sf.mailsomething.mail.MalformedMailAddressException; /** *************** *** 299,304 **** --- 300,312 ---- contactList.getContactAt(row).setCommunications(comm); + + try { comm.addMailAddress(MailAddress.parse((String) value)); + + } catch (MalformedMailAddressException f) { + + + } } else { |
From: Stig T. <jw...@us...> - 2005-03-16 18:18:11
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/contact/io/vcard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20389/net/sf/jpim/contact/io/vcard Modified Files: EMAILItemHandler.java Log Message: Index: EMAILItemHandler.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/contact/io/vcard/EMAILItemHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EMAILItemHandler.java 3 Apr 2004 07:56:49 -0000 1.1 --- EMAILItemHandler.java 16 Mar 2005 18:17:58 -0000 1.2 *************** *** 16,19 **** --- 16,20 ---- import net.sf.jpim.util.versitio.versitToken; import net.sf.mailsomething.mail.MailAddress; + import net.sf.mailsomething.mail.MalformedMailAddressException; /** *************** *** 34,38 **** public void handleItem(Contact ct, versitItem item) { ! MailAddress email = MailAddress.parse(item.getValue()); //1.handle data //email.setEmail(item.getValue()); --- 35,50 ---- public void handleItem(Contact ct, versitItem item) { ! ! MailAddress email = null; ! ! try { ! ! MailAddress.parse(item.getValue()); ! ! } catch (MalformedMailAddressException f) { ! ! ! } ! //1.handle data //email.setEmail(item.getValue()); *************** *** 64,67 **** --- 76,81 ---- ct.setCommunications(comm); } + + if(email != null) comm.addMailAddress(email); }//handleItem |
From: Stig T. <jw...@us...> - 2005-03-16 18:17:48
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/contact/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20341/net/sf/jpim/contact/gui Modified Files: NamePanel.java Log Message: changed coz of change in MailAddress Index: NamePanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/jpim/contact/gui/NamePanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NamePanel.java 3 Apr 2004 07:56:52 -0000 1.1 --- NamePanel.java 16 Mar 2005 18:17:36 -0000 1.2 *************** *** 14,17 **** --- 14,18 ---- import net.sf.mailsomething.gui.mail.options.AbstractOptionPanel; import net.sf.mailsomething.mail.MailAddress; + import net.sf.mailsomething.mail.MalformedMailAddressException; import javax.swing.*; *************** *** 405,411 **** if (Utils.isEMailValid(newEmail)) { ! if (contact != null && contact.getCommunications() != null) contact.getCommunications().addMailAddress( MailAddress.parse(newEmail)); listModel.add(pos, newEmail); // append to JList --- 406,423 ---- if (Utils.isEMailValid(newEmail)) { ! if (contact != null && contact.getCommunications() != null) { ! ! try { ! contact.getCommunications().addMailAddress( MailAddress.parse(newEmail)); + + + } catch (MalformedMailAddressException f) { + + f.printStackTrace(); + } + + } listModel.add(pos, newEmail); // append to JList |
From: kris <k_...@us...> - 2005-03-16 05:11:37
|
Update of /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5474/net/sf/mailsomething/mail Modified Files: MailAddressTest.java Log Message: Index: MailAddressTest.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail/MailAddressTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MailAddressTest.java 13 Mar 2005 15:36:08 -0000 1.4 --- MailAddressTest.java 16 Mar 2005 05:11:19 -0000 1.5 *************** *** 17,32 **** public class MailAddressTest extends TestCase { ! //the 'To:' should not be part of it, a headerfield consists ! //of the name and the value like: ! //name: value ! //To: xxxx ! //and only the value will be used to get mailaddress objects. ! private String[] testAddresses = new String[]{ ! "To: Stig Tanggaard <st...@eu...>", ! "To: Kris Griffin <k_...@ho...>" }; - /* * @see TestCase#setUp() --- 17,66 ---- public class MailAddressTest extends TestCase { ! /* ! * You must keep all these string arrays equal in size and the individual strings in the correct order ! ! */ ! ! private String[] addresses = new String[]{ ! "\"Jimi Hendrix\" <jim...@he...>", ! "\"Janis Joplin\" <ja...@th...>", ! "\"Jim Morrison\" <mor...@th...>", ! "\"Jon Bonham\" <jb...@ze...>", ! "\"Kurt Kobain\" <kur...@ni...>", ! }; ! ! private String[] emails = new String[]{ ! "jim...@he...", ! "ja...@th...", ! "mor...@th...", ! "jb...@ze...", ! "kur...@ni..." ! ! }; ! ! private String[] aliases = new String[]{ ! "Jimi Hendrix", ! "Janis Joplin", ! "Jim Morrison", ! "Jon Bonham", ! "Kurt Kobain" ! }; ! ! private String[] hosts = new String[]{ ! "heaven.com", ! "thebottle.net", ! "thedoors.com.au", ! "zeplin.com", ! "nirvana.org" ! }; ! ! private String[] users = new String[]{ ! "jimihendrix", ! "janis", ! "morrison", ! "jbonham", ! "kurtkobain" }; /* * @see TestCase#setUp() *************** *** 36,47 **** } ! public void testParse(){ ! for (int i = 0; i < testAddresses.length; i++){ } } - - public void testToString(){ } --- 70,115 ---- } ! public final void testParse(){ ! for (int i = 0; i < addresses.length; i++){ + MailAddress mailaddress = new MailAddress(aliases[i],users[i],hosts[i]); + try{ + MailAddress mailaddress2 = MailAddress.parse(addresses[i]); + assertEquals(mailaddress.getAlias(), mailaddress2.getAlias()); + assertEquals(mailaddress.getUser(), mailaddress2.getUser()); + assertEquals(mailaddress.getHostname(), mailaddress2.getHostname()); + + } catch (MalformedMailAddressException f) { + + fail(); + f.printStackTrace(); + } + + } } + public final void testToString(){ + + String alias=""; + String host=""; + String user=""; + + for (int i = 0; i < emails.length; i++){ + + MailAddress mailaddress = new MailAddress(aliases[i], emails[i]); + String asString = mailaddress.toString(); + + alias = asString.substring(1, (asString.indexOf("<") - 2)); + user = asString.substring((asString.indexOf("<") + 1), asString.indexOf("@")); + + host = asString.substring(asString.indexOf("@") + 1, asString.indexOf(">")); + MailAddress mailaddress2 = new MailAddress(alias,user,host); + + assertEquals(mailaddress.getAlias(), mailaddress2.getAlias()); + assertEquals(mailaddress.getUser(), mailaddress2.getUser()); + assertEquals(mailaddress.getHostname(), mailaddress2.getHostname()); + + } } |
From: kris <k_...@us...> - 2005-03-16 03:01:28
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11376/net/sf/mailsomething/mail Modified Files: MailAddress.java Log Message: Index: MailAddress.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAddress.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailAddress.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailAddress.java 16 Mar 2005 03:01:16 -0000 1.2 *************** *** 173,177 **** /** * TODO: should throw an exception of some kind if the address is ! * invalid. * * Method for parsing an rfc822 headerstring (From, To, or similar) --- 173,177 ---- /** * TODO: should throw an exception of some kind if the address is ! * invalid. * * Method for parsing an rfc822 headerstring (From, To, or similar) *************** *** 185,197 **** * @return MailAddress the mailaddress parsed from the string */ ! public static MailAddress parse(String headerstring) { String alias = null; String email_address = null; ! if (headerstring.indexOf(" ") != -1) { String t = "\""; ! if (headerstring.indexOf(t) != -1) { --- 185,199 ---- * @return MailAddress the mailaddress parsed from the string */ ! public static MailAddress parse(String headerstring) throws MalformedMailAddressException{ String alias = null; String email_address = null; ! String user = ""; ! String host = ""; ! if (headerstring.indexOf(" ") != -1) { String t = "\""; ! if (headerstring.indexOf(t) != -1) { *************** *** 203,206 **** --- 205,212 ---- break; } + + } else { // mail address is malformed + + throw new MalformedMailAddressException("Malformed Mail Address"); } *************** *** 255,262 **** } ! String user = ""; ! ! String host = ""; ! if (email_address != null && email_address.indexOf("@") != -1) { --- 261,265 ---- } ! if (email_address != null && email_address.indexOf("@") != -1) { *************** *** 264,271 **** host = email_address.substring(email_address.indexOf("@") + 1); ! } ! return new MailAddress(alias, user, host); } --- 267,279 ---- host = email_address.substring(email_address.indexOf("@") + 1); ! ! } else { // mail address is malformed ! ! throw new MalformedMailAddressException("Malformed Mail Address"); } ! ! return new MailAddress(alias, user, host); + } |
From: kris <k_...@us...> - 2005-03-15 11:05:40
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27984/net/sf/mailsomething/mail Added Files: MalformedMailAddressException.java Log Message: --- NEW FILE: MalformedMailAddressException.java --- /* * Created on Mar 16, 2005 * * */ package net.sf.mailsomething.mail; /** * @author kris * */ public class MalformedMailAddressException extends Exception{ public MalformedMailAddressException() { } public MalformedMailAddressException(String s) { super(s); } } |
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1942/net/sf/mailsomething/mail Modified Files: Mailbox.java ImapAccount.java MailUtils.java Message.java MailService.java MailAccount.java PopAccount.java Log Message: Index: MailUtils.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailUtils.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailUtils.java 14 Mar 2005 20:27:52 -0000 1.2 *************** *** 118,128 **** account.addMailbox(deleted); ! account.setStandardMailbox(drafts, MailAccount.DRAFTS); ! account.setStandardMailbox(sent, MailAccount.SENT); ! account.setStandardMailbox(deleted, MailAccount.TRASH); ! account.setStandardMailbox(inbox, MailAccount.INBOX); } --- 118,128 ---- account.addMailbox(deleted); ! account.setStandardMailbox(drafts, Mailbox.DRAFTS); ! account.setStandardMailbox(sent, Mailbox.SENT); ! account.setStandardMailbox(deleted, Mailbox.TRASH); ! account.setStandardMailbox(inbox, Mailbox.INBOX); } Index: ImapAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/ImapAccount.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImapAccount.java 27 Apr 2004 13:14:27 -0000 1.2 --- ImapAccount.java 14 Mar 2005 20:27:52 -0000 1.3 *************** *** 1329,1332 **** --- 1329,1341 ---- mailbox.removeMessage(message); + + if(getStandardMailbox(Mailbox.TRASH) != null && + getStandardMailbox(Mailbox.TRASH) != mailbox) { + + message.clearFlag(Message.DELETED); + + getStandardMailbox(Mailbox.TRASH).addMessage(message); + + } } else { *************** *** 1584,1599 **** private void appendMessage(Mailbox mailbox, String messageid) { - //System.out.println("imapaccount append message"); - - //Mailbox mailbox = (Mailbox) r.getObject(); - Message message = mailbox.getMessage(messageid); if (message != null) { controller.appendMessage(message, mailbox.getPath()); - message.setRemote(true); - } } --- 1593,1604 ---- private void appendMessage(Mailbox mailbox, String messageid) { Message message = mailbox.getMessage(messageid); if (message != null) { + + message.setRemote(true); controller.appendMessage(message, mailbox.getPath()); } } Index: MailAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailAccount.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailAccount.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailAccount.java 14 Mar 2005 20:27:52 -0000 1.2 *************** *** 39,55 **** - //fields defining standard mailbox types - //maybe those should actually be placed in the mailbox class, would - //make more sence - public static final int DRAFTS = 1; - - public static final int SENT = 2; - - public static final int TRASH = 3; - - public static final int INBOX = 8; - - - //login-form.... for encryption, currently not being used. private String loginform = null; --- 39,42 ---- *************** *** 256,262 **** if(filterManager != null) { ! if(getStandardMailbox(MailAccount.INBOX) != null) { ! getStandardMailbox(MailAccount.INBOX).addMessageListener(filterManager); } --- 243,249 ---- if(filterManager != null) { ! if(getStandardMailbox(Mailbox.INBOX) != null) { ! getStandardMailbox(Mailbox.INBOX).addMessageListener(filterManager); } *************** *** 625,635 **** public MessageHolder getStandardMailbox(int type) { ! if(type == DRAFTS) return drafts; ! else if(type == SENT) return sent; ! else if(type == TRASH) return trash; ! else if(type == INBOX) return inbox; return null; --- 612,622 ---- public MessageHolder getStandardMailbox(int type) { ! if(type == Mailbox.DRAFTS) return drafts; ! else if(type == Mailbox.SENT) return sent; ! else if(type == Mailbox.TRASH) return trash; ! else if(type == Mailbox.INBOX) return inbox; return null; *************** *** 653,663 **** public void setStandardMailbox(MessageHolder mailbox, int type) { ! if(type == DRAFTS) drafts = mailbox; ! else if(type == SENT) sent = mailbox; ! else if(type == TRASH) trash = mailbox; ! else if(type == INBOX) { --- 640,650 ---- public void setStandardMailbox(MessageHolder mailbox, int type) { ! if(type == Mailbox.DRAFTS) drafts = mailbox; ! else if(type == Mailbox.SENT) sent = mailbox; ! else if(type == Mailbox.TRASH) trash = mailbox; ! else if(type == Mailbox.INBOX) { *************** *** 1179,1183 **** public void createFilterManager() { ! MessageHolder mailbox = this.getStandardMailbox(MailAccount.INBOX); this.filterManager = new FilterManager(mailbox); --- 1166,1170 ---- public void createFilterManager() { ! MessageHolder mailbox = this.getStandardMailbox(Mailbox.INBOX); this.filterManager = new FilterManager(mailbox); Index: Mailbox.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Mailbox.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mailbox.java 3 Apr 2004 07:56:48 -0000 1.1 --- Mailbox.java 14 Mar 2005 20:27:52 -0000 1.2 *************** *** 95,98 **** --- 95,109 ---- private boolean disableListeners = false; + public static final int TRASH = 3; + + public static final int INBOX = 8; + + public static final int SENT = 2; + + //fields defining standard mailbox types + //maybe those should actually be placed in the mailbox class, would + //make more sence + public static final int DRAFTS = 1; + /** * Constructor for the Mailbox object *************** *** 804,810 **** return; ! //System.out.println("mailbox removemessage local"); ! ! //????? //mark that the message is deleted, which means it still exists, --- 815,819 ---- return; ! //mark that the message is deleted, which means it still exists, *************** *** 815,819 **** if (message.isRemote()) { ! //System.out.println("mailbox removemessage remote"); Request r = --- 824,828 ---- if (message.isRemote()) { ! Request r = Index: PopAccount.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/PopAccount.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PopAccount.java 3 Apr 2004 07:56:48 -0000 1.1 --- PopAccount.java 14 Mar 2005 20:27:52 -0000 1.2 *************** *** 416,420 **** public void actionPerformed(ActionEvent e) { ! MessageHolder m = getStandardMailbox(MailAccount.INBOX); if (m != null) { --- 416,420 ---- public void actionPerformed(ActionEvent e) { ! MessageHolder m = getStandardMailbox(Mailbox.INBOX); if (m != null) { *************** *** 494,498 **** if (!mailbox.isRemote()) { ! MessageHolder trash = getStandardMailbox(MailAccount.TRASH); if (trash == null) --- 494,498 ---- if (!mailbox.isRemote()) { ! MessageHolder trash = getStandardMailbox(Mailbox.TRASH); if (trash == null) *************** *** 539,543 **** mailbox.removeMessage(message); ! MessageHolder trash = getStandardMailbox(MailAccount.TRASH); if (trash != null) --- 539,543 ---- mailbox.removeMessage(message); ! MessageHolder trash = getStandardMailbox(Mailbox.TRASH); if (trash != null) *************** *** 571,575 **** controller.clearUidBuffer(); ! MessageHolder mailbox = getStandardMailbox(MailAccount.INBOX); PopController.UIDMarker[] uids = controller.searchUid(); --- 571,575 ---- controller.clearUidBuffer(); ! MessageHolder mailbox = getStandardMailbox(Mailbox.INBOX); PopController.UIDMarker[] uids = controller.searchUid(); Index: MailService.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/MailService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MailService.java 11 Mar 2005 13:19:17 -0000 1.2 --- MailService.java 14 Mar 2005 20:27:52 -0000 1.3 *************** *** 1344,1348 **** MessageHolder inbox = ! account[i].getStandardMailbox(MailAccount.INBOX); inbox.updateMessages(ImapAccount.DEFAULT); --- 1344,1348 ---- MessageHolder inbox = ! account[i].getStandardMailbox(Mailbox.INBOX); inbox.updateMessages(ImapAccount.DEFAULT); Index: Message.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/Message.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Message.java 12 Mar 2005 15:31:19 -0000 1.4 --- Message.java 14 Mar 2005 20:27:52 -0000 1.5 *************** *** 201,204 **** --- 201,215 ---- flags = flags | flag; } + + + + public void clearFlag(int flag) { + + //make sure the flag is set, before substracting it + setFlag(flag); + flags = flags - flag; + + } + /** |
From: Stig T. <jw...@us...> - 2005-03-14 20:27:31
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/options In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1825/net/sf/mailsomething/gui/mail/options Modified Files: ImapExtraPanel.java MailboxFolderOptions.java Log Message: Index: ImapExtraPanel.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/options/ImapExtraPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImapExtraPanel.java 3 Apr 2004 07:56:53 -0000 1.1 --- ImapExtraPanel.java 14 Mar 2005 20:27:13 -0000 1.2 *************** *** 102,117 **** contactsBox = new JComboBox(mailboxNames); ! if (account.getStandardMailbox(MailAccount.DRAFTS) != null) draftBox.setSelectedItem( ! account.getStandardMailbox(MailAccount.DRAFTS).getName()); ! if (account.getStandardMailbox(MailAccount.SENT) != null) sendtBox.setSelectedItem( ! account.getStandardMailbox(MailAccount.SENT).getName()); ! if (account.getStandardMailbox(MailAccount.TRASH) != null) deletedBox.setSelectedItem( ! account.getStandardMailbox(MailAccount.TRASH).getName()); panel1.add(draftLabel); --- 102,117 ---- contactsBox = new JComboBox(mailboxNames); ! if (account.getStandardMailbox(Mailbox.DRAFTS) != null) draftBox.setSelectedItem( ! account.getStandardMailbox(Mailbox.DRAFTS).getName()); ! if (account.getStandardMailbox(Mailbox.SENT) != null) sendtBox.setSelectedItem( ! account.getStandardMailbox(Mailbox.SENT).getName()); ! if (account.getStandardMailbox(Mailbox.TRASH) != null) deletedBox.setSelectedItem( ! account.getStandardMailbox(Mailbox.TRASH).getName()); panel1.add(draftLabel); Index: MailboxFolderOptions.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/options/MailboxFolderOptions.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxFolderOptions.java 3 Apr 2004 07:56:53 -0000 1.1 --- MailboxFolderOptions.java 14 Mar 2005 20:27:13 -0000 1.2 *************** *** 22,25 **** --- 22,26 ---- import net.sf.mailsomething.mail.MailAccount; import net.sf.mailsomething.mail.MailService; + import net.sf.mailsomething.mail.Mailbox; import net.sf.mailsomething.mail.MailboxHolder; import net.sf.mailsomething.mail.MessageHolder; *************** *** 95,114 **** if(((String)combo.getSelectedItem()).equalsIgnoreCase("inbox")) { ! account.setStandardMailbox(messageHolder, MailAccount.INBOX); } else if(((String)combo.getSelectedItem()).equalsIgnoreCase("drafts")) { ! account.setStandardMailbox(messageHolder, MailAccount.DRAFTS); } else if(((String)combo.getSelectedItem()).equalsIgnoreCase("deleted")) { ! account.setStandardMailbox(messageHolder, MailAccount.TRASH); } else if(((String)combo.getSelectedItem()).equalsIgnoreCase("sendt")) { ! account.setStandardMailbox(messageHolder, MailAccount.SENT); --- 96,115 ---- if(((String)combo.getSelectedItem()).equalsIgnoreCase("inbox")) { ! account.setStandardMailbox(messageHolder, Mailbox.INBOX); } else if(((String)combo.getSelectedItem()).equalsIgnoreCase("drafts")) { ! account.setStandardMailbox(messageHolder, Mailbox.DRAFTS); } else if(((String)combo.getSelectedItem()).equalsIgnoreCase("deleted")) { ! account.setStandardMailbox(messageHolder, Mailbox.TRASH); } else if(((String)combo.getSelectedItem()).equalsIgnoreCase("sendt")) { ! account.setStandardMailbox(messageHolder, Mailbox.SENT); *************** *** 247,263 **** if(account != null) { ! if(account.getStandardMailbox(MailAccount.INBOX) == mailbox) { combo.setSelectedIndex(1); ! }else if(account.getStandardMailbox(MailAccount.DRAFTS) == mailbox) { combo.setSelectedIndex(2); ! }else if(account.getStandardMailbox(MailAccount.SENT) == mailbox) { combo.setSelectedIndex(4); ! }else if(account.getStandardMailbox(MailAccount.TRASH) == mailbox) { combo.setSelectedIndex(3); --- 248,264 ---- if(account != null) { ! if(account.getStandardMailbox(Mailbox.INBOX) == mailbox) { combo.setSelectedIndex(1); ! }else if(account.getStandardMailbox(Mailbox.DRAFTS) == mailbox) { combo.setSelectedIndex(2); ! }else if(account.getStandardMailbox(Mailbox.SENT) == mailbox) { combo.setSelectedIndex(4); ! }else if(account.getStandardMailbox(Mailbox.TRASH) == mailbox) { combo.setSelectedIndex(3); |
From: Stig T. <jw...@us...> - 2005-03-14 20:26:55
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1580/net/sf/mailsomething/gui/mail Modified Files: MailEditor.java MailboxTable.java Log Message: Index: MailEditor.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailEditor.java 3 Apr 2004 07:56:49 -0000 1.1 --- MailEditor.java 14 Mar 2005 20:26:42 -0000 1.2 *************** *** 411,415 **** if (workingAccount != null) { ! drafts = workingAccount.getStandardMailbox(MailAccount.DRAFTS); } } --- 411,415 ---- if (workingAccount != null) { ! drafts = workingAccount.getStandardMailbox(Mailbox.DRAFTS); } } *************** *** 1069,1073 **** if (drafts == null && workingAccount != null) ! drafts = workingAccount.getStandardMailbox(MailAccount.DRAFTS); if (drafts == null) { --- 1069,1073 ---- if (drafts == null && workingAccount != null) ! drafts = workingAccount.getStandardMailbox(Mailbox.DRAFTS); if (drafts == null) { *************** *** 1106,1110 **** workingAccount.setStandardMailbox( drafts, ! MailAccount.DRAFTS); } --- 1106,1110 ---- workingAccount.setStandardMailbox( drafts, ! Mailbox.DRAFTS); } *************** *** 1306,1310 **** status.setText("Message sended"); ! sent = workingAccount.getStandardMailbox(MailAccount.SENT); if (sent != null) { --- 1306,1310 ---- status.setText("Message sended"); ! sent = workingAccount.getStandardMailbox(Mailbox.SENT); if (sent != null) { Index: MailboxTable.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/gui/mail/MailboxTable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailboxTable.java 3 Apr 2004 07:56:48 -0000 1.1 --- MailboxTable.java 14 Mar 2005 20:26:43 -0000 1.2 *************** *** 1036,1047 **** if (ac != null) { ! if (ac.getStandardMailbox(MailAccount.DRAFTS) != null ! && ac.getStandardMailbox(MailAccount.DRAFTS).equals(mailbox)) { ((MailboxTableModel) model).setIsDraft(true); } else if ( ! ac.getStandardMailbox(MailAccount.SENT) != null ! && ac.getStandardMailbox(MailAccount.SENT).equals(mailbox)) { //System.out.println("is sent mailbox"); --- 1036,1047 ---- if (ac != null) { ! if (ac.getStandardMailbox(Mailbox.DRAFTS) != null ! && ac.getStandardMailbox(Mailbox.DRAFTS).equals(mailbox)) { ((MailboxTableModel) model).setIsDraft(true); } else if ( ! ac.getStandardMailbox(Mailbox.SENT) != null ! && ac.getStandardMailbox(Mailbox.SENT).equals(mailbox)) { //System.out.println("is sent mailbox"); |
From: Stig T. <jw...@us...> - 2005-03-14 20:13:03
|
Update of /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30258/net/sf/mailsomething/mail/parsers Modified Files: ImapController.java Log Message: fixed a bug in append message Index: ImapController.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/src/net/sf/mailsomething/mail/parsers/ImapController.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImapController.java 3 Apr 2004 07:56:49 -0000 1.1 --- ImapController.java 14 Mar 2005 20:12:50 -0000 1.2 *************** *** 1309,1315 **** //gotta do some checkups if its similar with other //servers. ! if (replies[i].indexOf("APPENDUID 563") != -1) { ! int uidindex = replies[i].indexOf("APPENDUID 563") + 13; int enduid = replies[i].indexOf(" ", uidindex + 2); --- 1309,1343 ---- //gotta do some checkups if its similar with other //servers. ! //a0009 OK [APPENDUID 56614 4] APPEND completed. ! if (replies[i].indexOf("APPENDUID ") != -1) { ! ! int uidindex = replies[i].indexOf("APPENDUID"); ! ! int firstSpace = replies[i].indexOf(" ", uidindex); ! ! int secondSpace = replies[i].indexOf(" ", firstSpace + 1); ! ! int enduid = replies[i].indexOf("]", secondSpace + 1); ! ! String uid = replies[i].substring(secondSpace, enduid); ! ! uid = uid.trim(); ! ! try { ! Integer.parseInt(uid); ! ! m.setUID(uid); ! ! break; ! ! } catch (NumberFormatException f) { ! ! System.out.println("wrong uid = " + uid); ! ! f.printStackTrace(); ! } ! ! /*int uidindex = replies[i].indexOf("APPENDUID 563") + 13; int enduid = replies[i].indexOf(" ", uidindex + 2); *************** *** 1341,1345 **** } ! } } --- 1369,1373 ---- } ! }*/ } |
From: Stig T. <jw...@us...> - 2005-03-13 15:36:23
|
Update of /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28183/net/sf/mailsomething/mail Modified Files: MailAddressTest.java Log Message: Index: MailAddressTest.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail/MailAddressTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MailAddressTest.java 13 Mar 2005 12:20:59 -0000 1.3 --- MailAddressTest.java 13 Mar 2005 15:36:08 -0000 1.4 *************** *** 17,21 **** public class MailAddressTest extends TestCase { ! private String[] testAddresses = new String[]{ "To: Stig Tanggaard <st...@eu...>", --- 17,25 ---- public class MailAddressTest extends TestCase { ! //the 'To:' should not be part of it, a headerfield consists ! //of the name and the value like: ! //name: value ! //To: xxxx ! //and only the value will be used to get mailaddress objects. private String[] testAddresses = new String[]{ "To: Stig Tanggaard <st...@eu...>", |
From: Stig T. <jw...@us...> - 2005-03-13 15:34:05
|
Update of /cvsroot/mailsomething/mailsomething/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27499 Added Files: readme Log Message: --- NEW FILE: readme --- Hierachy for testing classes of the mailsomething. Requires junit, hansel and bcel on classpath. hansel (and bcel which it uses) can be found at hansel.sf.net |
From: Stig T. <jw...@us...> - 2005-03-13 15:30:59
|
Update of /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26513/net/sf/mailsomething/mail Modified Files: AddressListTest.java Log Message: Index: AddressListTest.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail/AddressListTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AddressListTest.java 11 Mar 2005 13:19:43 -0000 1.1 --- AddressListTest.java 13 Mar 2005 15:30:45 -0000 1.2 *************** *** 6,9 **** --- 6,12 ---- package net.sf.mailsomething.mail; + import org.hansel.CoverageDecorator; + + import junit.framework.Test; import junit.framework.TestCase; *************** *** 54,61 **** --- 57,102 ---- } + + + public static Test suite() { + return new CoverageDecorator(AddressListTest.class, + new Class[] { AddressList.class }); + } + + + + + public void testAddressListMailAddress() { + + + MailAddress[] addresses = new MailAddress[]{a,b,c,z}; + + AddressList list = new AddressList(addresses); + + assertEquals(list.getAddresses().length, 4); + + + + } + + /** * Tests the parsing of an AddressList. */ public void testParse() { + + String line = "\"Little dwarf 1\" <bl...@eu...>;" + + "\"Little dwarf 2\" <bl...@eu...>;" + + "=?iso-8859-1?Q?S=F8ren__B=2E_dwarf?= <bl...@eu...>;" + + "\"Little dwarf 3\" <bl...@eu...>;" + + "\"Little dwarf 4\" <bl...@eu...>;" + + "\"Little dwarf 5\" <bl...@eu...>; " + + "\"Little dwarf 7\" <bl...@eu...>"; + + AddressList list = AddressList.parse(line); + + assertEquals(7, list.getAddresses().length); + + // howto? } *************** *** 101,109 **** testAddMailAddress(); ! assertEquals(namedList.exists("kr...@ya..."), true); ! assertEquals(namedList.exists("blah@narf.zo"), false); ! assertEquals(unnamedList.exists("kr...@ya..."), true); ! assertEquals(unnamedList.exists("blah@narf.zo"), false); } --- 142,150 ---- testAddMailAddress(); ! assertTrue(namedList.exists("kr...@ya...")); ! assertFalse(namedList.exists("blah@narf.zo")); ! assertTrue(unnamedList.exists("kr...@ya...")); ! assertFalse(unnamedList.exists("blah@narf.zo")); } |
From: kris <k_...@us...> - 2005-03-13 12:21:15
|
Update of /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2119/net/sf/mailsomething/mail Modified Files: MailAddressTest.java Log Message: Index: MailAddressTest.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail/MailAddressTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MailAddressTest.java 13 Mar 2005 11:33:36 -0000 1.2 --- MailAddressTest.java 13 Mar 2005 12:20:59 -0000 1.3 *************** *** 17,22 **** public class MailAddressTest extends TestCase { ! public static void main(String[] args) { ! } /* --- 17,27 ---- public class MailAddressTest extends TestCase { ! ! private String[] testAddresses = new String[]{ ! "To: Stig Tanggaard <st...@eu...>", ! "To: Kris Griffin <k_...@ho...>" ! }; ! ! /* *************** *** 27,30 **** --- 32,45 ---- } + public void testParse(){ + for (int i = 0; i < testAddresses.length; i++){ + + } + } + + public void testToString(){ + + } + /* * @see TestCase#tearDown() |
From: kris <k_...@us...> - 2005-03-13 11:33:45
|
Update of /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22407/net/sf/mailsomething/mail Modified Files: MailAddressTest.java Log Message: Index: MailAddressTest.java =================================================================== RCS file: /cvsroot/mailsomething/mailsomething/test/net/sf/mailsomething/mail/MailAddressTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MailAddressTest.java 13 Mar 2005 11:19:37 -0000 1.1 --- MailAddressTest.java 13 Mar 2005 11:33:36 -0000 1.2 *************** *** 17,19 **** --- 17,50 ---- public class MailAddressTest extends TestCase { + public static void main(String[] args) { + } + + /* + * @see TestCase#setUp() + */ + protected void setUp() throws Exception { + super.setUp(); + } + + /* + * @see TestCase#tearDown() + */ + protected void tearDown() throws Exception { + super.tearDown(); + } + + /** + * Constructor for MailAddressTest. + * @param arg0 + */ + public MailAddressTest(String arg0) { + super(arg0); + } + + /* + * Class under test for void MailAddress() + */ + public void testMailAddress() { + } + } |