Skip to content
Permalink
Browse files
Fix MailContext mock in postage project further to new 2.5.0 version
git-svn-id: https://svn.apache.org/repos/asf/james/postage/trunk@1426731 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Eric Charles committed Dec 29, 2012
1 parent 0b91591 commit 72d06f530420cc9a53039254864f6e0626a3c368
Showing 1 changed file with 50 additions and 25 deletions.
@@ -17,17 +17,20 @@
* under the License. *
****************************************************************/


package org.apache.james.postage.smtpserver;

import org.apache.mailet.MailetContext;
import org.apache.mailet.Mail;
import org.apache.mailet.MailAddress;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import java.util.Collection;
import java.util.Iterator;

import org.apache.mailet.LookupException;
import org.apache.mailet.Mail;
import org.apache.mailet.MailAddress;
import org.apache.mailet.MailetContext;
import org.apache.mailet.TemporaryLookupException;

/**
* mock-up of MailetContext
@@ -43,39 +46,39 @@ public void bounce(Mail mail, String message, MailAddress bouncer) throws Messag
}

public Collection getMailServers(String host) {
return null; // trivial implementation
return null; // trivial implementation
}

public MailAddress getPostmaster() {
return null; // trivial implementation
return null; // trivial implementation
}

public Object getAttribute(String name) {
return null; // trivial implementation
return null; // trivial implementation
}

public Iterator getAttributeNames() {
return null; // trivial implementation
return null; // trivial implementation
}

public int getMajorVersion() {
return 0; // trivial implementation
return 0; // trivial implementation
}

public int getMinorVersion() {
return 0; // trivial implementation
return 0; // trivial implementation
}

public String getServerInfo() {
return null; // trivial implementation
return null; // trivial implementation
}

public boolean isLocalServer(String serverName) {
return false; // trivial implementation
return false; // trivial implementation
}

public boolean isLocalUser(String userAccount) {
return false; // trivial implementation
return false; // trivial implementation
}

public void log(String message) {
@@ -94,14 +97,6 @@ public void sendMail(MimeMessage msg) throws MessagingException {
// trivial implementation
}

public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg) throws MessagingException {
// trivial implementation
}

public void sendMail(MailAddress sender, Collection recipients, MimeMessage msg, String state) throws MessagingException {
// trivial implementation
}

public void sendMail(Mail mail) throws MessagingException {
// trivial implementation
}
@@ -115,12 +110,42 @@ public void storeMail(MailAddress sender, MailAddress recipient, MimeMessage msg
}

public Iterator getSMTPHostAddresses(String domainName) {
return null; // trivial implementation
return null; // trivial implementation
}

// compatibility with James-trunk
public boolean isLocalEmail(MailAddress arg0) {
return false; // trivial implementation
}
}

@Override
public List<String> dnsLookup(String arg0, RecordType arg1) throws TemporaryLookupException, LookupException {
// TODO Auto-generated method stub
return null;
}

@Override
public void log(LogLevel arg0, String arg1) {
// TODO Auto-generated method stub

}

@Override
public void log(LogLevel arg0, String arg1, Throwable arg2) {
// TODO Auto-generated method stub

}

@Override
public void sendMail(MailAddress arg0, Collection<MailAddress> arg1, MimeMessage arg2) throws MessagingException {
// TODO Auto-generated method stub

}

@Override
public void sendMail(MailAddress arg0, Collection<MailAddress> arg1, MimeMessage arg2, String arg3)
throws MessagingException {
// TODO Auto-generated method stub

}
}

0 comments on commit 72d06f5

Please sign in to comment.