/** * The list of alarm names to retrieve information for. * * @param alarmNames the alarm names * * @return this {@code ListAlarmsOptions} object */ public ListAlarmsOptions alarmNames(Set<String> alarmNames) { for (String alarmName : checkNotNull(alarmNames, "alarmNames")) { alarmName(alarmName); } return this; }
public void testPopulatedOptions() throws Exception { String actionPrefix = "TestActionPrefix"; String alarmNamePrefix = "TestAlarmNamePrefix"; Set<String> alarmNames = ImmutableSet.of( "TestAlarmName1", "TestAlarmName2" ); int maxRecords = 5; Alarm.State state = Alarm.State.ALARM; int alarmNameIndex = 1; Multimap<String, String> formParameters = new ListAlarmsOptions() .actionPrefix(actionPrefix) .alarmNamePrefix(alarmNamePrefix) .alarmNames(alarmNames) .maxRecords(maxRecords) .state(state) .buildFormParameters(); assertEquals(formParameters.get("ActionPrefix"), ImmutableSet.of(actionPrefix)); assertEquals(formParameters.get("AlarmNamePrefix"), ImmutableSet.of(alarmNamePrefix)); assertEquals(formParameters.get("MaxRecords"), ImmutableSet.of(Integer.toString(maxRecords))); assertEquals(formParameters.get("StateValue"), ImmutableSet.of(state.toString())); for (String alarmName : alarmNames) { assertEquals(formParameters.get("AlarmNames.member." + alarmNameIndex), ImmutableSet.of(alarmName)); alarmNameIndex++; } }
@AfterClass protected void afterClass() throws Exception { IterableWithMarker<Alarm> alarms = api().list(new ListAlarmsOptions().alarmName(alarmName)).get(0); if (Iterables.size(alarms) > 0) { api().delete(ImmutableSet.of(alarmName)); } }
public void testEmptyOptions() throws Exception { Multimap<String, String> formParameters = new ListAlarmsOptions().buildFormParameters(); assertFalse(formParameters.containsKey("ActionPrefix")); assertFalse(formParameters.containsKey("AlarmNamePrefix")); assertFalse(formParameters.containsKey("AlarmNames.member.1")); assertFalse(formParameters.containsKey("MaxRecords")); assertFalse(formParameters.containsKey("NextToken")); assertFalse(formParameters.containsKey("StateValue")); }
public void testPopulatedOptions() throws Exception { String actionPrefix = "TestActionPrefix"; String alarmNamePrefix = "TestAlarmNamePrefix"; Set<String> alarmNames = ImmutableSet.of( "TestAlarmName1", "TestAlarmName2" ); int maxRecords = 5; Alarm.State state = Alarm.State.ALARM; int alarmNameIndex = 1; Multimap<String, String> formParameters = new ListAlarmsOptions() .actionPrefix(actionPrefix) .alarmNamePrefix(alarmNamePrefix) .alarmNames(alarmNames) .maxRecords(maxRecords) .state(state) .buildFormParameters(); assertEquals(formParameters.get("ActionPrefix"), ImmutableSet.of(actionPrefix)); assertEquals(formParameters.get("AlarmNamePrefix"), ImmutableSet.of(alarmNamePrefix)); assertEquals(formParameters.get("MaxRecords"), ImmutableSet.of(Integer.toString(maxRecords))); assertEquals(formParameters.get("StateValue"), ImmutableSet.of(state.toString())); for (String alarmName : alarmNames) { assertEquals(formParameters.get("AlarmNames.member." + alarmNameIndex), ImmutableSet.of(alarmName)); alarmNameIndex++; } }
@AfterClass protected void afterClass() throws Exception { IterableWithMarker<Alarm> alarms = api().list(new ListAlarmsOptions().alarmName(alarmName)).get(0); if (!Iterables.isEmpty(alarms)) { api().delete(ImmutableSet.of(alarmName)); } }
public void testEmptyOptions() throws Exception { Multimap<String, String> formParameters = new ListAlarmsOptions().buildFormParameters(); assertFalse(formParameters.containsKey("ActionPrefix")); assertFalse(formParameters.containsKey("AlarmNamePrefix")); assertFalse(formParameters.containsKey("AlarmNames.member.1")); assertFalse(formParameters.containsKey("MaxRecords")); assertFalse(formParameters.containsKey("NextToken")); assertFalse(formParameters.containsKey("StateValue")); }
.list(new ListAlarmsOptions() .actionPrefix(actionPrefix) .alarmNamePrefix(alarmNamePrefix) .alarmNames(alarmNames) .maxRecords(maxRecords) .state(state) ).get(0).toString());
ListAlarmsOptions dmo = new ListAlarmsOptions().alarmName(alarmName); boolean success = retry(new Predicate<ListAlarmsOptions>() { public boolean apply(ListAlarmsOptions options) {
/** * The list of alarm names to retrieve information for. * * @param alarmNames the alarm names * * @return this {@code ListAlarmsOptions} object */ public ListAlarmsOptions alarmNames(Set<String> alarmNames) { for (String alarmName : checkNotNull(alarmNames, "alarmNames")) { alarmName(alarmName); } return this; }
.list(new ListAlarmsOptions() .actionPrefix(actionPrefix) .alarmNamePrefix(alarmNamePrefix) .alarmNames(alarmNames) .maxRecords(maxRecords) .state(state) ).get(0).toString());
ListAlarmsOptions dmo = new ListAlarmsOptions().alarmName(alarmName); boolean success = retry(new Predicate<ListAlarmsOptions>() { public boolean apply(ListAlarmsOptions options) {
/** * The list of alarm names to retrieve information for. * * @param alarmNames the alarm names * * @return this {@code ListAlarmsOptions} object */ public ListAlarmsOptions alarmNames(Set<String> alarmNames) { for (String alarmName : checkNotNull(alarmNames, "alarmNames")) { alarmName(alarmName); } return this; }
/** * The list of alarm names to retrieve information for. * * @param alarmNames the alarm names * * @return this {@code ListAlarmsOptions} object */ public ListAlarmsOptions alarmNames(Set<String> alarmNames) { for (String alarmName : checkNotNull(alarmNames, "alarmNames")) { alarmName(alarmName); } return this; }
/** * The list of alarm names to retrieve information for. * * @param alarmNames the alarm names * * @return this {@code ListAlarmsOptions} object */ public ListAlarmsOptions alarmNames(Set<String> alarmNames) { for (String alarmName : checkNotNull(alarmNames, "alarmNames")) { alarmName(alarmName); } return this; }
/** * The list of alarm names to retrieve information for. * * @param alarmNames the alarm names * * @return this {@code ListAlarmsOptions} object */ public ListAlarmsOptions alarmNames(Set<String> alarmNames) { for (String alarmName : checkNotNull(alarmNames, "alarmNames")) { alarmName(alarmName); } return this; }