Search in sources :

Example 1 with ExternalAlertRequestUtility

use of com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility in project hub-alert by blackducksoftware.

the class CopyJobPerformanceTest method copyJobTest.

@Test
@Ignore
@Disabled
public void copyJobTest() throws IntegrationException {
    ExternalAlertRequestUtility alertRequestUtility = new ExternalAlertRequestUtility(intLogger, client, alertURL);
    // Create an authenticated connection to Alert
    alertRequestUtility.loginToExternalAlert();
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), ChannelKeys.SLACK.getUniversalKey());
    int count = 1000;
    String jobName = URLEncoder.encode("Jira Server", Charset.defaultCharset());
    for (int index = 1; index <= count; index++) {
        String newJobName = String.format("%s_%d", jobName, index);
        configurationManager.copyJob(jobName, newJobName);
    }
}
Also used : ExternalAlertRequestUtility(com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager) Ignore(org.junit.Ignore) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Disabled(org.junit.jupiter.api.Disabled)

Example 2 with ExternalAlertRequestUtility

use of com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility in project hub-alert by blackducksoftware.

the class ScalingPerformanceTest method testAlertPerformance.

@Test
@Ignore
@Disabled
public void testAlertPerformance() throws Exception {
    LocalDateTime startingTime = LocalDateTime.now();
    intLogger.info(String.format("Starting time %s", dateTimeFormatter.format(startingTime)));
    ExternalAlertRequestUtility alertRequestUtility = new ExternalAlertRequestUtility(intLogger, client, alertURL);
    // Create an authenticated connection to Alert
    alertRequestUtility.loginToExternalAlert();
    logTimeElapsedWithMessage("Logging in took %s", startingTime, LocalDateTime.now());
    BlackDuckProviderService blackDuckProviderService = new BlackDuckProviderService(alertRequestUtility, gson);
    ConfigurationManager configurationManager = new ConfigurationManager(gson, alertRequestUtility, blackDuckProviderService.getBlackDuckProviderKey(), ChannelKeys.SLACK.getUniversalKey());
    startingTime = LocalDateTime.now();
    // Create the Black Duck Global provider configuration
    String blackDuckProviderID = blackDuckProviderService.setupBlackDuck();
    logTimeElapsedWithMessage("Configuring the Black Duck provider took %s", startingTime, LocalDateTime.now());
    List<String> jobIds = new ArrayList<>();
    startingTime = LocalDateTime.now();
    // create 10 slack jobs, trigger notification, and wait for all 10 to succeed
    createAndTestJobs(alertRequestUtility, blackDuckProviderService, configurationManager, startingTime, jobIds, 10, blackDuckProviderID);
    startingTime = LocalDateTime.now();
    // create 90 more slack jobs, trigger notification, and wait for all 100 to succeed
    createAndTestJobs(alertRequestUtility, blackDuckProviderService, configurationManager, startingTime, jobIds, 90, blackDuckProviderID);
// TODO create 900 more slack jobs for a total of 1000
// TODO create 1000 more slack jobs for a total of 2000
}
Also used : LocalDateTime(java.time.LocalDateTime) ExternalAlertRequestUtility(com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility) BlackDuckProviderService(com.synopsys.integration.alert.performance.utility.BlackDuckProviderService) ArrayList(java.util.ArrayList) ConfigurationManager(com.synopsys.integration.alert.performance.utility.ConfigurationManager) Ignore(org.junit.Ignore) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

BlackDuckProviderService (com.synopsys.integration.alert.performance.utility.BlackDuckProviderService)2 ConfigurationManager (com.synopsys.integration.alert.performance.utility.ConfigurationManager)2 ExternalAlertRequestUtility (com.synopsys.integration.alert.performance.utility.ExternalAlertRequestUtility)2 Ignore (org.junit.Ignore)2 Disabled (org.junit.jupiter.api.Disabled)2 Test (org.junit.jupiter.api.Test)2 LocalDateTime (java.time.LocalDateTime)1 ArrayList (java.util.ArrayList)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1