[jboss-user] [JBoss Seam] - Integration Testing Seam Mail

poiu77 do-not-reply at jboss.com
Fri Dec 7 12:12:51 EST 2007


Hello.

I'm trying run a test from Pete Muir blog site about testing seam email.
Test code example

  | public class EmailAktywacyjnyTest extends SeamTest {
  |     
  |     @Test
  |     public void testowanieWiadomosci() throws Exception {
  |         new FacesRequest() {
  |             @Override
  |             protected void invokeApplication() throws Exception {
  |                 MimeMessage renderedMessage = getRenderedMailMessage("/emailAktywacyjny.xhtml");
  |                 assert renderedMessage.getAllRecipients().length == 1;
  |                 InternetAddress to = (InternetAddress) renderedMessage.getAllRecipients()[0];
  |                 assert to.getAddress().equals("test at example.com");
  |             }
  |         }.run();
  |     }
  | }
  | 

I get error in line :

MimeMessage renderedMessage = getRenderedMailMessage("/emailAktywacyjny.xhtml");



  | FAILED: testowanieWiadomosci
  | java.lang.AssertionError: java.lang.NullPointerException
  |         at org.jboss.seam.mock.BaseSeamTest$Request.onException(BaseSeamTest.java:475)
  |         at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:526)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
  |         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
  |         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
  |         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
  |         at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:514)
  |         at pl.fotowycieczkatest.EmailAktywacyjnyTest.testowanieWiadomosci(EmailAktywacyjnyTest.java:14)
  | Caused by: java.lang.NullPointerException
  |         at org.jboss.seam.mock.BaseSeamTest$Request.getRenderedMailMessage(BaseSeamTest.java:820)
  |         at pl.fotowycieczkatest.EmailAktywacyjnyTest$1.invokeApplication(EmailAktywacyjnyTest.java:17)
  |         at org.jboss.seam.mock.BaseSeamTest$Request.invokeApplicationPhase(BaseSeamTest.java:652)
  |         at org.jboss.seam.mock.BaseSeamTest$Request.emulateJsfLifecycle(BaseSeamTest.java:598)
  |         at org.jboss.seam.mock.BaseSeamTest$Request.access$300(BaseSeamTest.java:185)
  |         at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:519)
  |         ... 36 more
  | ... Removed 22 stack frames
  | 
  | 

Could anyone tell me, what is wrong?

 
Thanks, poiu77

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111293#4111293

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111293



More information about the jboss-user mailing list