Class LastRunInfo

java.lang.Object
com.sun.javatest.LastRunInfo

public class LastRunInfo extends Object
Information about the last or current test run. This is an interface onto this meta-information stored in a work directory.
  • Method Details

    • readInfo

      public static LastRunInfo readInfo(WorkDirectory wd) throws IOException
      Given a work directory, attempt to create an instance using the information found in it.
      Parameters:
      wd - The work directory to create the information from.
      Returns:
      Configuration name as it appeared in the configuration. May be null or empty string if this information is not available.
      Throws:
      IOException - Occurs if the last run info is not available or if the system has a problem while reading the file.
    • writeInfo

      public static void writeInfo(WorkDirectory workdir, long start, long stop, String config, List<String> testURLs) throws IOException
      Given a work directory, write the given run information in it.
      Parameters:
      workdir - The work directory to modify. Must be able to read-write files inside it.
      start - Time in milliseconds at which the last test run started. Must be a non-negative number.
      stop - Time in milliseconds at which the last test run terminated. Must be a non-negative number.
      config - Configuration name which was used to do the last test run. May be null or empty string if necessary.
      Throws:
      IOException - If for any reason the information file cannot be created, opened, written into or deleted.
    • getStartTime

      public long getStartTime()
      When did the last test run start. Warning - the time information stored in a test result is only accurate to one second, so everything below a 1000ms can't be compared reliably. If you are comparing times to a TestResult, it is suggested that you either remove the ms from the return value or do something other than compare the integers.
      Returns:
      The time (in milliseconds) at which the last test run started.
      See Also:
    • getFinishTime

      public long getFinishTime()
      When did the last test run end. Warning - the time information stored in a test result is only accurate to one second, so everything below a 1000ms can't be compared reliably. If you are comparing times to a TestResult, it is suggested that you either remove the ms from the return value or do something other than compare the integers.
      Returns:
      The time (in milliseconds) at which the last test run completed (for any reason).
      See Also:
    • getStartDate

      public Date getStartDate()
      When did the last test run start.
      Returns:
      The time (in milliseconds) at which the last test run started. May be zero if the information is not available.
      See Also:
    • getFinishDate

      public Date getFinishDate()
      When did the last test run end.
      Returns:
      The time (in milliseconds) at which the last test run completed (for any reason). May be zero if the information is not available.
      See Also:
    • getConfigName

      public String getConfigName()
      Get the name of the configuration that was used in the last test run.
      Returns:
      Configuration name as it appeared in the configuration. May be null or empty string if this information is not available.
    • getTestURLs

      public List<String> getTestURLs()
      Get the URLs of the tests that were executed in the last test run.
      Returns:
      String array of testURLs executed.