Examples of ByteString


Examples of com.google.protobuf.ByteString

        assertTrue(queue.take());
    }

    @Test
    public void testSubscribeAndConsume() throws Exception {
        ByteString topic = ByteString.copyFromUtf8("myConsumeTopic");
        ByteString subscriberId = ByteString.copyFromUtf8("1");
        subscriber.asyncSubscribe(topic, subscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(), null);
        assertTrue(queue.take());

        // Start delivery for the subscriber
        subscriber.startDelivery(topic, subscriberId, new TestMessageHandler());
View Full Code Here

Examples of com.google.protobuf.ByteString

    }

    @Test
    public void testBasics() throws Exception {

        ByteString topic1 = ByteString.copyFromUtf8("topic1");
        ByteString sub1 = ByteString.copyFromUtf8("sub1");

        //
        // No topics acquired.
        //
        SubscribeRequest subRequest = SubscribeRequest.newBuilder().setSubscriberId(sub1).build();
View Full Code Here

Examples of com.google.protobuf.ByteString

            }

        });
        Subscriber mySubscriber = myClient.getSubscriber();
        Publisher myPublisher = myClient.getPublisher();
        ByteString myTopic = getTopic(0);
        // Subscribe to a topic and start delivery on it
        mySubscriber.asyncSubscribe(myTopic, localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH,
                                    new TestCallback(queue), null);
        assertTrue(queue.take());
        startDelivery(mySubscriber, myTopic, localSubscriberId, new TestMessageHandler(consumeQueue));
View Full Code Here

Examples of com.google.protobuf.ByteString

        myClient.close();
    }

    @Test
    public void testAttachToSubscriptionSuccess() 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

Examples of com.google.protobuf.ByteString

        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

Examples of com.google.protobuf.ByteString

        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

Examples of com.google.protobuf.ByteString

        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

Examples of com.google.protobuf.ByteString

        }
    }

    @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

Examples of com.google.protobuf.ByteString

        }
    }

    @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

Examples of com.google.protobuf.ByteString

        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
TOP
Copyright © 2018 www.massapi.com. 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.