Package com.microsoft.windowsazure.services.queue.models

Examples of com.microsoft.windowsazure.services.queue.models.ListMessagesResult$QueueMessage


        // Act
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_2, "message1");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_2, "message2");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_2, "message3");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_2, "message4");
        ListMessagesResult result = service
                .listMessages(TEST_QUEUE_FOR_MESSAGES_2);

        // Assert
        assertNotNull(result);
        assertEquals(1, result.getQueueMessages().size());

        QueueMessage entry = result.getQueueMessages().get(0);

        assertNotNull(entry.getMessageId());
        assertNotNull(entry.getMessageText());
        assertNotNull(entry.getPopReceipt());
        assertEquals(1, entry.getDequeueCount());
View Full Code Here


        // Act
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_3, "message1");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_3, "message2");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_3, "message3");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_3, "message4");
        ListMessagesResult result = service.listMessages(
                TEST_QUEUE_FOR_MESSAGES_3,
                new ListMessagesOptions().setNumberOfMessages(4)
                        .setVisibilityTimeoutInSeconds(20));

        // Assert
        assertNotNull(result);
        assertEquals(4, result.getQueueMessages().size());
        for (int i = 0; i < 4; i++) {
            QueueMessage entry = result.getQueueMessages().get(i);

            assertNotNull(entry.getMessageId());
            assertNotNull(entry.getMessageText());
            assertNotNull(entry.getPopReceipt());
            assertEquals(1, entry.getDequeueCount());
View Full Code Here

        service.createMessage(TEST_QUEUE_FOR_MESSAGES_7, "message1");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_7, "message2");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_7, "message3");
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_7, "message4");

        ListMessagesResult result = service
                .listMessages(TEST_QUEUE_FOR_MESSAGES_7);
        service.deleteMessage(TEST_QUEUE_FOR_MESSAGES_7, result
                .getQueueMessages().get(0).getMessageId(), result
                .getQueueMessages().get(0).getPopReceipt());
        ListMessagesResult result2 = service.listMessages(
                TEST_QUEUE_FOR_MESSAGES_7,
                new ListMessagesOptions().setNumberOfMessages(32));

        // Assert
        assertNotNull(result2);
        assertEquals(3, result2.getQueueMessages().size());
    }
View Full Code Here

        Date year2010 = calendar.getTime();

        // Act
        service.createMessage(TEST_QUEUE_FOR_MESSAGES_8, "message1");

        ListMessagesResult listResult1 = service
                .listMessages(TEST_QUEUE_FOR_MESSAGES_8);
        UpdateMessageResult updateResult = service.updateMessage(
                TEST_QUEUE_FOR_MESSAGES_8, listResult1.getQueueMessages()
                        .get(0).getMessageId(), listResult1.getQueueMessages()
                        .get(0).getPopReceipt(), "new text", 0);
        ListMessagesResult listResult2 = service
                .listMessages(TEST_QUEUE_FOR_MESSAGES_8);

        // Assert
        assertNotNull(updateResult);
        assertNotNull(updateResult.getPopReceipt());
        assertNotNull(updateResult.getTimeNextVisible());
        assertTrue(year2010.before(updateResult.getTimeNextVisible()));

        assertNotNull(listResult2);
        QueueMessage entry = listResult2.getQueueMessages().get(0);

        assertEquals(listResult1.getQueueMessages().get(0).getMessageId(),
                entry.getMessageId());
        assertEquals("new text", entry.getMessageText());
        assertNotNull(entry.getPopReceipt());
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.queue.models.ListMessagesResult$QueueMessage

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.