public static class SAFSPlus.Counters
extends java.lang.Object
PrintTestCaseSummary(String)
, PrintTestSuiteSummary(String)
etc. by using combination of DriverCounter keywords.GetCounterStatus(String)
) through the underlying JSAFSConstructor and Description |
---|
Counters() |
Modifier and Type | Method and Description |
---|---|
static CountStatusInterface |
GetCounterStatus(java.lang.String counterId)
Retrieve all the information stored for a particular Counter.
|
static void |
IncrementCounts(boolean passed)
Increment test counters as appropriate.
|
static boolean |
LogCounterInfo(java.lang.String counterId)
Log the counter info (counts) for a specific counter.
|
static boolean |
PrintTestCaseSummary(java.lang.String tcname)
Stop capturing test activity counts for a specific application feature or test-case if it is
still active, then print a summary report of all tests counted, passed, failed, and skipped, etc...
|
static boolean |
PrintTestSuiteSummary(java.lang.String suitename)
Stop capturing test activity counts for the overall suite of tests if it is
still active, then print a summary report of all counted, passed, failed, and skipped tests etc...
|
static boolean |
ResumeCounts(java.lang.String... reason)
Resume counting on all active counters.
|
static boolean |
StartCounter(java.lang.String counterId,
java.lang.String... details)
(Re)Start/Create an active tester-defined counter.
|
static boolean |
StartTestCase(java.lang.String tcname)
Start capturing test activity counts for a specific application feature or test-case.
|
static boolean |
StartTestSuite(java.lang.String suitename)
Start capturing test activity counts for the named test suite.
|
static boolean |
StopCounter(java.lang.String counterId,
java.lang.String... details)
Stop/Create a suspended tester-defined counter.
|
static boolean |
StopTestCase(java.lang.String tcname)
Stop capturing test activity counts for a specific application feature or test-case.
|
static boolean |
StoreCounterInfo(java.lang.String counterId,
java.lang.String varPrefix)
Store the counter info (counts) for a specific counter into a DDVariable array.
|
static boolean |
SuspendCounts(java.lang.String... reason)
Suspend counting on all active counters.
|
public static boolean PrintTestCaseSummary(java.lang.String tcname)
tcname
- The name of the test-case to start using a Counter on. The name must match a counter
that was previously started.Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
StartTestCase(String)
public static boolean PrintTestSuiteSummary(java.lang.String suitename)
suitename
- The name of the suite to stop (if still running) and process.
The name must match a counter that was previously started.Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
public static void IncrementCounts(boolean passed)
passed
- true increments test successes, false increments test failures.public static CountStatusInterface GetCounterStatus(java.lang.String counterId)
counterId
- - the unique String ID of the counter to retrieve.public static boolean StartCounter(java.lang.String counterId, java.lang.String... details)
counterId
- -- the unique Id of the counter.details
- -- optional -- any additional (String) details or description of the counter to be logged.SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
boolean success = Counters.StartCounter(FEATURE_TEST_COUNTER, "Tracking all test records for this feature");
....(do some testing)
success = Counters.StopCounter(FEATURE_TEST_COUNTER, "Testing for this feature is finished.");
public static boolean StartTestCase(java.lang.String tcname)
tcname
- The name of the test-case to start using a Counter on.Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
public static boolean StartTestSuite(java.lang.String suitename)
suitename
- The name of the suite counter to start.Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
TestRecordData.getStatusInfo()
public static boolean StopCounter(java.lang.String counterId, java.lang.String... details)
counterId
- -- the unique Id of the counter.details
- -- optional -- any additional (String) details or description of the counter to be logged.SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
boolean success = Counters.StartCounter(FEATURE_TEST_COUNTER, "Tracking all test records for this feature");
....(do some testing)
success = Counters.StopCounter(FEATURE_TEST_COUNTER, "Testing for this feature is finished.");
public static boolean StopTestCase(java.lang.String tcname)
tcname
- The name of the test-case to stop. The name must match a counter that was
previously started.Sets prevResults TestRecordHelper to the results received or null if an error occurred.
SAFSPlus.prevResults
,
StartTestCase(String)
,
PrintTestCaseSummary(String)
public static boolean SuspendCounts(java.lang.String... reason)
reason
- -- optional -- any additional (String) details or reason for the suspension to be logged.SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
boolean success = Counters.StartCounter(FUNCTIONAL_TEST_COUNTER, "Tracking all test records for Functional Testing");
....(do some testing)
success = Counters.SuspendCounts("Scenario preparation commencing.");
....(do some things you don't want logged or corrupting counters.)
success = Counters.ResumeCounts("Scenario preparation complete.");
public static boolean ResumeCounts(java.lang.String... reason)
reason
- -- optional -- any additional (String) details to be logged.SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
boolean success = Counters.StartCounter(FUNCTIONAL_TEST_COUNTER, "Tracking all test records for Functional Testing");
....(do some testing)
success = Counters.SuspendCounts("Scenario preparation commencing.");
....(do some things you don't want logged or corrupting counters.)
success = Counters.ResumeCounts("Scenario preparation complete.");
public static boolean LogCounterInfo(java.lang.String counterId)
counterId
- -- the unique Id of the counter.SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
boolean success = Counters.StartCounter(FUNCTIONAL_TEST_COUNTER, "Tracking all test records for Functional Testing");
....(do your testing, then log a snapshot/final statistics)
success = Counters.LogCounterInfo(FUNCTIONAL_TEST_COUNTER);
public static boolean StoreCounterInfo(java.lang.String counterId, java.lang.String varPrefix)
counterId
- -- the unique Id of the counter.varPrefix
- -- the unique root name for a list of DDVariables to hold the counter info.SAFSPlus.GetVariableValue(String)
,
SAFSPlus.prevResults
,
TestRecordData.getStatusCode()
,
boolean success = Counters.StartCounter(FUNCTIONAL_TEST_COUNTER, "Tracking all functional test records."); ...(do some testing, then check counter status) success = Counters.StoreCounterInfo(FUNCTIONAL_TEST_COUNTER, VAR_TEST); if(success){ int passes = Integer.parseInt(GetVariableValue(VAR_TEST+".test_passes")); int failures = Integer.parseInt(GetVariableValue(VAR_TEST+".test_failures")); int tests = Integer.parseInt(GetVariableValue(VAR_TEST+".test_records")); }
Copyright © SAS Institute. All Rights Reserved.