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

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Join (org.hibernate.mapping)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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