Search in sources :

Example 1 with Searchable

use of com.sequenceiq.it.cloudbreak.search.Searchable in project cloudbreak by hortonworks.

the class ReportListener method logUrl.

private void logUrl(ITestResult tr) {
    TestContext testContext;
    Object[] parameters = tr.getParameters();
    if (parameters == null || parameters.length == 0) {
        return;
    }
    try {
        testContext = (TestContext) parameters[0];
    } catch (ClassCastException e) {
        return;
    }
    Iterable<Searchable> searchables = Iterables.filter(testContext.getResourceNames().values(), Searchable.class);
    List<Searchable> listOfSearchables = StreamSupport.stream(searchables.spliterator(), false).collect(Collectors.toList());
    if (listOfSearchables.size() == 0) {
        return;
    }
    SearchUrl searchUrl = new KibanaSearchUrl();
    tr.getTestContext().setAttribute(tr.getName() + SEARCH_URL, searchUrl.getSearchUrl(listOfSearchables, new Date(tr.getStartMillis()), new Date(tr.getEndMillis())));
    String baseLocation = getCloudStorageBaseLocation(testContext);
    CloudProviderProxy cloudProvider = testContext.getCloudProvider();
    generateClusterLogsUrl(FreeIpaTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
    generateClusterLogsUrl(SdxTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
    generateClusterLogsUrl(SdxInternalTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
    generateClusterLogsUrl(DistroXTestDto.class, tr, testContext.getResourceNames(), testContext.getResourceCrns(), baseLocation, cloudProvider);
}
Also used : MeasuredTestContext(com.sequenceiq.it.cloudbreak.context.MeasuredTestContext) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) KibanaSearchUrl(com.sequenceiq.it.cloudbreak.search.KibanaSearchUrl) SearchUrl(com.sequenceiq.it.cloudbreak.search.SearchUrl) KibanaSearchUrl(com.sequenceiq.it.cloudbreak.search.KibanaSearchUrl) Searchable(com.sequenceiq.it.cloudbreak.search.Searchable) CloudProviderProxy(com.sequenceiq.it.cloudbreak.cloud.v4.CloudProviderProxy) Date(java.util.Date)

Aggregations

CloudProviderProxy (com.sequenceiq.it.cloudbreak.cloud.v4.CloudProviderProxy)1 MeasuredTestContext (com.sequenceiq.it.cloudbreak.context.MeasuredTestContext)1 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)1 KibanaSearchUrl (com.sequenceiq.it.cloudbreak.search.KibanaSearchUrl)1 SearchUrl (com.sequenceiq.it.cloudbreak.search.SearchUrl)1 Searchable (com.sequenceiq.it.cloudbreak.search.Searchable)1 Date (java.util.Date)1