Class EligibleTestCase

java.lang.Object
com.cyara.apisamples.EligibleTestCase
All Implemented Interfaces:
java.lang.Comparable<EligibleTestCase>

public class EligibleTestCase
extends java.lang.Object
implements java.lang.Comparable<EligibleTestCase>
Used for test cases that are currently supposed to run for the currentDate we're on inside SchedulePulseCampaigns. If a test case is supposed to run based on the currentDate, we create an object of this class which contains all the relevant information about that test case and its runtime.

This is not an official Cyara product and is not officially supported. It is used for demonstration and training purposes. For assistance, contact chris.ryan@cyara.com

Version:
1.1
Author:
Chris Ryan
See Also:
SchedulePulseCampaigns, EligibleCampaignRun
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.lang.String day  
    private java.util.Date endDate  
    private java.lang.String endTime  
    private int frequency  
    private int minuteDuration  
    private int scenarios  
    private java.util.Date startDate  
    private java.lang.String startTime  
    private int testCaseId  
  • Constructor Summary

    Constructors 
    Constructor Description
    EligibleTestCase​(int testCaseId, int minuteDuration, int frequency, int scenarios, java.lang.String day, java.lang.String startTime, java.lang.String endTime, java.util.Date startDate, java.util.Date endDate)
    The constructor to create an EligibleTestCase object
  • Method Summary

    Modifier and Type Method Description
    int compareTo​(EligibleTestCase o)  
    java.lang.String getDay()
    Based on the currentDate at the time this object was created, this test case had an eligible runtime for that date and time.
    java.lang.String getEndTime()
    Based on the currentDate at the time this object was created, this test case had an eligible runtime for that date and time.
    int getMinuteDuration()
    Gets the length in time this test case takes to run, which was specified in this test case's description json
    int getScenarios()
    If the test case is data driven, every scenario is considered 1 call (so 8 scenarios would be 8 calls).
    java.lang.String getStartTime()
    Based on the currentDate at the time this object was created, this test case had an eligible runtime for that date and time.
    java.util.Date getTestCaseEndDate()
    The Date object representation of the day and end time for this test case runtime.
    int getTestCaseFrequency()
    Gets the length in time to wait between runs for this test case.
    int getTestCaseId()
    Gets the test case ID, which is used throughout SchedulePulseCampaigns to group together test cases and, ultimately, create campaigns
    java.util.Date getTestCaseStartDate()
    The Date object representation of the day and start time for this test case runtime.
    void setScenarios​(int scenarios)
    Assigns the number of scenarios this test case has.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • EligibleTestCase

      EligibleTestCase​(int testCaseId, int minuteDuration, int frequency, int scenarios, java.lang.String day, java.lang.String startTime, java.lang.String endTime, java.util.Date startDate, java.util.Date endDate)
      The constructor to create an EligibleTestCase object
      Parameters:
      testCaseId - The portal's unique ID for the test case
      minuteDuration - How long the test case takes to run, pulled from the description json
      frequency - How often in minutes you want the test case to run, pulled from the description json
      scenarios - How many data driven scenarios this test case has. If 0, is assigned 1 in SchedulePulseCampaigns
      day - The day for this runtime, pulled from the description json
      startTime - The time this test case needs to start running, pulled from the description json
      endTime - The time this test case needs to stop running, pulled from the description json
      startDate - The date representation of the day and startTime
      endDate - The data representation of the day and endTime
  • Method Details

    • getTestCaseId

      public int getTestCaseId()
      Gets the test case ID, which is used throughout SchedulePulseCampaigns to group together test cases and, ultimately, create campaigns
      Returns:
      The Portal's unique test case ID for this eligible test case
      Since:
      1.0
    • getMinuteDuration

      public int getMinuteDuration()
      Gets the length in time this test case takes to run, which was specified in this test case's description json
      Returns:
      The length in time this test case takes to run
      Since:
      1.0
    • getTestCaseFrequency

      public int getTestCaseFrequency()
      Gets the length in time to wait between runs for this test case. Used in SchedulePulseCampaigns to group test cases together that have the same frequency
      Returns:
      How often in minutes you want this test case to run
      Since:
      1.0
    • getScenarios

      public int getScenarios()
      If the test case is data driven, every scenario is considered 1 call (so 8 scenarios would be 8 calls). If it's not data driven, then scenarios will just be 1, to represent how many calls this test case will ultimately make.
      Returns:
      The number of calls this test case needs to make to run through all of its scenarios
      Since:
      1.0
    • getDay

      public java.lang.String getDay()
      Based on the currentDate at the time this object was created, this test case had an eligible runtime for that date and time. This is the day in the description json that was used to determine that eligible runtime.
      Returns:
      The day for this runtime, pulled from the description json
      Since:
      1.0
    • getStartTime

      public java.lang.String getStartTime()
      Based on the currentDate at the time this object was created, this test case had an eligible runtime for that date and time. This is the startTime in the description json that was used to determine that eligible runtime.
      Returns:
      The time this test case needs to start running, pulled from the description json
      Since:
      1.0
    • getEndTime

      public java.lang.String getEndTime()
      Based on the currentDate at the time this object was created, this test case had an eligible runtime for that date and time. This is the endTime in the description json that was used to determine that eligible runtime.
      Returns:
      The time this test case needs to stop running, pulled from the description json
      Since:
      1.0
    • getTestCaseStartDate

      public java.util.Date getTestCaseStartDate()
      The Date object representation of the day and start time for this test case runtime. Currently unused, but here for future convenience.
      Returns:
      The date representation of the day and startTime
      Since:
      1.0
    • getTestCaseEndDate

      public java.util.Date getTestCaseEndDate()
      The Date object representation of the day and end time for this test case runtime. Currently unused, but here for future convenience.
      Returns:
      The date representation of the day and endTime
      Since:
      1.0
    • setScenarios

      public void setScenarios​(int scenarios)
      Assigns the number of scenarios this test case has. For SchedulePulseCampaigns, if a test case has no scenarios, it will set this to 1, because in that context, we use the scenarios to determine how many calls this test case will make.
      Parameters:
      scenarios - Sets the number of calls this test case will make
      Since:
      1.0
    • compareTo

      public int compareTo​(EligibleTestCase o)
      Specified by:
      compareTo in interface java.lang.Comparable<EligibleTestCase>