CAtsLogger Class Reference
class CAtsLogger : public CBase
|
Nested Classes and Structures
Public Member Functions
|
|
~CAtsLogger
()
|
IMPORT_C void
|
BeginTestCaseL
(const
TDesC
&, const
TDesC
&, const
TDesC
&, const
TDesC
&)
|
IMPORT_C void
|
BeginTestCaseL
(const
TDesC
&, const
TInt
, const
TDesC
&, const
TDesC
&)
|
IMPORT_C void
|
BeginTestCaseReportL
(const
TDesC
&, const
TDesC
&, const
TTime
&, const
TDesC
&, const
TDesC
&)
|
IMPORT_C void
|
BeginTestCaseReportL
(const
TDesC
&, const
TInt
, const
TTime
&, const
TDesC
&, const
TDesC
&)
|
IMPORT_C void
|
BeginTestReportL
()
|
IMPORT_C void
|
BeginTestSetL
(const
TDesC
&, const
TDesC
&, const
TDesC
&, const
TDesC
&)
|
IMPORT_C void
|
CloseL
()
|
IMPORT_C void
|
CommentL
(const
TDesC
&)
|
IMPORT_C void
|
CommentL
(
TRefByValue
< const
TDesC
>, ...)
|
IMPORT_C void
|
ContinueAfterRebootL
()
|
IMPORT_C void
|
DebugL
(const
TDesC
&)
|
IMPORT_C void
|
DebugL
(
TRefByValue
< const
TDesC
>, ...)
|
IMPORT_C void
|
DebugOutput
(const
TDesC
&)
|
IMPORT_C void
|
EndTestCaseL
()
|
IMPORT_C void
|
EndTestReportL
()
|
IMPORT_C void
|
EndTestSetL
()
|
IMPORT_C void
|
ErrorL
(const
TDesC
&)
|
IMPORT_C void
|
ErrorL
(
TRefByValue
< const
TDesC
>, ...)
|
IMPORT_C const
TPtrC
|
ErrorMessage
(const
TInt
&)
|
IMPORT_C
TBool
|
IsValid
()
|
IMPORT_C
CAtsLogger
*
|
NewL
(const
TDesC
&,
TBool
)
|
IMPORT_C
TInt
|
RawLogL
(const
TDesC
&)
|
IMPORT_C
TInt
|
RawLogL
(
TRefByValue
< const
TDesC
>, ...)
|
IMPORT_C void
|
SaveForRebootL
()
|
IMPORT_C void
|
SetDebugOutput
(
TBool
)
|
IMPORT_C void
|
SetFullReporting
(
TBool
)
|
IMPORT_C void
|
SetIndentation
(
TBool
)
|
IMPORT_C void
|
SetTestCaseResultL
(const
TInt
)
|
IMPORT_C void
|
SetTestCaseResultL
(const
TDesC
&)
|
IMPORT_C void
|
SetTestCaseResultL
(
TRefByValue
< const
TDesC
>, ...)
|
IMPORT_C void
|
TestCaseFailed
()
|
IMPORT_C void
|
TestCaseNa
()
|
IMPORT_C void
|
TestCasePassed
()
|
IMPORT_C void
|
TestCaseSkipped
()
|
IMPORT_C void
|
WarningL
(const
TDesC
&)
|
IMPORT_C void
|
WarningL
(
TRefByValue
< const
TDesC
>, ...)
|
Protected Member Functions
|
void
|
CloseTagIndentL
(const
TDesC
&)
|
void
|
CloseTagL
(const
TDesC
&)
|
HBufC
*
|
EncodeLC
(const
TDesC
&)
|
TBool
|
IsTransitionLegal
(const
TReportStage
&)
|
void
|
LineFeedL
()
|
void
|
OpenTagIndentL
(const
TDesC
&)
|
void
|
OpenTagIndentL
(const
TDesC
&, const
TDesC
&, const
TDesC
&)
|
void
|
OpenTagL
(const
TDesC
&)
|
void
|
OpenTagL
(const
TDesC
&, const
TDesC
&, const
TDesC
&)
|
void
|
TagL
(const
TDesC
&, const
TDesC
&)
|
void
|
TagL
(const
TDesC
&, const
TDesC
&, const
TDesC
&, const
TDesC
&)
|
void
|
TimeStampedMessageL
(const
TDesC
&, const
TDesC
&)
|
void
|
WriteL
(const
TDesC
&,
RFile
&)
|
void
|
WriteL
(const
TDesC
&)
|
Constructor & Destructor Documentation
CAtsLogger(const TDesC &)
CAtsLogger
|
(
|
const
TDesC
&
|
aName
|
)
|
[private]
|
Member Functions Documentation
BeginTestCaseL(const TDesC &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C void
|
BeginTestCaseL
|
(
|
const
TDesC
&
|
aId,
|
|
const
TDesC
&
|
aExpected = KAtsLoggerNa,
|
|
const
TDesC
&
|
aInfo = KAtsLoggerEmpty,
|
|
const
TDesC
&
|
aVersion = KAtsLoggerEmpty
|
|
)
|
|
BeginTestCaseL()
is called whenever an individual testcase begins
id = unique id of the testcase expected = expected result of the test (if applicable) info = short descritpion of the expected result (if applicable)
Parameters
const
TDesC
& aId
|
|
const
TDesC
& aExpected = KAtsLoggerNa
|
|
const
TDesC
& aInfo = KAtsLoggerEmpty
|
|
const
TDesC
& aVersion = KAtsLoggerEmpty
|
|
BeginTestCaseL(const TDesC &, const TInt, const TDesC &, const TDesC &)
IMPORT_C void
|
BeginTestCaseL
|
(
|
const
TDesC
&
|
aId,
|
|
const
TInt
|
aExpected,
|
|
const
TDesC
&
|
aInfo = KAtsLoggerEmpty,
|
|
const
TDesC
&
|
aVersion = KAtsLoggerEmpty
|
|
)
|
|
BeginTestCaseL()
is called whenever an individual testcase begins
id = unique id of the testcase expected = expected result code of the test (if applicable) info = short descritpion of the expected result (if applicable)
Parameters
const
TDesC
& aId
|
|
const
TInt
aExpected
|
|
const
TDesC
& aInfo = KAtsLoggerEmpty
|
|
const
TDesC
& aVersion = KAtsLoggerEmpty
|
|
BeginTestCaseReportL(const TDesC &, const TDesC &, const TTime &, const TDesC &, const TDesC &)
IMPORT_C void
|
BeginTestCaseReportL
|
(
|
const
TDesC
&
|
aId,
|
|
const
TDesC
&
|
aExpected,
|
|
const
TTime
&
|
aStartTime,
|
|
const
TDesC
&
|
aInfo = KAtsLoggerEmpty,
|
|
const
TDesC
&
|
aVersion = KAtsLoggerEmpty
|
|
)
|
|
BeginTestCaseReportL()
is called whenever an individual testcase report begins
id = unique id of the testcase expected = expected result code of the test (if applicable) startTime= test case starting time info = short descritpion of the expected result (if applicable)
Parameters
const
TDesC
& aId
|
|
const
TDesC
& aExpected
|
|
const
TTime
& aStartTime
|
|
const
TDesC
& aInfo = KAtsLoggerEmpty
|
|
const
TDesC
& aVersion = KAtsLoggerEmpty
|
|
BeginTestCaseReportL(const TDesC &, const TInt, const TTime &, const TDesC &, const TDesC &)
IMPORT_C void
|
BeginTestCaseReportL
|
(
|
const
TDesC
&
|
aId,
|
|
const
TInt
|
aExpected,
|
|
const
TTime
&
|
aStartTime,
|
|
const
TDesC
&
|
aInfo = KAtsLoggerEmpty,
|
|
const
TDesC
&
|
aVersion = KAtsLoggerEmpty
|
|
)
|
|
BeginTestCaseReportL()
is called whenever an individual testcase report begins
id = unique id of the testcase expected = expected result code of the test (if applicable) startTime= test case starting time info = short descritpion of the expected result (if applicable)
Parameters
const
TDesC
& aId
|
|
const
TInt
aExpected
|
|
const
TTime
& aStartTime
|
|
const
TDesC
& aInfo = KAtsLoggerEmpty
|
|
const
TDesC
& aVersion = KAtsLoggerEmpty
|
|
BeginTestReportL()
IMPORT_C void
|
BeginTestReportL
|
(
|
)
|
|
BeginTestReportL()
should be called at the beginning of the program, before any testing begins
BeginTestSetL(const TDesC &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C void
|
BeginTestSetL
|
(
|
const
TDesC
&
|
aFactory = KAtsLoggerNa,
|
|
const
TDesC
&
|
aComponent = KAtsLoggerNa,
|
|
const
TDesC
&
|
aVersion = KAtsLoggerNa,
|
|
const
TDesC
&
|
aDescription = KAtsLoggerEmpty
|
|
)
|
|
BeginTestSetL()
must be called when a new test set begins
factory = component factory whose component is being tested component = name of the software component being tested version = version of the software component description = short, optional description of the batch
Parameters
const
TDesC
& aFactory = KAtsLoggerNa
|
|
const
TDesC
& aComponent = KAtsLoggerNa
|
|
const
TDesC
& aVersion = KAtsLoggerNa
|
|
const
TDesC
& aDescription = KAtsLoggerEmpty
|
|
BufferL(CBufBase *, TInt &, const TDesC &)
Expands buffer and then writes aBuf into it.
CheckDirectoryL(const TDesC &, TChar &)
Checks whether directory exist or not
CloseL()
Closes opened resources. Desctructor calls this if it is not called before.
CloseTagIndentL(const TDesC &)
void
|
CloseTagIndentL
|
(
|
const
TDesC
&
|
aTag
|
)
|
[protected]
|
Closes a tag and descreases indent level.
CloseTagL(const TDesC &)
void
|
CloseTagL
|
(
|
const
TDesC
&
|
aTag
|
)
|
[protected]
|
CommentL(const TDesC &)
IMPORT_C void
|
CommentL
|
(
|
const
TDesC
&
|
aMsg
|
)
|
|
CommentL(TRefByValue< const TDesC >, ...)
ConstructL(TBool)
void
|
ConstructL
|
(
|
TBool
|
aAfterReboot
|
)
|
[private]
|
By default Symbian OS two-phase constructor is private.
ContinueAfterRebootL()
IMPORT_C void
|
ContinueAfterRebootL
|
(
|
)
|
|
DebugL(const TDesC &)
IMPORT_C void
|
DebugL
|
(
|
const
TDesC
&
|
aMsg
|
)
|
|
DebugL()
,
WarningL()
,
ErrorL()
and
CommentL()
as used to place informational messages of appropriate debug level into the test report. These functions can be called anywhere between BeginReportL() and EndReportL().
DebugL(TRefByValue< const TDesC >, ...)
DebugOutput(const TDesC &)
IMPORT_C void
|
DebugOutput
|
(
|
const
TDesC
&
|
aMsg
|
)
|
|
EncodeLC(const TDesC &)
HBufC
*
|
EncodeLC
|
(
|
const
TDesC
&
|
aMsg
|
)
|
[protected]
|
Encodes XML special chararacters from message
EndTestCaseL()
IMPORT_C void
|
EndTestCaseL
|
(
|
)
|
|
EndTestReportL()
IMPORT_C void
|
EndTestReportL
|
(
|
)
|
|
EndTestSetL()
IMPORT_C void
|
EndTestSetL
|
(
|
)
|
|
ErrorL(const TDesC &)
IMPORT_C void
|
ErrorL
|
(
|
const
TDesC
&
|
aMsg
|
)
|
|
ErrorL(TRefByValue< const TDesC >, ...)
ErrorMessage(const TInt &)
IMPORT_C const
TPtrC
|
ErrorMessage
|
(
|
const
TInt
&
|
aError
|
)
|
[static]
|
Returns error message. Also includes base E32 error codes.
FormatDateLC(TDateTime)
Formats given date to a format of yyyy-mm-dd hh:mm:ss
FormatTimeLC(TTimeIntervalMicroSeconds)
Formats given time to a format of hh:mm:ss
IsTransitionLegal(const TReportStage &)
Checks whether report stage transition is legal.
IsValid()
IMPORT_C
TBool
|
IsValid
|
(
|
)
|
|
IsValid()
returns ETrue if this logger is valid and able to write log.
LineFeedL()
void
|
LineFeedL
|
(
|
)
|
[protected]
|
NewL(const TDesC &, TBool)
OpenExistingFileL(const TDesC &)
TInt
|
OpenExistingFileL
|
(
|
const
TDesC
&
|
aFileName
|
)
|
[private]
|
Open existing file if already exist
OpenTagIndentL(const TDesC &)
void
|
OpenTagIndentL
|
(
|
const
TDesC
&
|
aTag
|
)
|
[protected]
|
Opens a tag and increases indent level.
OpenTagIndentL(const TDesC &, const TDesC &, const TDesC &)
void
|
OpenTagIndentL
|
(
|
const
TDesC
&
|
aTag,
|
|
const
TDesC
&
|
aAttribute,
|
|
const
TDesC
&
|
aValue
|
|
)
|
[protected]
|
Opens a tag with attribute having value and increases indent level.
OpenTagL(const TDesC &)
void
|
OpenTagL
|
(
|
const
TDesC
&
|
aTag
|
)
|
[protected]
|
OpenTagL(const TDesC &, const TDesC &, const TDesC &)
void
|
OpenTagL
|
(
|
const
TDesC
&
|
aTag,
|
|
const
TDesC
&
|
aAttribute,
|
|
const
TDesC
&
|
aValue
|
|
)
|
[protected]
|
Opens a tag with attribute and value.
RawLogL(TRefByValue< const TDesC >, ...)
ReplaceFileL(const TDesC &)
TInt
|
ReplaceFileL
|
(
|
const
TDesC
&
|
aFileName
|
)
|
[private]
|
Replaces file if already exist
SaveForRebootL()
IMPORT_C void
|
SaveForRebootL
|
(
|
)
|
|
SetDebugOutput(TBool)
IMPORT_C void
|
SetDebugOutput
|
(
|
TBool
|
aFlag
|
)
|
|
Set this to ETrue if XML log should be written to the debug port also.
SetFullReporting(TBool)
IMPORT_C void
|
SetFullReporting
|
(
|
TBool
|
aFlag
|
)
|
|
Set this to ETrue if client should use full set of reporting methods
SetIndentation(TBool)
IMPORT_C void
|
SetIndentation
|
(
|
TBool
|
aFlag
|
)
|
|
Set this to ETrue if XML log should have indentation. This only adds human readability.
SetTestCaseResultL(const TInt)
IMPORT_C void
|
SetTestCaseResultL
|
(
|
const
TInt
|
aResult
|
)
|
|
SetTestCaseResultL(const TDesC &)
IMPORT_C void
|
SetTestCaseResultL
|
(
|
const
TDesC
&
|
aResult = KAtsLoggerEmpty
|
)
|
|
Parameters
const
TDesC
& aResult = KAtsLoggerEmpty
|
|
SetTestCaseResultL(TRefByValue< const TDesC >, ...)
TagL(const TDesC &, const TDesC &)
void
|
TagL
|
(
|
const
TDesC
&
|
aTag,
|
|
const
TDesC
&
|
aMsg
|
|
)
|
[protected]
|
Outputs message closed by the tags.
TagL(const TDesC &, const TDesC &, const TDesC &, const TDesC &)
void
|
TagL
|
(
|
const
TDesC
&
|
aTag,
|
|
const
TDesC
&
|
aMsg,
|
|
const
TDesC
&
|
aAttribute,
|
|
const
TDesC
&
|
aValue
|
|
)
|
[protected]
|
Adds attribute with value to the message and outputs message closed by the tags.
TestCaseFailed()
IMPORT_C void
|
TestCaseFailed
|
(
|
)
|
|
TestCaseFailed()
must be called between calls to BeginTestCase() and EndTestCase(). This results test case to be failed.
TestCaseNa()
IMPORT_C void
|
TestCaseNa
|
(
|
)
|
|
TestCaseNa()
must be called between calls to BeginTestCase() and EndTestCase(). This results test case to be N/A.
TestCasePassed()
IMPORT_C void
|
TestCasePassed
|
(
|
)
|
|
TestCasePassed()
must be called between calls to BeginTestCase() and EndTestCase(). This results test case to be passed.
TestCaseSkipped()
IMPORT_C void
|
TestCaseSkipped
|
(
|
)
|
|
TestCaseSkipped()
must be called between calls to BeginTestCase() and EndTestCase(). This results test case to be skipped.
TimeStampedMessageL(const TDesC &, const TDesC &)
void
|
TimeStampedMessageL
|
(
|
const
TDesC
&
|
aTag,
|
|
const
TDesC
&
|
aMsg
|
|
)
|
[protected]
|
WarningL(const TDesC &)
IMPORT_C void
|
WarningL
|
(
|
const
TDesC
&
|
aMsg
|
)
|
|
WarningL(TRefByValue< const TDesC >, ...)
WriteBufferToDebugPortL(CBufBase *)
TInt
|
WriteBufferToDebugPortL
|
(
|
CBufBase
*
|
aCBufBase
|
)
|
[private]
|
Writes whole buffer to the debug port. Does not reset buffer.
WriteBufferToFileL(CBufBase *, const TDesC &)
Writes whole buffer to a file. Does not reset buffer.
WriteL(const TDesC &, RFile &)
void
|
WriteL
|
(
|
const
TDesC
&
|
aData,
|
|
RFile
&
|
aFile
|
|
)
|
[protected]
|
Writes data to the specified file.
WriteL(const TDesC &)
void
|
WriteL
|
(
|
const
TDesC
&
|
aData
|
)
|
[protected]
|
Writes data to the XML file.
Member Enumerations Documentation
Enum TReportStage
Enumerators
ENone
|
|
EUninitialized
|
|
EBeginTestReport
|
|
EBeginTestSet
|
|
EBeginTestCase
|
|
ESetTestCaseVerdict
|
|
EEndTestCase
|
|
EEndTestSet
|
|
EEndTestReport
|
|
EFinished
|
|
Member Data Documentation
TBool
iDoDebugOutput
TBool
|
iDoDebugOutput
|
[private]
|
TBool
iDoIndentation
TBool
|
iDoIndentation
|
[private]
|
TBool
iFullReportingMode
TBool
|
iFullReportingMode
|
[private]
|
TBool
iInTestCase
TBool
|
iInTestCase
|
[private]
|
int iIndentLevel
int
|
iIndentLevel
|
[private]
|
TBool
iLineFeedDone
TBool
|
iLineFeedDone
|
[private]
|
TFileName
iRawLogFileName
CAtsLogger::TReportStage
iReportStage
CAtsLogger::TTestCase
iTestCase
CAtsLogger::TTestSet
iTestSet
TInt
iXmlBufferLength
TInt
|
iXmlBufferLength
|
[private]
|
TFileName
iXmlLogFileName
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.