class StorageScanner extends java.lang.Object
| Modifiers | Name | Description |
|---|---|---|
static class |
StorageScanner.BufferedImageBuffer |
This class maintains a buffer of BufferedImage to make I/O to PNG files efficient. |
static class |
StorageScanner.Options |
Options to control the behavior of StroageScanner |
| Type | Name and description |
|---|---|
static org.slf4j.Logger |
logger_ |
| Constructor and description |
|---|
StorageScanner
(MaterialStorage materialStorage) |
StorageScanner
(MaterialStorage materialStorage, Options options) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
java.nio.file.Path |
findLatestImageDeltaStats(TSuiteName tSuiteNameExam, TExecutionProfile tExecutionProfile, TCaseName tCaseNameExam)@return |
|
static java.nio.file.Path |
findLatestImageDeltaStats(MaterialStorage materialStorage, TSuiteName tSuiteNameExam, TExecutionProfile tExecutionProfile, TCaseName tCaseNameExam)@param materialStorage |
|
java.util.List<Material> |
getMaterialsOfARelativePathInATSuiteName(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile, java.nio.file.Path pathRelativeToTSuiteTimestamp)@param tSuiteName |
|
Options |
getOptions()@return Options object which is in use |
|
boolean |
isInRangeOfTSuiteTimestamp(Material material)Check if the Material is newer than the TSuiteTimestamp specified by the onlySince property in the Options object passed to the StorageScanner constructor. |
|
ImageDelta |
makeImageDelta(Material a, Material b, StorageScanner.BufferedImageBuffer biBuffer)Read 2 PNG files to get image difference, calculate the diff ratio, and will return a ImageDelta object. |
|
MaterialStats |
makeMaterialStats(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile, java.nio.file.Path pathRelativeToTSuiteTimestampDir)This will return
{
"path: "main.TC_47News.visitSite/47NEWS_TOP.png",
"imageDeltaList": [
// list of ImageDelta objects
{
"path": "47news.visitSite/47reporters.png",
"degree": 9,
"sum": 49.339999999999996,
"mean": 5.482222222222222,
"variance": 2.2697232411502397,
"standardDeviation": 1.506560068882167,
"tDistribution": 1.8595480375401174,
"confidenceInterval": {
"lowerBound": 4.548381949046843,
"uppderBound": 6.416062495397601,
"confidenceLevel": 0.95
},
"criteriaPercentage": 7.42,
"data": [
33.99,
...
1.95
],
"imageDeltaList": [
{
"a": "20190401_142150",
"b": "20190401_141839",
"d": 0.00,
"cached": false
},
...
]
},
],
}
|
|
StatsEntry |
makeStatsEntry(TSuiteName tSuiteNameCapture, TExecutionProfile tExecutionProfileCapture)This will return
{
"TSuiteName": "47News_chronos_capture",
"materialStatsList": [
// list of MaterialStats objects like
//
]
}
|
|
java.nio.file.Path |
persist(ImageDeltaStats imageDeltaStats, TSuiteName tSuiteNameExam, TExecutionProfile tExecutionProfile, TSuiteTimestamp tSuiteTimestampExam, TCaseName tCaseNameExam)Write the imageDeltaStats (image-delta-stats.json) file into the Storage directory, into the subdirectory of Exam at the path specified by tSuiteName + tExecutionProfile + tSuiteTimestamp + tCaseName. |
|
ImageDeltaStats |
scan(TSuiteName capturingTSuiteName, TExecutionProfile capturingTExecutionProfile)This will return
{
"defaultCriteriaPercentage":5.0,
"statsEntryList":[
// a StatsEntry object of the TSuiteName specified
]
}
|
|
void |
setVisualTestingLogger(VisualTestingLogger logger)Caller can set a VisualTestingListener to hear from the StorageScanner |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Check if the Material is newer than the TSuiteTimestamp specified by the onlySince property in the Options object passed to the StorageScanner constructor. The boolean property onlySinceInclusive is respected.
Read 2 PNG files to get image difference, calculate the diff ratio, and will return a ImageDelta object. Please note that this method call takes fairly long processing time (2 to 4 seconds).
{ "a": "20190216_064354", "b": "20190216_064149", "delta": 0.10 }
This will return
{
"path: "main.TC_47News.visitSite/47NEWS_TOP.png",
"imageDeltaList": [
// list of ImageDelta objects
{
"path": "47news.visitSite/47reporters.png",
"degree": 9,
"sum": 49.339999999999996,
"mean": 5.482222222222222,
"variance": 2.2697232411502397,
"standardDeviation": 1.506560068882167,
"tDistribution": 1.8595480375401174,
"confidenceInterval": {
"lowerBound": 4.548381949046843,
"uppderBound": 6.416062495397601,
"confidenceLevel": 0.95
},
"criteriaPercentage": 7.42,
"data": [
33.99,
...
1.95
],
"imageDeltaList": [
{
"a": "20190401_142150",
"b": "20190401_141839",
"d": 0.00,
"cached": false
},
...
]
},
],
}
This will return
{
"TSuiteName": "47News_chronos_capture",
"materialStatsList": [
// list of MaterialStats objects like
//
]
}
Write the imageDeltaStats (image-delta-stats.json) file into the Storage directory, into the subdirectory of Exam at the path specified by tSuiteName + tExecutionProfile + tSuiteTimestamp + tCaseName.
This will return
{
"defaultCriteriaPercentage":5.0,
"statsEntryList":[
// a StatsEntry object of the TSuiteName specified
]
}
Caller can set a VisualTestingListener to hear from the StorageScanner
Groovy Documentation