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

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


        Feed feed = listOptions(options,
                getResource().path(topicPath).path("subscriptions")).get(
                Feed.class);
        ArrayList<SubscriptionInfo> list = new ArrayList<SubscriptionInfo>();
        for (Entry entry : feed.getEntries()) {
            list.add(new SubscriptionInfo(entry));
        }
        ListSubscriptionsResult result = new ListSubscriptionsResult();
        result.setItems(list);
        return result;
    }
View Full Code Here


    public void getSubscriptionMessageCountDetails() throws Exception {
        // Arrange
        String topicName = "TestGetSubscriptionMessageCountDetails";
        String subscriptionName = "TestGetSubscriptionMessageCountDetails";
        service.createTopic(new TopicInfo(topicName)).getValue();
        service.createSubscription(topicName, new SubscriptionInfo(
                subscriptionName));
        Long expectedActiveMessageCount = 1L;
        Long expectedDeadLetterMessageCount = 0L;
        Long expectedScheduledMessageCount = 0L;
        Long expectedTransferMessageCount = 0L;
        Long expectedTransferDeadLetterMessageCount = 0L;

        // Act
        service.sendTopicMessage(topicName, new BrokeredMessage("Hello world!"));
        SubscriptionInfo subscriptionInfo = service.getSubscription(topicName,
                subscriptionName).getValue();
        MessageCountDetails countDetails = subscriptionInfo.getCountDetails();

        // Assert
        assertNotNull(subscriptionInfo);
        assertNotNull(countDetails);
        // TODO: makes the test flickery
View Full Code Here

    public void renewSubscriptionMessageLockWorks() throws Exception {
        // Arrange
        String topicName = "TestRenewSubscriptionLockMessageWorks";
        String subscriptionName = "renewSubscriptionMessageLockWorks";
        service.createTopic(new TopicInfo(topicName));
        service.createSubscription(topicName, new SubscriptionInfo(
                subscriptionName));
        service.sendTopicMessage(topicName, new BrokeredMessage("Hello Again"));

        // Act
        BrokeredMessage message = service.receiveSubscriptionMessage(topicName,
View Full Code Here

        String sourceSubscriptionName = "TestReceiveSubForwardToQueueMessageSuccessSource";
        String destinationQueueName = "TestReceiveSubForwardToQueueMessageSuccessDestination";
        service.createTopic(new TopicInfo(sourceTopicName)).getValue();
        QueueInfo destinationQueueInfo = service.createQueue(
                new QueueInfo(destinationQueueName)).getValue();
        service.createSubscription(sourceTopicName, new SubscriptionInfo(
                sourceSubscriptionName).setForwardTo(destinationQueueInfo
                .getUri().toString()));

        // Act
        service.sendTopicMessage(sourceTopicName, new BrokeredMessage(
View Full Code Here

        String sourceSubscriptionName = "TestUpdatedReceiveSubForwardToQMessageSuccessSrc";
        String destinationQueueName = "TestUpdatedReceiveSubForwardToQMessageSuccessDest";
        service.createTopic(new TopicInfo(sourceTopicName)).getValue();
        QueueInfo destinationQueueInfo = service.createQueue(
                new QueueInfo(destinationQueueName)).getValue();
        SubscriptionInfo sourceSubscriptionInfo = service.createSubscription(
                sourceTopicName, new SubscriptionInfo(sourceSubscriptionName))
                .getValue();
        service.updateSubscription(sourceTopicName, sourceSubscriptionInfo
                .setForwardTo(destinationQueueInfo.getUri().toString()));
        // Act
        service.sendTopicMessage(sourceTopicName, new BrokeredMessage(
                "Hello source queue!"));
        ReceiveQueueMessageResult receiveQueueMessageResult = service
View Full Code Here

        String destinationSubscriptionName = "TestReceiveSubForwardToTopMessageSuccessDest";
        service.createTopic(new TopicInfo(sourceTopicName)).getValue();
        TopicInfo destinationTopicInfo = service.createTopic(
                new TopicInfo(destinationTopicName)).getValue();
        service.createSubscription(destinationTopicName,
                new SubscriptionInfo(destinationSubscriptionName)).getValue();
        service.createSubscription(sourceTopicName, new SubscriptionInfo(
                sourceSubscriptionName).setForwardTo(destinationTopicInfo
                .getUri().toString()));

        // Act
        service.sendTopicMessage(sourceTopicName, new BrokeredMessage(
View Full Code Here

        String destinationSubscriptionName = "TestReceiveSubForwardToTopMessageSuccessDest";
        service.createTopic(new TopicInfo(sourceTopicName)).getValue();
        TopicInfo destinationTopicInfo = service.createTopic(
                new TopicInfo(destinationTopicName)).getValue();
        service.createSubscription(destinationTopicName,
                new SubscriptionInfo(destinationSubscriptionName)).getValue();
        SubscriptionInfo sourceSubscriptionInfo = service.createSubscription(
                sourceTopicName, new SubscriptionInfo(sourceSubscriptionName))
                .getValue();
        service.updateSubscription(sourceTopicName, sourceSubscriptionInfo
                .setForwardTo(destinationTopicInfo.getUri().toString()));
        Thread.sleep(1000);

        // Act
        service.sendTopicMessage(sourceTopicName, new BrokeredMessage(
View Full Code Here

        // Arrange
        String topicName = "TestSubscriptionsCanBeCreatedOnTopics";
        service.createTopic(new TopicInfo(topicName));

        // Act
        SubscriptionInfo created = service.createSubscription(topicName,
                new SubscriptionInfo("MySubscription")).getValue();

        // Assert
        assertNotNull(created);
        assertEquals("MySubscription", created.getName());
        assertEquals(false, created.isRequiresSession());
        assertEquals(true,
                created.isDeadLetteringOnFilterEvaluationExceptions());
        assertNotNull(created.getCreatedAt());
        assertNotNull(created.getUpdatedAt());
        assertNotNull(created.getAccessedAt());
        assertNotNull(created.getAutoDeleteOnIdle());
    }
View Full Code Here

        correlationFilter.setTo(expectedTo);
        RuleDescription ruleDescription = new RuleDescription();
        ruleDescription.setFilter(correlationFilter);

        // Act
        SubscriptionInfo created = service.createSubscription(
                topicName,
                new SubscriptionInfo("MySubscription")
                        .setDefaultRuleDescription(ruleDescription)).getValue();

        RuleInfo ruleInfo = service.getRule(topicName, "MySubscription",
                "$Default").getValue();
        CorrelationFilter correlationFilterResult = (CorrelationFilter) ruleInfo
                .getFilter();

        // Assert
        assertNotNull(created);
        assertEquals("MySubscription", created.getName());
        assertEquals(false, created.isRequiresSession());
        assertEquals(true,
                created.isDeadLetteringOnFilterEvaluationExceptions());
        assertNotNull(created.getCreatedAt());
        assertNotNull(created.getUpdatedAt());
        assertNotNull(created.getAccessedAt());
        assertNotNull(created.getAutoDeleteOnIdle());
        assertNotNull(correlationFilterResult);
        assertEquals(expectedCorrelationId,
                correlationFilterResult.getCorrelationId());
        assertEquals(expectedContentType,
                correlationFilterResult.getContentType());
View Full Code Here

    @Test
    public void subscriptionsCanBeListed() throws Exception {
        // Arrange
        String topicName = "TestSubscriptionsCanBeListed";
        service.createTopic(new TopicInfo(topicName));
        service.createSubscription(topicName, new SubscriptionInfo(
                "MySubscription2"));

        // Act
        ListSubscriptionsResult result = service.listSubscriptions(topicName);
View Full Code Here

TOP

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

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.