Package com.microsoft.windowsazure.services.servicebus.models

Examples of com.microsoft.windowsazure.services.servicebus.models.QueueInfo


            throws ServiceException {
        Feed feed = listOptions(options,
                getResource().path("$Resources/Queues")).get(Feed.class);
        ArrayList<QueueInfo> queues = new ArrayList<QueueInfo>();
        for (Entry entry : feed.getEntries()) {
            queues.add(new QueueInfo(entry));
        }
        ListQueuesResult result = new ListQueuesResult();
        result.setItems(queues);
        return result;
    }
View Full Code Here


    @Test
    public void fetchQueueAndListQueuesWorks() throws Exception {
        // Arrange

        // Act
        QueueInfo entry = service.getQueue("TestAlpha").getValue();
        ListQueuesResult feed = service.listQueues();

        // Assert
        assertNotNull(entry);
        assertNotNull(feed);
View Full Code Here

    @Test
    public void createQueueWorks() throws Exception {
        // Arrange

        // Act
        QueueInfo queue = new QueueInfo("TestCreateQueueWorks")
                .setMaxSizeInMegabytes(1024L);
        QueueInfo saved = service.createQueue(queue).getValue();

        // Assert
        assertNotNull(saved);
        assertNotSame(queue, saved);
        assertEquals(false, saved.isDeadLetteringOnMessageExpiration());
        assertEquals(false, saved.isAnonymousAccessible());
        assertNotNull(saved.getAutoDeleteOnIdle());
        assertEquals(true, saved.isSupportOrdering());
        assertEquals("TestCreateQueueWorks", saved.getPath());
    }
View Full Code Here

    }

    @Test
    public void updateQueueWorks() throws Exception {
        // Arrange
        QueueInfo queue = new QueueInfo("TestUpdateQueueWorks")
                .setMaxSizeInMegabytes(1024L);
        QueueInfo originalQueue = service.createQueue(queue).getValue();
        Long expectedMaxSizeInMegaBytes = 512L;

        // Act
        QueueInfo updatedQueue = service.updateQueue(originalQueue
                .setMaxSizeInMegabytes(512L));

        // Assert
        assertEquals(expectedMaxSizeInMegaBytes,
                updatedQueue.getMaxSizeInMegabytes());
    }
View Full Code Here

    @Test
    public void getQueueWorks() throws Exception {
        // Arrange
        String queuePath = "TestGetQueueWorks";
        service.createQueue(new QueueInfo(queuePath));

        // Act
        GetQueueResult getQueueResult = service.getQueue(queuePath);

        // Assert
View Full Code Here

    }

    @Test
    public void deleteQueueWorks() throws Exception {
        // Arrange
        service.createQueue(new QueueInfo("TestDeleteQueueWorks"));

        // Act
        service.deleteQueue("TestDeleteQueueWorks");

        // Assert
View Full Code Here

    @Test
    public void getQueueMessageCountDetails() throws Exception {
        // Arrange
        String queueName = "testGetQueueMessageCountDetails";
        service.createQueue(new QueueInfo(queueName));
        service.sendQueueMessage(queueName, new BrokeredMessage("Hello World"));
        Long expectedActiveMessageCount = 1L;
        Long expectedDeadLetterMessageCount = 0L;
        Long expectedScheduledMessageCount = 0L;
        Long expectedTransferMessageCount = 0L;
        Long expectedTransferDeadLetterMessageCount = 0L;

        // Act
        QueueInfo queueInfo = service.getQueue(queueName).getValue();
        MessageCountDetails countDetails = queueInfo.getCountDetails();

        // Assert
        assertEquals(true, queueInfo.isSupportOrdering());
        assertNotNull(countDetails);
        assertEquals(expectedActiveMessageCount,
                countDetails.getActiveMessageCount());
        assertEquals(expectedDeadLetterMessageCount,
                countDetails.getDeadLetterMessageCount());
View Full Code Here

    @Test
    public void receiveMessageWorks() throws Exception {
        // Arrange
        String queueName = "TestReceiveMessageWorks";
        service.createQueue(new QueueInfo(queueName));
        service.sendQueueMessage(queueName, new BrokeredMessage("Hello World"));

        // Act
        BrokeredMessage message = service.receiveQueueMessage(queueName,
                RECEIVE_AND_DELETE_5_SECONDS).getValue();
View Full Code Here

    @Test
    public void receiveLargeMessageWorks() throws Exception {
        // Arrange
        String queueName = "TestReceiveLargeMessageWorks";
        service.createQueue(new QueueInfo(queueName));
        String expectedBody = createLongString(64000);
        BrokeredMessage expectedMessage = new BrokeredMessage(expectedBody);
        service.sendQueueMessage(queueName, expectedMessage);

        // Act
View Full Code Here

    @Test
    public void renewQueueMessageLockWorks() throws Exception {
        // Arrange
        String queueName = "TestRenewSubscriptionLockMessageWorks";
        service.createQueue(new QueueInfo(queueName));
        service.sendQueueMessage(queueName, new BrokeredMessage("Hello Again"));

        // Act
        BrokeredMessage message = service.receiveQueueMessage(queueName,
                PEEK_LOCK_5_SECONDS).getValue();
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.servicebus.models.QueueInfo

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.