下面列出了hudson.model.Actionable#getActions ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
private void assertThatCheckstyleAndEclipseChartExist(final Actionable actionable, final boolean shouldChartBeVisible) {
List<JobAction> jobActions = actionable.getActions(JobAction.class);
assertThat(jobActions).hasSize(2);
JobAction checkstyle;
JobAction eclipse;
if ("checkstyle".equals(jobActions.get(0).getUrlName())) {
checkstyle = jobActions.get(0);
eclipse = jobActions.get(1);
}
else {
checkstyle = jobActions.get(1);
eclipse = jobActions.get(0);
}
assertThat(eclipse.getTrendName()).isEqualTo(ECLIPSE);
assertThat(eclipse.getIconFileName()).contains(ANALYSIS_ICON);
assertThat(checkstyle.getTrendName()).isEqualTo(CHECKSTYLE);
assertThat(checkstyle.getIconFileName()).contains(CHECKSTYLE_ICON);
if (shouldChartBeVisible) {
assertThatTrendChartIsVisible(eclipse);
assertThatTrendChartIsVisible(checkstyle);
}
else {
assertThatTrendChartIsHidden(eclipse);
assertThatTrendChartIsHidden(checkstyle);
}
}
private void assertThatAggregationChartDoesNotExists(final Actionable actionable) {
List<AggregatedTrendAction> aggregatedTrendActions = actionable.getActions(AggregatedTrendAction.class);
assertThat(aggregatedTrendActions).hasSize(0);
}