Examples of Mailbox


Examples of org.jvnet.mock_javamail.Mailbox

        UserCause cause = new MockUserCause("kutzi");

        FreeStyleBuild build = project.scheduleBuild2(0, cause).get();
        j.assertBuildStatusSuccess(build);

        Mailbox mailbox = Mailbox.get("kutzi@xxx.com");
        assertEquals(1, mailbox.size());

        Message msg = mailbox.get(0);
        Address[] replyTo = msg.getReplyTo();
        assertEquals(1, replyTo.length);

        assertEquals("ashlux@gmail.com", replyTo[0].toString());
    }
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

        UserCause cause = new MockUserCause("kutzi");

        FreeStyleBuild build = project.scheduleBuild2(0, cause).get();
        j.assertBuildStatusSuccess(build);

        Mailbox mailbox = Mailbox.get("kutzi@xxx.com");
        assertEquals(1, mailbox.size());

        Message msg = mailbox.get(0);
        Address[] replyTo = msg.getReplyTo();
        assertEquals(1, replyTo.length);

        assertEquals("address not configured yet <nobody@nowhere>", replyTo[0].toString());
    }
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

        return jndi;
    }

    @Test
    public void testActionCalled() throws Exception {
        Mailbox mailbox = Mailbox.get("bill@localhost");
        assertEquals(1, mailbox.size());

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("TestText");

        assertMockEndpointsSatisfied();
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

        return jndi;
    }

    @Test
    public void testSortTerm() throws Exception {
        Mailbox mailbox = Mailbox.get("bill@localhost");
        assertEquals(3, mailbox.size());

        // This one has search term *not* set
        MockEndpoint mockAsc = getMockEndpoint("mock:resultAscending");
        mockAsc.expectedBodiesReceived("Earlier date", "Later date");

View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

        stopCamel();
    }
   
    protected void runTest() throws Exception {
        // assert mailbox is empty before starting
        Mailbox inbox = Mailbox.get("incident@mycompany.com");
        inbox.clear();
        assertEquals("Should not have mails", 0, inbox.size());

        // create input parameter
        InputReportIncident input = new InputReportIncident();
        input.setIncidentId("123");
        input.setIncidentDate("2008-08-18");
        input.setGivenName("Claus");
        input.setFamilyName("Ibsen");
        input.setSummary("Bla");
        input.setDetails("Bla bla");
        input.setEmail("davsclaus@apache.org");
        input.setPhone("0045 2962 7576");

        // create the webservice client and send the request
        String url = camel.resolvePropertyPlaceholders(URL);
        ReportIncidentEndpoint client = createCXFClient(url);
        OutputReportIncident out = client.reportIncident(input);

        // assert we got a OK back
        assertEquals("0", out.getCode());

        // let some time pass to allow Camel to pickup the file and send it as an email
        Thread.sleep(3000);

        // assert mail box
        assertEquals("Should have got 1 mail", 1, inbox.size());
    }
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

    }

    @Test
    public void testRendportIncident() throws Exception {
        // assert mailbox is empty before starting
        Mailbox inbox = Mailbox.get("incident@localhost");
        inbox.clear();
        assertEquals("Should not have mails", 0, inbox.size());

        // create input parameter
        InputReportIncident input = new InputReportIncident();
        input.setIncidentId("222");
        input.setIncidentDate("2010-07-14");
        input.setGivenName("Charles");
        input.setFamilyName("Moulliard");
        input.setSummary("Bla");
        input.setDetails("Bla bla");
        input.setEmail("cmoulliard@apache.org");
        input.setPhone("0011 22 33 44");

        // create the webservice client and send the request
        String url = context.resolvePropertyPlaceholders(URL);
        ReportIncidentEndpoint client = createCXFClient(url);
        OutputReportIncident out = client.reportIncident(input);

        // assert we got a OK back
        assertEquals("0", out.getCode());

        // let some time pass to allow Camel to pickup the file and send it as an email
        Thread.sleep(3000);

        // assert mail box
        assertEquals("Should have got 1 mail", 1, inbox.size());
    }
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

        assertMailboxReceivedMessages("copy@localhost");
    }

    protected void assertMailboxReceivedMessages(String name) throws IOException, MessagingException {
        Mailbox mailbox = Mailbox.get(name);
        assertEquals(name + " should have received 1 mail", 1, mailbox.size());

        Message message = mailbox.get(0);
        assertNotNull(name + " should have received at least one mail!", message);
        logMessage(message);
    }
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

*/
public class MailFetchSizeZeroTest extends ContextTestSupport {

    public void testFetchSize() throws Exception {
        prepareMailbox();
        Mailbox mailbox = Mailbox.get("bill@localhost");
        assertEquals(5, mailbox.size());

        MockEndpoint mock = getMockEndpoint("mock:result");
        // no messages expected as we have a fetch size of zero
        mock.expectedMessageCount(0);
        // should be done within 2 seconds as no delay when started
        mock.setResultWaitTime(2000L);
        mock.assertIsSatisfied();

        assertEquals(5, mailbox.size());
    }
View Full Code Here

Examples of org.jvnet.mock_javamail.Mailbox

        assertMailboxReceivedMessages("route-test-copy@localhost");
    }

    protected void assertMailboxReceivedMessages(String name) throws IOException, MessagingException {
        Mailbox mailbox = Mailbox.get(name);
        assertEquals(name + " should have received 1 mail", 1, mailbox.size());

        Message message = mailbox.get(0);
        assertNotNull(name + " should have received at least one mail!", message);
        assertEquals("hello world!", message.getContent());
        assertEquals("camel@localhost", message.getFrom()[0].toString());
        boolean found = false;
        for (Address adr : message.getRecipients(RecipientType.TO)) {
View Full Code Here

Examples of org.mime4j.field.address.Mailbox

                 */
                AddressListField field = (AddressListField) o;
                MailboxList list = field.getAddressList().flatten();
                StringBuffer sb = new StringBuffer();
                for (int i = 0; i < list.size(); i++) {
                    Mailbox mb = list.get(i);
                    sb.append(mb.getAddressString() + "\n");
                }
                textView.setText(sb.toString());
               
            } else if (o instanceof DateTimeField) {
                Date date = ((DateTimeField) o).getDate();
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.