Package com.google.protobuf

Examples of com.google.protobuf.ByteString$Output


        publishSecondBatch(batchSize, true);
    }

    @Test
    public void testUnsubscribe() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(queue),
                                  null);
        assertTrue(queue.take());
        startDelivery(topic, localSubscriberId, new TestMessageHandler(consumeQueue));
        publisher.asyncPublish(topic, getMsg(0), new TestCallback(queue), null);
View Full Code Here


        assertFalse(queue.take());
    }

    @Test
    public void testCloseSubscription() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(queue),
                                  null);
        assertTrue(queue.take());
        startDelivery(topic, localSubscriberId, new TestMessageHandler(consumeQueue));
        publisher.asyncPublish(topic, getMsg(0), new TestCallback(queue), null);
View Full Code Here

        assertFalse(consumeQueue.take());
    }

    @Test
    public void testStopDelivery() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(queue),
                                  null);
        assertTrue(queue.take());
        startDelivery(topic, localSubscriberId, new TestMessageHandler(consumeQueue));
        publisher.asyncPublish(topic, getMsg(0), new TestCallback(queue), null);
View Full Code Here

        }
    }

    @Test
    public void testConsumedMessagesInOrder() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(queue),
                                  null);
        assertTrue(queue.take());
        startDelivery(topic, localSubscriberId, new TestMessageHandler(consumeQueue));
        // Now publish some messages and verify that they are delivered in order
View Full Code Here

        }
    }

    @Test
    public void testCreateSubscriptionFailure() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(queue),
                                  null);
        assertTrue(queue.take());
        // Close the subscription asynchronously
        subscriber.asyncCloseSubscription(topic, localSubscriberId, new TestCallback(queue), null);
View Full Code Here

        assertFalse(queue.take());
    }

    @Test
    public void testCreateSubscriptionSuccess() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.CREATE, new TestCallback(queue), null);
        assertTrue(queue.take());
        startDelivery(topic, localSubscriberId, new TestMessageHandler(consumeQueue));
        int batchSize = 5;
        for (int i = 0; i < batchSize; i++) {
View Full Code Here

        }
    }

    @Test
    public void testAttachToSubscriptionFailure() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.ATTACH, new TestCallback(queue), null);
        assertFalse(queue.take());
    }
View Full Code Here

            UmbrellaHandler.sendErrorResponseToMalformedRequest(channel, request.getTxnId(),
                    "Missing stop delivery request data");
            return;
        }

        final ByteString topic = request.getTopic();
        final ByteString subscriberId = request.getStartDeliveryRequest().getSubscriberId();

        synchronized (tracker) {
            try {
                tracker.checkChannelMatches(topic, subscriberId, channel);
            } catch (PubSubException e) {
View Full Code Here

            UmbrellaHandler.sendErrorResponseToMalformedRequest(channel, request.getTxnId(),
                    "Missing start delivery request data");
            return;
        }

        final ByteString topic = request.getTopic();
        final ByteString subscriberId = request.getStartDeliveryRequest().getSubscriberId();

        synchronized (tracker) {
            // try {
            // tracker.checkChannelMatches(topic, subscriberId, channel);
            // } catch (PubSubException e) {
View Full Code Here

        List<Thread> scannerThreads = new LinkedList<Thread>();
        Thread thread;
        Semaphore latch = new Semaphore(1);

        for (int i = 0; i < NUM_TOPICS_TO_TEST; i++) {
            ByteString topic = getTopicName(i);

            if (persistenceManager instanceof TopicOwnershipChangeListener) {

                TopicOwnershipChangeListener tocl = (TopicOwnershipChangeListener) persistenceManager;
View Full Code Here

TOP

Related Classes of com.google.protobuf.ByteString$Output

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.