public class ScenarioBuilder extends Object
Scenario
instance, which can be run by ScenarioExecution
.Constructor and Description |
---|
ScenarioBuilder(RunInfo runInfo,
MessageGenerator messageGenerator,
MessageSender messageSender)
Gets a new ScenarioBuilder instance.
|
ScenarioBuilder(RunInfo runInfo,
MessageGenerator messageGenerator,
String senderClass,
Properties senderProperties)
Gets a new ScenarioBuilder instance.
|
Modifier and Type | Method and Description |
---|---|
ScenarioBuilder |
addMessage(MessageTemplate messageTemplate)
Adds a
MessageTemplate , which will be used in the Scenario |
ScenarioBuilder |
addReporter(Reporter r)
|
Scenario |
build()
Builds the usable
Scenario object, which can be then used for executing the scenario. |
ScenarioBuilder |
putMessageValidator(String validatorId,
MessageValidator messageValidator)
Puts a validator under the given key.
|
ScenarioBuilder |
putSequence(String sequenceId,
Sequence sequence)
Registers a new sequence under the given property name.
|
ScenarioBuilder |
setCorrelator(Correlator c)
Sets the correlator to match request and response messages when a receiver is used.
|
ScenarioBuilder |
setReceiver(Receiver r)
Sets the receiver to receive message responses from a separate message channel.
|
public ScenarioBuilder(RunInfo runInfo, MessageGenerator messageGenerator, MessageSender messageSender) throws PerfCakeException
runInfo
- RunInfo specifying the test run time.messageGenerator
- Message generator to be used to generate messages during test.messageSender
- Sender template which will be copied to create all sender instances. Only the bean properties with proper get methods will be set on the new sender instances.PerfCakeException
- When any of the parameters are not set or creation of the underlying classes fails.public ScenarioBuilder(RunInfo runInfo, MessageGenerator messageGenerator, String senderClass, Properties senderProperties) throws PerfCakeException
runInfo
- RunInfo specifying the test run time.messageGenerator
- Message generator to be used to generate messages during test.senderClass
- Name of the sender class, instances will be used to send message in the scenario.senderProperties
- Properties that will be set on the sender instances.PerfCakeException
- When any of the parameters are not set or creation of the underlying classes fails.public ScenarioBuilder setReceiver(Receiver r)
r
- The receiver to be used to receive responses from a separate message channel.public ScenarioBuilder setCorrelator(Correlator c)
c
- The correlator to match request and response messages.public ScenarioBuilder addReporter(Reporter r)
r
- A Reporter
implementation.public ScenarioBuilder addMessage(MessageTemplate messageTemplate)
MessageTemplate
, which will be used in the Scenario
messageTemplate
- A message template to be added to the list of messages to be send during in one sender cycle.public ScenarioBuilder putMessageValidator(String validatorId, MessageValidator messageValidator)
validatorId
- Id of the new validator.messageValidator
- The message validator to be registered.public ScenarioBuilder putSequence(String sequenceId, Sequence sequence) throws PerfCakeException
sequenceId
- The id of the sequence (the name of the placeholder).sequence
- The new sequence to be registered.PerfCakeException
- When it was not possible to properly initialize the newly added sequence.Copyright © 2010–2017 PerfCake Community. All rights reserved.