Package com.sun.javatest
Class LastRunInfo
- java.lang.Object
-
- com.sun.javatest.LastRunInfo
-
public class LastRunInfo extends java.lang.Object
Information about the last or current test run. This is an interface onto this meta-information stored in a work directory.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getConfigName()
Get the name of the configuration that was used in the last test run.java.util.Date
getFinishDate()
When did the last test run end.long
getFinishTime()
When did the last test run end.java.util.Date
getStartDate()
When did the last test run start.long
getStartTime()
When did the last test run start.java.util.List<java.lang.String>
getTestURLs()
Get the URLs of the tests that were executed in the last test run.static LastRunInfo
readInfo(WorkDirectory wd)
Given a work directory, attempt to create an instance using the information found in it.static void
writeInfo(WorkDirectory workdir, long start, long stop, java.lang.String config, java.util.List<java.lang.String> testURLs)
Given a work directory, write the given run information in it.
-
-
-
Method Detail
-
readInfo
public static LastRunInfo readInfo(WorkDirectory wd) throws java.io.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:
java.io.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, java.lang.String config, java.util.List<java.lang.String> testURLs) throws java.io.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:
java.io.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:
Date
-
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:
Date
-
getStartDate
public java.util.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:
Date
-
getFinishDate
public java.util.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:
Date
-
getConfigName
public java.lang.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 java.util.List<java.lang.String> getTestURLs()
Get the URLs of the tests that were executed in the last test run.- Returns:
- String array of testURLs executed.
-
-