use of org.pentaho.di.trans.step.StepOption in project pentaho-kettle by pentaho.
the class MQTTConsumerMetaTest method testRetrieveOptions.
@Test
public void testRetrieveOptions() {
List<String> keys = Arrays.asList(KEEP_ALIVE_INTERVAL, MAX_INFLIGHT, CONNECTION_TIMEOUT, CLEAN_SESSION, STORAGE_LEVEL, SERVER_URIS, MQTT_VERSION, AUTOMATIC_RECONNECT);
MQTTConsumerMeta meta = new MQTTConsumerMeta();
meta.setDefault();
List<StepOption> options = meta.retrieveOptions();
assertEquals(8, options.size());
for (StepOption option : options) {
assertEquals("", option.getValue());
assertNotNull(option.getText());
Assert.assertTrue(keys.contains(option.getKey()));
}
}
use of org.pentaho.di.trans.step.StepOption in project pentaho-kettle by pentaho.
the class MQTTProducerMetaTest method testRetrieveOptions.
@Test
public void testRetrieveOptions() {
List<String> keys = Arrays.asList(KEEP_ALIVE_INTERVAL, MAX_INFLIGHT, CONNECTION_TIMEOUT, CLEAN_SESSION, STORAGE_LEVEL, SERVER_URIS, MQTT_VERSION, AUTOMATIC_RECONNECT);
MQTTProducerMeta meta = new MQTTProducerMeta();
meta.setDefault();
List<StepOption> options = meta.retrieveOptions();
assertEquals(8, options.size());
for (StepOption option : options) {
assertEquals("", option.getValue());
assertNotNull(option.getText());
assertTrue(keys.contains(option.getKey()));
}
}
use of org.pentaho.di.trans.step.StepOption in project pentaho-kettle by pentaho.
the class JmsProducerMetaTest method testRetriveOptions.
@Test
public void testRetriveOptions() {
List<StepOption> compareStepOptions = Arrays.asList(new StepOption(DISABLE_MESSAGE_ID, getString(JmsProducerMeta.class, "JmsDialog.Options.DISABLE_MESSAGE_ID"), "false"), new StepOption(DISABLE_MESSAGE_TIMESTAMP, getString(JmsProducerMeta.class, "JmsDialog.Options.DISABLE_MESSAGE_TIMESTAMP"), "true"), new StepOption(DELIVERY_MODE, getString(JmsProducerMeta.class, "JmsDialog.Options.DELIVERY_MODE"), "2"), new StepOption(PRIORITY, getString(JmsProducerMeta.class, "JmsDialog.Options.PRIORITY"), "3"), new StepOption(TIME_TO_LIVE, getString(JmsProducerMeta.class, "JmsDialog.Options.TIME_TO_LIVE"), "100"), new StepOption(DELIVERY_DELAY, getString(JmsProducerMeta.class, "JmsDialog.Options.DELIVERY_DELAY"), "20"), new StepOption(JMS_CORRELATION_ID, getString(JmsProducerMeta.class, "JmsDialog.Options.JMS_CORRELATION_ID"), "asdf"), new StepOption(JMS_TYPE, getString(JmsProducerMeta.class, "JmsDialog.Options.JMS_TYPE"), "myType"));
JmsProducerMeta jmsProducerMeta = new JmsProducerMeta();
jmsProducerMeta.setDisableMessageId("false");
jmsProducerMeta.setDisableMessageTimestamp("true");
jmsProducerMeta.setDeliveryMode("2");
jmsProducerMeta.setPriority("3");
jmsProducerMeta.setTimeToLive("100");
jmsProducerMeta.setDeliveryDelay("20");
jmsProducerMeta.setJmsCorrelationId("asdf");
jmsProducerMeta.setJmsType("myType");
List<StepOption> stepOptions = jmsProducerMeta.retriveOptions();
assertNotNull(stepOptions);
assertEquals(8, stepOptions.size());
assertOptions(compareStepOptions, stepOptions);
}
use of org.pentaho.di.trans.step.StepOption in project pentaho-kettle by pentaho.
the class JmsProducerMetaTest method assertOptions.
private void assertOptions(List<StepOption> expected, List<StepOption> actual) {
for (StepOption expectedOption : expected) {
boolean isFound = false;
for (StepOption actualOption : actual) {
if (expectedOption.getKey().equals(actualOption.getKey())) {
isFound = true;
assertEquals(expectedOption.getText(), actualOption.getText());
assertEquals(expectedOption.getValue(), actualOption.getValue());
break;
}
}
assertTrue(expectedOption.getKey() + " was not found", isFound);
}
}
Aggregations