Package org.apache.qpid.disttest

Examples of org.apache.qpid.disttest.DistributedTestException



    void awaitTestResults()
    {
        long timeout = _testResultTimeout;
        DistributedTestException lastException = null;

        boolean waitForever = _testResultTimeout == WAIT_FOREVER;
        final long interval = waitForever ? PARTICIPANT_RESULTS_LOG_INTERVAL : Math.min(PARTICIPANT_RESULTS_LOG_INTERVAL, _testResultTimeout);

        while(_testResultsLatch.getCount() > 0 && (waitForever || timeout > 0))
View Full Code Here


            if (!countedDownOK)
            {
                final long latchCount = latch.getCount();
                String formattedMessage = "After " + timeout + "ms ... " + message + " ... Expecting " + latchCount + " more responses.";
                LOGGER.info(formattedMessage); // info rather than error because we time out periodically so we can log progress
                throw new DistributedTestException(formattedMessage);
            }
        }
        catch (final InterruptedException e)
        {
            Thread.currentThread().interrupt();
View Full Code Here

        final Date start = new Date();
        final int acknowledgeMode = _jmsDelegate.getAcknowledgeMode(_command.getSessionName());

        if (_command.getMaximumDuration() == 0 && _command.getNumberOfMessages() == 0)
        {
            throw new DistributedTestException("number of messages and duration cannot both be zero");
        }

        if (_command.isSynchronous())
        {
            synchronousRun();
View Full Code Here

                {
                    mesageTimestamp = message.getJMSTimestamp();
                }
                catch (JMSException e)
                {
                    throw new DistributedTestException("Cannot get message timestamp!", e);
                }
                long latency = System.currentTimeMillis() - mesageTimestamp;
                _messageLatencies.add(latency);
            }
View Full Code Here

    private void rethrowAnyAsyncMessageListenerException()
    {
        if (_asyncMessageListenerException != null)
        {
            throw new DistributedTestException(_asyncMessageListenerException);
        }
    }
View Full Code Here

    public void registerClient(String clientName)
    {
        final boolean alreadyContainsClient = !_registeredClientNames.add(clientName);
        if (alreadyContainsClient)
        {
            throw new DistributedTestException("Duplicate client name " + clientName);
        }

        notifyAllWaiters();

        if (LOGGER.isInfoEnabled())
View Full Code Here

            Class<? extends QueueCreator> queueCreatorClass = (Class<? extends QueueCreator>) Class.forName(queueCreatorClassName);
            _queueCreator = queueCreatorClass.newInstance();
        }
        catch (ClassNotFoundException e)
        {
            throw new DistributedTestException("Unable to instantiate queue creator using class name " + queueCreatorClassName, e);
        }
        catch (InstantiationException e)
        {
            throw new DistributedTestException("Unable to instantiate queue creator using class name " + queueCreatorClassName, e);
        }
        catch (IllegalAccessException e)
        {
            throw new DistributedTestException("Unable to instantiate queue creator using class name " + queueCreatorClassName, e);
        }
    }
View Full Code Here

                }
            });
        }
        catch (final JMSException e)
        {
            throw new DistributedTestException(e);
        }
    }
View Full Code Here

        {
            _connection.close();
        }
        catch (JMSException e)
        {
            throw new DistributedTestException("Unable to close connection", e);
        }
    }
View Full Code Here

    public void sendCommandToClient(final String clientName, final Command command)
    {
        final Destination clientQueue = _clientNameToQueueMap.get(clientName);
        if (clientQueue == null)
        {
            throw new DistributedTestException("Client name " + clientName + " not known. I know about: "
                            + _clientNameToQueueMap.keySet());
        }

        try
        {
            final MessageProducer producer = _session.createProducer(clientQueue);
            final Message message = JmsMessageAdaptor.commandToMessage(_session, command);

            producer.send(message);
        }
        catch (final JMSException e)
        {
            throw new DistributedTestException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.disttest.DistributedTestException

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.