Tabnine Logo
ListAlarmHistoryResponseHandlerTest
Code IndexAdd Tabnine to your IDE (free)

How to use
ListAlarmHistoryResponseHandlerTest
in
org.jclouds.cloudwatch.xml

Best Java code snippets using org.jclouds.cloudwatch.xml.ListAlarmHistoryResponseHandlerTest (Showing top 4 results out of 315)

origin: jclouds/legacy-jclouds

/**
* Tests parsing all possible XML elements that could be encountered by {@link ListAlarmHistoryResponseHandler}.
*
* @throws Exception if something goes wrong
*/
public void testParseFullResponse() throws Exception {
 IterableWithMarker<AlarmHistoryItem> alarmHistoryItems =
    factory.create(injector.getInstance(ListAlarmHistoryResponseHandler.class))
        .parse(getClass().getResourceAsStream("/DescribeAlarmHistoryResponse.xml"));
 assertEquals(alarmHistoryItems.toString(), expected().toString());
 assertFalse(alarmHistoryItems.nextMarker().isPresent());
}
origin: jclouds/legacy-jclouds

public void testDescribeAlarmHistory() throws Exception {
 String alarmName = "TestAlarmName";
 HistoryItemType historyItemType = HistoryItemType.ACTION;
 int maxRecords = 10;
 String endDateStr = "2013-01-02T00:00:00.000Z";
 String startDateStr = "2013-01-01T00:00:00.000Z";
 CloudWatchApi cloudWatchApi = requestSendsResponse(
    alarmRequest(ImmutableMap.<String, String> builder()
                 .put("Action", "DescribeAlarmHistory")
                 .put("AlarmName", alarmName)
                 .put("EndDate", "2013-01-02T00%3A00%3A00.000Z")
                 .put("HistoryItemType", historyItemType.toString())
                 .put("MaxRecords", Integer.toString(maxRecords))
                 .put("StartDate", "2013-01-01T00%3A00%3A00.000Z")
                 .put("Signature", "O2u9yIQvCuVpKdUeUDJcswri0YD0sD4%2B/SR5TtYbPeQ%3D")
                 .build()),
    HttpResponse.builder()
          .statusCode(200)
          .payload(payloadFromResourceWithContentType("/DescribeAlarmHistoryResponse.xml", "text/xml"))
          .build());
 assertEquals(new ListAlarmHistoryResponseHandlerTest().expected().toString(),
        cloudWatchApi.getAlarmApiForRegion(null)
              .listHistory(new ListAlarmHistoryOptions()
                        .alarmName("TestAlarmName")
                        .endDate(dateService.iso8601DateParse(endDateStr))
                        .historyItemType(HistoryItemType.ACTION)
                        .maxRecords(maxRecords)
                        .startDate(dateService.iso8601DateParse(startDateStr))
              ).get(0).toString());
}
origin: apache/jclouds

public void testDescribeAlarmHistory() throws Exception {
 String alarmName = "TestAlarmName";
 HistoryItemType historyItemType = HistoryItemType.ACTION;
 int maxRecords = 10;
 String endDateStr = "2013-01-02T00:00:00.000Z";
 String startDateStr = "2013-01-01T00:00:00.000Z";
 CloudWatchApi cloudWatchApi = requestSendsResponse(
    alarmRequest(ImmutableMap.<String, String> builder()
                 .put("Action", "DescribeAlarmHistory")
                 .put("AlarmName", alarmName)
                 .put("EndDate", "2013-01-02T00%3A00%3A00.000Z")
                 .put("HistoryItemType", historyItemType.toString())
                 .put("MaxRecords", Integer.toString(maxRecords))
                 .put("StartDate", "2013-01-01T00%3A00%3A00.000Z")
                 .put("Signature", "O2u9yIQvCuVpKdUeUDJcswri0YD0sD4%2B/SR5TtYbPeQ%3D")
                 .build()),
    HttpResponse.builder()
          .statusCode(200)
          .payload(payloadFromResourceWithContentType("/DescribeAlarmHistoryResponse.xml", "text/xml"))
          .build());
 assertEquals(new ListAlarmHistoryResponseHandlerTest().expected().toString(),
        cloudWatchApi.getAlarmApiForRegion(null)
              .listHistory(new ListAlarmHistoryOptions()
                        .alarmName("TestAlarmName")
                        .endDate(dateService.iso8601DateParse(endDateStr))
                        .historyItemType(HistoryItemType.ACTION)
                        .maxRecords(maxRecords)
                        .startDate(dateService.iso8601DateParse(startDateStr))
              ).get(0).toString());
}
origin: apache/jclouds

/**
* Tests parsing all possible XML elements that could be encountered by {@link ListAlarmHistoryResponseHandler}.
*
* @throws Exception if something goes wrong
*/
public void testParseFullResponse() throws Exception {
 IterableWithMarker<AlarmHistoryItem> alarmHistoryItems =
    factory.create(injector.getInstance(ListAlarmHistoryResponseHandler.class))
        .parse(getClass().getResourceAsStream("/DescribeAlarmHistoryResponse.xml"));
 assertEquals(alarmHistoryItems.toString(), expected().toString());
 assertFalse(alarmHistoryItems.nextMarker().isPresent());
}
org.jclouds.cloudwatch.xmlListAlarmHistoryResponseHandlerTest

Javadoc

Tests behavior of ListAlarmHistoryResponseHandler. Implicitly tests behavior of MetricAlarmHandler.

Most used methods

  • <init>
  • expected

Popular in Java

  • Reactive rest calls using spring rest template
  • setRequestProperty (URLConnection)
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now