Package com.volantis.mps.bms

Examples of com.volantis.mps.bms.Recipient


        SendRequest request = parser.readSendRequest(in);

        assertEquals(1, request.getRecipients().length);

        Recipient recipient = request.getRecipients()[0];
        assertEquals("alice@volantis.com", recipient.getAddress().getValue());
        assertEquals("smtp", recipient.getChannel());
        assertEquals("Nokia-6600", recipient.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, recipient.getRecipientType());

        assertEquals("Hello", request.getMessage().getSubject());
        assertEquals(new URL("http://localhost:8080/volantis/welcome/welcome.xdime"),
                request.getMessage().getURL());
View Full Code Here


    public void testSendRequestBasicSerialization() throws Exception {

        MessageFactory factory = MessageFactory.getDefaultInstance();

        Address address = factory.createSMTPAddress("alice@volantis.com");
        Recipient alice = factory.createRecipient(address, "Nokia-6600");
        alice.setChannel("smtp");

        SendRequest request = factory.createSendRequest();
        request.addRecipient(alice);

        Message message = factory.createMessage(
View Full Code Here

                SEND_REQUEST_BASIC_EMBEDDED_CONTENT.getBytes(UTF_8));
        SendRequest request = parser.readSendRequest(in);

        assertEquals(1, request.getRecipients().length);

        Recipient recipient = request.getRecipients()[0];
        assertEquals("alice@volantis.com", recipient.getAddress().getValue());
        assertEquals("smtp", recipient.getChannel());
        assertEquals("Nokia-6600", recipient.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, recipient.getRecipientType());

        assertEquals(MESSAGE,
                request.getMessage().getContent());

        assertNotNull("default sender", request.getSender());
View Full Code Here

            throws Exception {

        MessageFactory factory = MessageFactory.getDefaultInstance();

        Address address = factory.createSMTPAddress("alice@volantis.com");
        Recipient alice = factory.createRecipient(address, "Nokia-6600");
        alice.setChannel("smtp");

        SendRequest request = factory.createSendRequest();
        request.addRecipient(alice);

        Message message = factory.createMessage(MESSAGE);
View Full Code Here

        final Recipient[] recipients = request.getRecipients();

        assertEquals(4, recipients.length);

        Recipient alice = recipients[0];
        assertEquals("alice@volantis.com", alice.getAddress().getValue());
        assertEquals("smtp", alice.getChannel());
        assertEquals("Nokia-6600", alice.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, alice.getRecipientType());

        Recipient bob = recipients[1];
        assertEquals("bob@volantis.com", bob.getAddress().getValue());
        assertEquals("smtp", bob.getChannel());
        assertEquals("Nokia-6800", bob.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, bob.getRecipientType());

        Recipient carol = recipients[2];
        assertEquals("carol@volantis.com", carol.getAddress().getValue());
        assertEquals("smtp", carol.getChannel());
        assertEquals("SonyEriccson-973i", carol.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, carol.getRecipientType());

        Recipient dave = recipients[3];
        assertEquals("dave@volantis.com", dave.getAddress().getValue());
        assertEquals("smtp", dave.getChannel());
        assertEquals("Samsung-D700", dave.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, dave.getRecipientType());

        assertEquals("Goodbye", request.getMessage().getSubject());
        assertEquals(new URL("http://some.host.com:6000/volantis/welcome/welcome.xdime"),
                request.getMessage().getURL());
View Full Code Here

        final Recipient[] recipients = request.getRecipients();

        assertEquals(1, recipients.length);

        Recipient alice = recipients[0];
        assertEquals("alice@volantis.com", alice.getAddress().getValue());
        assertEquals("smtp", alice.getChannel());
        assertEquals("Nokia-6600", alice.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, alice.getRecipientType());

        assertEquals("Hello", request.getMessage().getSubject());
        assertEquals(new URL("http://localhost:8080/volantis/welcome/welcome.xdime"),
                request.getMessage().getURL());
View Full Code Here

        final Recipient[] recipients = request.getRecipients();

        assertEquals(4, recipients.length);

        Recipient alice = recipients[0];
        assertEquals("alice@volantis.com", alice.getAddress().getValue());
        assertEquals("smtp", alice.getChannel());
        assertEquals("Nokia-6600", alice.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, alice.getRecipientType());

        Recipient bob = recipients[1];
        assertEquals("bob@volantis.com", bob.getAddress().getValue());
        assertEquals("smtp", bob.getChannel());
        assertEquals("Nokia-6800", bob.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, bob.getRecipientType());

        Recipient carol = recipients[2];
        assertEquals("carol@volantis.com", carol.getAddress().getValue());
        assertEquals("smtp", carol.getChannel());
        assertEquals("SonyEriccson-973i", carol.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, carol.getRecipientType());

        Recipient dave = recipients[3];
        assertEquals("dave@volantis.com", dave.getAddress().getValue());
        assertEquals("smtp", dave.getChannel());
        assertEquals("Samsung-D700", dave.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, dave.getRecipientType());

        assertEquals("Goodbye", request.getMessage().getSubject());
        assertEquals(new URL("http://some.host.com:6000/volantis/welcome/welcome.xdime"),
                request.getMessage().getURL());
View Full Code Here

        Failures failures = parser.readFailures(in);
        assertEquals(3, failures.getRecipients().length);

        final Recipient[] recipients = failures.getRecipients();

        Recipient alice = recipients[0];
        assertEquals("alice@volantis.com", alice.getAddress().getValue());
        assertEquals("smtp", alice.getChannel());
        assertEquals("Nokia-6600", alice.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, alice.getRecipientType());

        Recipient bob = recipients[1];
        assertEquals("bob@volantis.com", bob.getAddress().getValue());
        assertEquals("smtp", bob.getChannel());
        assertEquals("Nokia-6800", bob.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, bob.getRecipientType());

        Recipient dave = recipients[2];
        assertEquals("dave@volantis.com", dave.getAddress().getValue());
        assertEquals("smtp", dave.getChannel());
        assertEquals("Samsung-D700", dave.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, dave.getRecipientType());
    }
View Full Code Here

    public void testBasicFailuresSerialization() throws Exception {
        MessageFactory factory = MessageFactory.getDefaultInstance();

        Address address = factory.createSMTPAddress("alice@volantis.com");
        Recipient recipient = factory.createRecipient(address, "Nokia-6600");
        recipient.setChannel("smtp");

        Failures failures = factory.createFailures();

        failures.add(recipient);

        address = factory.createSMTPAddress("bob@volantis.com");
        recipient = factory.createRecipient(address, "Nokia-6800");
        recipient.setChannel("smtp");

        failures.add(recipient);

        address = factory.createSMTPAddress("dave@volantis.com");
        recipient = factory.createRecipient(address, "Samsung-D700");
        recipient.setChannel("smtp");

        failures.add(recipient);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        parser.write(failures, out);
View Full Code Here

        Failures failures = parser.readFailures(in);
        assertEquals(3, failures.getRecipients().length);

        final Recipient[] recipients = failures.getRecipients();

        Recipient alice = recipients[0];
        assertEquals("alice@volantis.com", alice.getAddress().getValue());
        assertEquals("smtp", alice.getChannel());
        assertEquals("Nokia-6600", alice.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, alice.getRecipientType());

        Recipient bob = recipients[1];
        assertEquals("bob@volantis.com", bob.getAddress().getValue());
        assertEquals("smtp", bob.getChannel());
        assertEquals("Nokia-6800", bob.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, bob.getRecipientType());

        Recipient dave = recipients[2];
        assertEquals("dave@volantis.com", dave.getAddress().getValue());
        assertEquals("smtp", dave.getChannel());
        assertEquals("Samsung-D700", dave.getDeviceName());
        assertEquals("Default type has been assigned",
                RecipientType.TO, dave.getRecipientType());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        parser.write(failures, out);

        assertXMLEqual(FAILURES_BASIC, out.toString(UTF_8));
View Full Code Here

TOP

Related Classes of com.volantis.mps.bms.Recipient

Copyright © 2018 www.massapicom. 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.