Class ChartTester
-
- All Implemented Interfaces:
public class ChartTester<T extends Chart> extends ComponentTester<T>
Tester for Chart components.
-
-
Constructor Summary
Constructors Constructor Description ChartTester(T component)Wrap given component for testing.
-
Method Summary
Modifier and Type Method Description List<Number>getSeriesValues(int seriesIndex)Gets the values for the series at given index. List<Number>getSeriesValues(String seriesName)Gets the values for the series with the given name. NumbergetPointValue(int seriesIndex, String name)Gets the value of the point with given name from the series at given index. NumbergetPointValue(String seriesName, String name)Gets the value of the point with given name from the series at given index. voidclickLegendItem(String item)Simulates a click on the item of the legend with the given text. voidclickPoint(String seriesName, String name)Simulates a click on a point on the chart. voidclickChart()Simulates a click on the chart, but not on legend items or points. -
-
Constructor Detail
-
ChartTester
ChartTester(T component)
Wrap given component for testing.- Parameters:
component- target component
-
-
Method Detail
-
getSeriesValues
List<Number> getSeriesValues(int seriesIndex)
Gets the values for the series at given index. At the moment only ListSeries, DataSeries and DataProviderSeries are supported. For all other series types an exception will be thrown. For DataProviderSeries Y value is expected to be a Number subtype.
- Parameters:
seriesIndex- zero-based index of the series- Returns:
the list of values for the series.
-
getSeriesValues
List<Number> getSeriesValues(String seriesName)
Gets the values for the series with the given name. At the moment only ListSeries, DataSeries and DataProviderSeries are supported. For all other series types an exception will be thrown. For DataProviderSeries Y value is expected to be a Number subtype.
- Parameters:
seriesName- name of the series- Returns:
the list of values for the series.
-
getPointValue
Number getPointValue(int seriesIndex, String name)
Gets the value of the point with given name from the series at given index. The
namedepends on the series type. For ListSeries it is expected to refer to an X-Axis category, for DataSeries it refers to the item name, for DataProviderSeries it is matched against the value of the configured x attribute. At the moment only ListSeries, DataSeries and DataProviderSeries are supported. For all other series types an exception will be thrown.- Parameters:
seriesIndex- zero-based index of the seriesname- name of the point in the series- Returns:
the value of the point at given coordinates.
-
getPointValue
Number getPointValue(String seriesName, String name)
Gets the value of the point with given name from the series at given index. The
namedepends on the series type. For ListSeries it is expected to refer to an X-Axis category, for DataSeries it refers to the item name, for DataProviderSeries it is matched against the value of the configured x attribute. At the moment only ListSeries, DataSeries and DataProviderSeries are supported. For all other series types an exception will be thrown.- Parameters:
seriesName- name of the seriesname- name of the point in the series- Returns:
the value of the point at given coordinates.
-
clickLegendItem
void clickLegendItem(String item)
Simulates a click on the item of the legend with the given text. Current limitation: it assumes the text corresponds to a series name.
- Parameters:
item- legend item
-
clickPoint
void clickPoint(String seriesName, String name)
Simulates a click on a point on the chart.
- Parameters:
seriesName- name of the seriesname- name of the point in the series
-
clickChart
void clickChart()
Simulates a click on the chart, but not on legend items or points.
-
-
-
-