Package org.apache.qpid.disttest.message

Examples of org.apache.qpid.disttest.message.CreateConsumerCommand


        _synchronous = synchronous;
    }

    public CreateConsumerCommand createCommand(String sessionName)
    {
        CreateConsumerCommand createConsumerCommand = new CreateConsumerCommand();

        setParticipantProperties(createConsumerCommand);

        createConsumerCommand.setSessionName(sessionName);
        createConsumerCommand.setTopic(_isTopic);
        createConsumerCommand.setDurableSubscription(_isDurableSubscription);
        createConsumerCommand.setBrowsingSubscription(_isBrowsingSubscription);
        createConsumerCommand.setSelector(_selector);
        createConsumerCommand.setNoLocal(_noLocal);
        createConsumerCommand.setSynchronous(_synchronous);
        createConsumerCommand.setEvaluateLatency(_evaluateLatency);

        return createConsumerCommand;
    }
View Full Code Here


        createTestProducer(sessionName, producerName, destinationName, true);
    }

    private void createTestConsumer(String sessionName, String consumerName, String destinationName, boolean shouldSucceed) throws Exception
    {
        final CreateConsumerCommand createConsumerCommand = new CreateConsumerCommand();
        createConsumerCommand.setSessionName(sessionName);
        createConsumerCommand.setDestinationName(destinationName);
        createConsumerCommand.setParticipantName(consumerName);
        createConsumerCommand.setNumberOfMessages(1);

        sendCommandAndValidateResponse(createConsumerCommand, shouldSucceed);
    }
View Full Code Here

        runTest(Session.AUTO_ACKNOWLEDGE, 10, 0, false);
    }

    public void testSelectors() throws Exception
    {
        final CreateConsumerCommand command = new CreateConsumerCommand();
        command.setNumberOfMessages(10);
        command.setSessionName("testSession");
        command.setDestinationName(getTestQueueName());
        command.setSelector("id=1");
        Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        _delegate.addConnection("name-does-not-matter", _connection);
        _delegate.addSession(command.getSessionName(), session);

        ConsumerParticipant consumerParticipant =  new ConsumerParticipant(_delegate, command);
        _delegate.createConsumer(command);

        for (int i = 0; i < 20; i++)
View Full Code Here

        _connection.stop();
    }

    protected void runTest(int acknowledgeMode, int numberOfMessages, int batchSize, boolean synchronous) throws Exception
    {
        final CreateConsumerCommand command = new CreateConsumerCommand();
        command.setNumberOfMessages(numberOfMessages);
        command.setBatchSize(batchSize);
        command.setSessionName("testSession");
        command.setDestinationName(getTestQueueName());
        command.setSynchronous(synchronous);

        Session session = _connection.createSession(Session.SESSION_TRANSACTED == acknowledgeMode, acknowledgeMode);

        _delegate.addConnection("name-does-not-matter", _connection);
        _delegate.addSession(command.getSessionName(), session);

        ConsumerParticipant consumerParticipant =  new ConsumerParticipant(_delegate, command);
        _delegate.createConsumer(command);

        for (int i = 0; i < numberOfMessages; i++)
View Full Code Here

        verify(_delegate).createProducer(command);
    }

    public void testCreateConsumer() throws Exception
    {
        final CreateConsumerCommand command = new CreateConsumerCommand();
        _visitor.visit(command);
        verify(_delegate).createConsumer(command);
    }
View Full Code Here

        assertEquals(totalNumberOfProducers, result.getTotalNumberOfProducers());
    }

    public void testCreateForConsumer()
    {
        CreateConsumerCommand command = new CreateConsumerCommand();
        setCommonCommandFields(command);

        boolean topic = true;
        command.setTopic(topic);

        boolean durable = true;
        command.setDurableSubscription(durable);

        boolean browsingSubscription = false;
        command.setBrowsingSubscription(browsingSubscription);

        String selector = "selector";
        boolean isSelector = true;
        command.setSelector(selector);

        boolean noLocal = false;
        command.setNoLocal(noLocal);

        boolean synchronousConsumer = true;
        command.setSynchronous(synchronousConsumer);

        int totalNumberOfConsumers = 1;
        int totalNumberOfProducers = 0;

        int acknowledgeMode = 2;
View Full Code Here

            isBrowsingSubscription,
            selector,
            noLocal,
            isSynchronousNonDefault);

        CreateConsumerCommand createConsumerCommand = consumerConfig.createCommand(sessionName);

        assertEquals(sessionName, createConsumerCommand.getSessionName());
        assertEquals(consumerName, createConsumerCommand.getParticipantName());
        assertEquals(destinationName, createConsumerCommand.getDestinationName());
        assertEquals(numberOfMessages, createConsumerCommand.getNumberOfMessages());
        assertEquals(batchSize, createConsumerCommand.getBatchSize());
        assertEquals(maximumDuration, createConsumerCommand.getMaximumDuration());

        assertEquals(isTopic, createConsumerCommand.isTopic());
        assertEquals(isDurableSubscription, createConsumerCommand.isDurableSubscription());
        assertEquals(isBrowsingSubscription, createConsumerCommand.isBrowsingSubscription());
        assertEquals(selector, createConsumerCommand.getSelector());
        assertEquals(noLocal, createConsumerCommand.isNoLocal());
        assertEquals(isSynchronousNonDefault, createConsumerCommand.isSynchronous());
    }
View Full Code Here

        _synchronous = synchronous;
    }

    public CreateConsumerCommand createCommand(String sessionName)
    {
        CreateConsumerCommand createConsumerCommand = new CreateConsumerCommand();

        setParticipantProperties(createConsumerCommand);

        createConsumerCommand.setSessionName(sessionName);
        createConsumerCommand.setDurableSubscription(_isDurableSubscription);
        createConsumerCommand.setBrowsingSubscription(_isBrowsingSubscription);
        createConsumerCommand.setSelector(_selector);
        createConsumerCommand.setNoLocal(_noLocal);
        createConsumerCommand.setSynchronous(_synchronous);
        createConsumerCommand.setEvaluateLatency(_evaluateLatency);

        return createConsumerCommand;
    }
View Full Code Here

        assertEquals(totalNumberOfProducers, result.getTotalNumberOfProducers());
    }

    public void testCreateForConsumer()
    {
        CreateConsumerCommand command = new CreateConsumerCommand();
        setCommonCommandFields(command);

        boolean topic = true;
        command.setTopic(topic);

        boolean durable = true;
        command.setDurableSubscription(durable);

        boolean browsingSubscription = false;
        command.setBrowsingSubscription(browsingSubscription);

        String selector = "selector";
        boolean isSelector = true;
        command.setSelector(selector);

        boolean noLocal = false;
        command.setNoLocal(noLocal);

        boolean synchronousConsumer = true;
        command.setSynchronous(synchronousConsumer);

        int totalNumberOfConsumers = 1;
        int totalNumberOfProducers = 0;

        int acknowledgeMode = 2;
View Full Code Here

        verify(_delegate).createProducer(command);
    }

    public void testCreateConsumer() throws Exception
    {
        final CreateConsumerCommand command = new CreateConsumerCommand();
        _visitor.visit(command);
        verify(_delegate).createConsumer(command);
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.message.CreateConsumerCommand

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.