[jboss-cvs] jboss-seam/src/main/org/jboss/seam/mail ...
Peter Muir
peter at bleepbleep.org.uk
Wed Oct 10 11:17:42 EDT 2007
User: pmuir
Date: 07/10/10 11:17:41
Modified: src/main/org/jboss/seam/mail MockTransport.java
Log:
Improvements to mail test harness
Revision Changes Path
1.2 +10 -2 jboss-seam/src/main/org/jboss/seam/mail/MockTransport.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MockTransport.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/mail/MockTransport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- MockTransport.java 9 Oct 2007 13:58:50 -0000 1.1
+++ MockTransport.java 10 Oct 2007 15:17:41 -0000 1.2
@@ -37,7 +37,15 @@
public void sendMessage(Message message, Address[] recipients)
throws MessagingException
{
- Contexts.getEventContext().set(VAR_NAME, message);
+ Contexts.getApplicationContext().set(VAR_NAME, message);
+ }
+
+ /**
+ * Get the most recently rendered message sent using the MockTransport.
+ */
+ public static void clearMailMessage()
+ {
+ Contexts.getApplicationContext().remove(VAR_NAME);
}
/**
@@ -45,7 +53,7 @@
*/
public static MimeMessage getMailMessage()
{
- return (MimeMessage) Contexts.getEventContext().get(VAR_NAME);
+ return (MimeMessage) Contexts.getApplicationContext().get(VAR_NAME);
}
@Override
More information about the jboss-cvs-commits
mailing list