From c03265785e58bcad87259e0a9355f34b87c7e104 Mon Sep 17 00:00:00 2001 From: andreisavu Date: Mon, 19 Dec 2011 11:34:40 +0200 Subject: [PATCH] Make Datapoint getters public --- .../org/jclouds/cloudwatch/domain/Datapoint.java | 16 ++++++++-------- .../cloudwatch/CloudWatchClientLiveTest.java | 8 +++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/Datapoint.java b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/Datapoint.java index 77a7aecf4a..2d78ed4ae5 100644 --- a/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/Datapoint.java +++ b/apis/cloudwatch/src/main/java/org/jclouds/cloudwatch/domain/Datapoint.java @@ -56,7 +56,7 @@ public class Datapoint { * return Average of samples for the datapoint. */ @Nullable - Double getAverage() { + public Double getAverage() { return average; } @@ -64,7 +64,7 @@ public class Datapoint { * return Maximum of the samples used for the datapoint. */ @Nullable - Double getMaximum() { + public Double getMaximum() { return maximum; } @@ -72,7 +72,7 @@ public class Datapoint { * return Minimum of samples for the datapoint. */ @Nullable - Double getMinimum() { + public Double getMinimum() { return minimum; } @@ -80,7 +80,7 @@ public class Datapoint { * return Indicates the beginning of the time aggregation for this value and samples. */ @Nullable - Date getTimestamp() { + public Date getTimestamp() { return timestamp; } @@ -88,7 +88,7 @@ public class Datapoint { * return The number of Measurements that contributed to the aggregate value of this datapoint. */ @Nullable - Double getSamples() { + public Double getSamples() { return samples; } @@ -96,7 +96,7 @@ public class Datapoint { * return Sum of samples for the datapoint. */ @Nullable - Double getSum() { + public Double getSum() { return sum; } @@ -104,7 +104,7 @@ public class Datapoint { * return Standard unit used for the datapoint. */ @Nullable - StandardUnit getUnit() { + public StandardUnit getUnit() { return unit; } @@ -112,7 +112,7 @@ public class Datapoint { * return CustomUnit defined for the datapoint. */ @Nullable - String getCustomUnit() { + public String getCustomUnit() { return customUnit; } diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchClientLiveTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchClientLiveTest.java index f7755ae9c4..1876f31920 100644 --- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchClientLiveTest.java +++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/CloudWatchClientLiveTest.java @@ -23,8 +23,11 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.util.Calendar; import java.util.Date; import java.util.Properties; +import java.util.Set; import org.jclouds.Constants; +import org.jclouds.cloudwatch.domain.Datapoint; +import org.jclouds.logging.Logger; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.rest.RestContext; import org.jclouds.rest.RestContextFactory; @@ -89,7 +92,10 @@ public class CloudWatchClientLiveTest { protected void getMetricStatisticsInRegion(String region) { Calendar cal = Calendar.getInstance(); cal.add(Calendar.MINUTE, -1); - assert client.getMetricStatisticsInRegion(region, "CPUUtilization", cal.getTime(), new Date(), 60, "Average") != null; + + Set datapoints = client.getMetricStatisticsInRegion( + region, "CPUUtilization", cal.getTime(), new Date(), 60, "Average"); + assert datapoints != null; } @AfterTest