use of org.apache.qpid.disttest.client.property.SimplePropertyValue in project qpid-broker-j by apache.
the class ClientConfigTest method createClientConfigWithMessageProviderConfigReturningCommands.
private ClientConfig createClientConfigWithMessageProviderConfigReturningCommands() {
Map<String, PropertyValue> messageProperties = new HashMap<String, PropertyValue>();
messageProperties.put("test", new SimplePropertyValue("testValue"));
MessageProviderConfig config = new MessageProviderConfig("test", messageProperties);
List<MessageProviderConfig> providerConfigs = new ArrayList<MessageProviderConfig>();
providerConfigs.add(config);
return new ClientConfig(CLIENT1, new ArrayList<ConnectionConfig>(), providerConfigs);
}
use of org.apache.qpid.disttest.client.property.SimplePropertyValue in project qpid-broker-j by apache.
the class MessageProviderConfigTest method testCreateCommandsForMessageProvider.
@Test
public void testCreateCommandsForMessageProvider() {
Map<String, PropertyValue> messageProperties = new HashMap<String, PropertyValue>();
messageProperties.put("test", new SimplePropertyValue("testValue"));
MessageProviderConfig config = new MessageProviderConfig("test", messageProperties);
CreateMessageProviderCommand command = config.createCommand();
assertNotNull("Command should not be null", command);
assertNotNull("Unexpected name", command.getProviderName());
assertEquals("Unexpected properties", messageProperties, command.getMessageProperties());
}
use of org.apache.qpid.disttest.client.property.SimplePropertyValue in project qpid-broker-j by apache.
the class MessageProviderTest method testNextMessageWithProperties.
@Test
public void testNextMessageWithProperties() throws Exception {
Map<String, PropertyValue> properties = new HashMap<String, PropertyValue>();
properties.put("test1", new SimplePropertyValue("testValue1"));
properties.put("test2", new SimplePropertyValue(Integer.valueOf(1)));
properties.put("priority", new SimplePropertyValue(Integer.valueOf(2)));
List<PropertyValue> listItems = new ArrayList<PropertyValue>();
listItems.add(new SimplePropertyValue(Double.valueOf(2.0)));
ListPropertyValue list = new ListPropertyValue();
list.setItems(listItems);
properties.put("test3", list);
MessageProvider messageProvider = new MessageProvider(properties);
CreateProducerCommand command = new CreateProducerCommand();
command.setMessageSize(100);
Message message = messageProvider.nextMessage(_session, command);
assertNotNull("Mesage should be returned", message);
verify(_message, atLeastOnce()).setText(isA(String.class));
verify(_message, atLeastOnce()).setJMSPriority(2);
verify(_message, atLeastOnce()).setStringProperty("test1", "testValue1");
verify(_message, atLeastOnce()).setIntProperty("test2", 1);
verify(_message, atLeastOnce()).setDoubleProperty("test3", 2.0);
}
use of org.apache.qpid.disttest.client.property.SimplePropertyValue in project qpid-broker-j by apache.
the class MessageProviderConfigTest method testMessageProviderConfig.
@Test
public void testMessageProviderConfig() {
Map<String, PropertyValue> messageProperties = new HashMap<String, PropertyValue>();
messageProperties.put("test", new SimplePropertyValue("testValue"));
MessageProviderConfig config = new MessageProviderConfig("test", messageProperties);
assertEquals("Unexpected name", "test", config.getName());
assertEquals("Unexpected properties", messageProperties, config.getMessageProperties());
}
Aggregations