From: Jeff M. <cus...@us...> - 2002-06-19 15:26:55
|
Update of /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/alt/javax/mail/internet In directory usw-pr-cvs1:/tmp/cvs-serv12913/src/j2ee/common/alt/javax/mail/internet Modified Files: MimeMessageFactory.java MimeMessageFactoryImpl.java Added Files: MimeMessage.java MimeMessageImpl.java Log Message: Lots of small changes to mocks --- NEW FILE: MimeMessage.java --- package alt.javax.mail.internet; import alt.javax.mail.Message; import javax.mail.Address; import javax.mail.MessagingException; import javax.mail.Flags; import javax.mail.Folder; import javax.mail.search.SearchTerm; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.util.Enumeration; public interface MimeMessage extends Message { void setRecipient(javax.mail.Message.RecipientType type, Address address) throws MessagingException; void addRecipient(javax.mail.Message.RecipientType type, Address address) throws MessagingException; void setFlag(Flags.Flag flag, boolean b) throws MessagingException; int getMessageNumber(); Folder getFolder(); boolean isExpunged(); boolean match(SearchTerm term) throws MessagingException; Address[] getAllRecipients() throws MessagingException; void setRecipients(javax.mail.Message.RecipientType type, String s) throws MessagingException; void addRecipients(javax.mail.Message.RecipientType type, String s) throws MessagingException; Address[] getReplyTo() throws MessagingException; void setReplyTo(Address[] addresses) throws MessagingException; void setSubject(String s, String s1) throws MessagingException; String getEncoding() throws MessagingException; String getContentID() throws MessagingException; void setContentID(String s) throws MessagingException; String getContentMD5() throws MessagingException; void setContentMD5(String s) throws MessagingException; void setDescription(String s, String s1) throws MessagingException; String[] getContentLanguage() throws MessagingException; void setContentLanguage(String[] strings) throws MessagingException; String getMessageID() throws MessagingException; InputStream getRawInputStream() throws MessagingException; void setText(String s, String s1) throws MessagingException; void writeTo(OutputStream stream, String[] strings) throws IOException, MessagingException; String getHeader(String s, String s1) throws MessagingException; void addHeaderLine(String s) throws MessagingException; Enumeration getAllHeaderLines() throws MessagingException; Enumeration getMatchingHeaderLines(String[] strings) throws MessagingException; Enumeration getNonMatchingHeaderLines(String[] strings) throws MessagingException; boolean isSet(Flags.Flag flag) throws MessagingException; } --- NEW FILE: MimeMessageImpl.java --- package alt.javax.mail.internet; import alt.javax.mail.Message; import alt.javax.mail.MessageImpl; import alt.javax.mail.Session; import javax.mail.Address; import javax.mail.Flags; import javax.mail.Folder; import javax.mail.MessagingException; import javax.mail.search.SearchTerm; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; public class MimeMessageImpl extends MessageImpl implements MimeMessage { private final javax.mail.internet.MimeMessage message; public MimeMessageImpl(Session session) { super(new javax.mail.internet.MimeMessage(session.getWrappedSession())); message = (javax.mail.internet.MimeMessage)getRealMessage(); } public void setRecipient(javax.mail.Message.RecipientType type, Address address) throws MessagingException { message.setRecipient(type, address); } public void addRecipient(javax.mail.Message.RecipientType type, Address address) throws MessagingException { message.addRecipient(type, address); } public void setFlag(Flags.Flag flag, boolean b) throws MessagingException { message.setFlag(flag, b); } public int getMessageNumber() { return message.getMessageNumber(); } public Folder getFolder() { return message.getFolder(); } public boolean isExpunged() { return message.isExpunged(); } public boolean match(SearchTerm term) throws MessagingException { return message.match(term); } public Address[] getAllRecipients() throws MessagingException { return message.getAllRecipients(); } public void setRecipients(javax.mail.Message.RecipientType type, String s) throws MessagingException { message.setRecipients(type, s); } public void addRecipients(javax.mail.Message.RecipientType type, String s) throws MessagingException { message.addRecipients(type, s); } public Address[] getReplyTo() throws MessagingException { return message.getReplyTo(); } public void setReplyTo(Address[] addresses) throws MessagingException { message.setReplyTo(addresses); } public void setSubject(String s, String s1) throws MessagingException { message.setSubject(s, s1); } public String getEncoding() throws MessagingException { return message.getEncoding(); } public String getContentID() throws MessagingException { return message.getContentID(); } public void setContentID(String s) throws MessagingException { message.setContentID(s); } public String getContentMD5() throws MessagingException { return message.getContentMD5(); } public void setContentMD5(String s) throws MessagingException { message.setContentMD5(s); } public void setDescription(String s, String s1) throws MessagingException { message.setDescription(s, s1); } public String[] getContentLanguage() throws MessagingException { return message.getContentLanguage(); } public void setContentLanguage(String[] strings) throws MessagingException { message.setContentLanguage(strings); } public String getMessageID() throws MessagingException { return message.getMessageID(); } public InputStream getRawInputStream() throws MessagingException { return message.getRawInputStream(); } public void setText(String s, String s1) throws MessagingException { message.setText(s, s1); } public void writeTo(OutputStream stream, String[] strings) throws IOException, MessagingException { message.writeTo(stream, strings); } public String getHeader(String s, String s1) throws MessagingException { return message.getHeader(s, s1); } public void addHeaderLine(String s) throws MessagingException { message.addHeaderLine(s); } public Enumeration getAllHeaderLines() throws MessagingException { return message.getAllHeaderLines(); } public Enumeration getMatchingHeaderLines(String[] strings) throws MessagingException { return message.getMatchingHeaderLines(strings); } public Enumeration getNonMatchingHeaderLines(String[] strings) throws MessagingException { return message.getNonMatchingHeaderLines(strings); } public synchronized boolean isSet(Flags.Flag flag) throws MessagingException { return message.isSet(flag); } } Index: MimeMessageFactory.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/alt/javax/mail/internet/MimeMessageFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MimeMessageFactory.java 30 Apr 2002 17:03:10 -0000 1.1 +++ MimeMessageFactory.java 19 Jun 2002 15:26:21 -0000 1.2 @@ -1,6 +1,6 @@ package alt.javax.mail.internet; -import javax.mail.internet.MimeMessage; +import alt.javax.mail.internet.MimeMessage; import alt.javax.mail.Session; public interface MimeMessageFactory { Index: MimeMessageFactoryImpl.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/j2ee/common/alt/javax/mail/internet/MimeMessageFactoryImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MimeMessageFactoryImpl.java 30 Apr 2002 17:03:10 -0000 1.1 +++ MimeMessageFactoryImpl.java 19 Jun 2002 15:26:21 -0000 1.2 @@ -1,10 +1,10 @@ package alt.javax.mail.internet; -import javax.mail.internet.MimeMessage; +import alt.javax.mail.internet.MimeMessage; import alt.javax.mail.Session; public class MimeMessageFactoryImpl implements MimeMessageFactory { public MimeMessage createMimeMessage(Session session){ - return new MimeMessage(session.getWrappedSession()); + return new MimeMessageImpl(session); } } |