Package org.apache.qpid.disttest.message

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


        assertNotNull(p);
    }

    public void testConfigProvidesJmsDefaults()
    {
        CreateProducerCommand p = new ProducerConfig().createCommand("session1");
        assertEquals(Message.DEFAULT_DELIVERY_MODE, p.getDeliveryMode());
        assertEquals(Message.DEFAULT_PRIORITY, p.getPriority());
        assertEquals(Message.DEFAULT_TIME_TO_LIVE, p.getTimeToLive());
    }
View Full Code Here


                timeToLive,
                interval,
                startDelay,
                providerName);

        CreateProducerCommand command = producerConfig.createCommand("session1");

        assertEquals("session1", command.getSessionName());
        assertEquals("producer1", command.getParticipantName());
        assertEquals(destination, command.getDestinationName());
        assertEquals(numberOfMessages, command.getNumberOfMessages());
        assertEquals(batchSize, command.getBatchSize());
        assertEquals(maximumDuration, command.getMaximumDuration());

        assertEquals(DeliveryMode.NON_PERSISTENT, command.getDeliveryMode());
        assertEquals(messageSize, command.getMessageSize());
        assertEquals(priority, command.getPriority());
        assertEquals(timeToLive, command.getTimeToLive());
        assertEquals(interval, command.getInterval());
        assertEquals(startDelay, command.getStartDelay());
        assertEquals(providerName, command.getMessageProviderName());
    }
View Full Code Here

        _messageProviderName = messageProviderName;
    }

    public CreateProducerCommand createCommand(String sessionName)
    {
        CreateProducerCommand command = new CreateProducerCommand();

        setParticipantProperties(command);

        command.setSessionName(sessionName);
        command.setDeliveryMode(_deliveryMode);
        command.setMessageSize(_messageSize);
        command.setPriority(_priority);
        command.setTimeToLive(_timeToLive);
        command.setInterval(_interval);
        command.setStartDelay(_startDelay);
        command.setMessageProviderName(_messageProviderName);

        return command;
    }
View Full Code Here

        _messageProviderName = messageProviderName;
    }

    public CreateProducerCommand createCommand(String sessionName)
    {
        CreateProducerCommand command = new CreateProducerCommand();

        setParticipantProperties(command);

        command.setSessionName(sessionName);
        command.setDeliveryMode(_deliveryMode);

        Integer messageSize = (Integer)ObjectUtils.defaultIfNull(getOverriddenMessageSize(), _messageSize);

        command.setMessageSize(messageSize);
        command.setPriority(_priority);
        command.setTimeToLive(_timeToLive);
        command.setInterval(_interval);
        command.setStartDelay(_startDelay);
        command.setMessageProviderName(_messageProviderName);

        return command;
    }
View Full Code Here

        assertNotNull(p);
    }

    public void testConfigProvidesJmsDefaults()
    {
        CreateProducerCommand p = new ProducerConfig().createCommand("session1");
        assertEquals(Message.DEFAULT_DELIVERY_MODE, p.getDeliveryMode());
        assertEquals(Message.DEFAULT_PRIORITY, p.getPriority());
        assertEquals(Message.DEFAULT_TIME_TO_LIVE, p.getTimeToLive());
    }
View Full Code Here

        assertEquals(Message.DEFAULT_TIME_TO_LIVE, p.getTimeToLive());
    }

    public void testMessageSizeDefault()
    {
        CreateProducerCommand producer = new ProducerConfig().createCommand("session1");
        assertEquals("Unexpected default message size", 1024, producer.getMessageSize());
    }
View Full Code Here

    public void testMessageSizeDefaultOverride()
    {
        final long overriddenMessageSize = 4096;
        setTestSystemProperty(ProducerConfig.MESSAGE_SIZE_OVERRIDE_SYSTEM_PROPERTY, String.valueOf(overriddenMessageSize));

        CreateProducerCommand producer2 = new ProducerConfig().createCommand("session1");
        assertEquals("Unexpected message size", overriddenMessageSize, producer2.getMessageSize());
    }
View Full Code Here

                timeToLive,
                interval,
                startDelay,
                providerName);

        CreateProducerCommand command = producerConfig.createCommand("session1");

        assertEquals("session1", command.getSessionName());
        assertEquals("producer1", command.getParticipantName());
        assertEquals(destination, command.getDestinationName());
        assertEquals(numberOfMessages, command.getNumberOfMessages());
        assertEquals(batchSize, command.getBatchSize());
        assertEquals(maximumDuration, command.getMaximumDuration());

        assertEquals(DeliveryMode.NON_PERSISTENT, command.getDeliveryMode());
        assertEquals(messageSize, command.getMessageSize());
        assertEquals(priority, command.getPriority());
        assertEquals(timeToLive, command.getTimeToLive());
        assertEquals(interval, command.getInterval());
        assertEquals(startDelay, command.getStartDelay());
        assertEquals(providerName, command.getMessageProviderName());
    }
View Full Code Here

        _participantResultFactory = new ParticipantResultFactory();
    }

    public void testCreateForProducer()
    {
        CreateProducerCommand command = new CreateProducerCommand();
        setCommonCommandFields(command);

        long producerStartDelay = 30;
        command.setStartDelay(producerStartDelay);

        int deliveryMode = DeliveryMode.PERSISTENT;
        command.setDeliveryMode(deliveryMode);

        int priority = 5;
        command.setPriority(priority);

        long producerInterval = 50;
        command.setInterval(producerInterval);

        long timeToLive = 60;
        command.setTimeToLive(timeToLive);

        int totalNumberOfConsumers = 0;
        int totalNumberOfProducers = 1;

        int acknowledgeMode = 1;
View Full Code Here

        verify(_delegate).createSession(command);
    }

    public void testCreateProducer() throws Exception
    {
        final CreateProducerCommand command = new CreateProducerCommand();
        _visitor.visit(command);
        verify(_delegate).createProducer(command);
    }
View Full Code Here

TOP

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

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.