Package org.apache.james.core

Examples of org.apache.james.core.MailImpl.dispose()


            MimeMessage m1 = ((Mail) a.get(0)).getMessage();
            MimeMessage m2 = ((Mail) a.get(1)).getMessage();
            assertNotSame(m1,m2);
            assertEquals("MYSTATE",((Mail) a.get(0)).getState());
            assertEquals("MYSTATE",((Mail) a.get(1)).getState());
            m.dispose();
        } catch (MessagingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
View Full Code Here


        verifyLastMail(sender, recipient, null);
       
        assertEquals(((String) mm.getContent()).trim(),((String) ((MimeMessage) m_mailServer.getLastMail()[2]).getContent()).trim());
       
        mail.dispose();
    }

   
    /**
     * This is useful code to run tests on javamail bugs
View Full Code Here

        verifyLastMail(sender, recipient, null);
       
        // THIS WOULD FAIL BECAUSE OF THE JAVAMAIL BUG
        // assertEquals(mm.getContent(),((MimeMessage) m_mailServer.getLastMail()[2]).getContent());
       
        mail.dispose();
    }
   
   
}
View Full Code Here

            // conjecture is that it has depended upon finalize to
            // call dispose.  Not in the MailImpl, which doesn't have
            // one, but even further down in the MimeMessageInputStreamSource.

            if (mail != null) {
                mail.dispose();
            }
            throw me;
        } finally {
            if (recipientCollection != null) {
                recipientCollection.clear();
View Full Code Here

                                ("").getBytes())));
        MailImpl mailimpl2 = new MailImpl("name2", new MailAddress("from@test.com"),
                        recipients, mw2);
        mailRep.store(mailimpl2);
        m.dispose();
        mailimpl2.dispose();
    }

    public void testTwoSimultaneousMails() throws Exception {
        finishSetUp(m_testConfiguration);
View Full Code Here

            MimeMessage m1 = ((Mail) a.get(0)).getMessage();
            MimeMessage m2 = ((Mail) a.get(1)).getMessage();
            assertNotSame(m1,m2);
            assertEquals(m1.getSubject(),"new text 1");
            assertEquals(m2.getSubject(),"new text 2");
            m.dispose();
        } catch (MessagingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
View Full Code Here

            MimeMessage m1 = ((Mail) a.get(0)).getMessage();
            MimeMessage m2 = ((Mail) a.get(1)).getMessage();
            assertNotSame(m1,m2);
            assertEquals("MYSTATE",((Mail) a.get(0)).getState());
            assertEquals("MYSTATE",((Mail) a.get(1)).getState());
            m.dispose();
        } catch (MessagingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
View Full Code Here

                                ("").getBytes())));
        MailImpl mailimpl2 = new MailImpl("name2", new MailAddress("from@test.com"),
                        recipients, mw2);
        mailRep.store(mailimpl2);
        m.dispose();
        mailimpl2.dispose();
    }

    public void testTwoSimultaneousMails() throws Exception {
        finishSetUp(m_testConfiguration);
View Full Code Here

                                        .append("using a different sender.");
                throw new MessagingException(logBuffer.toString());
            }
   
        } finally {
            newMail.dispose();
        }
       
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
        }
View Full Code Here

            // conjecture is that it has depended upon finalize to
            // call dispose.  Not in the MailImpl, which doesn't have
            // one, but even further down in the MimeMessageInputStreamSource.

            if (mail != null) {
                mail.dispose();
            }
            throw me;
        } finally {
            if (recipientCollection != null) {
                recipientCollection.clear();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.