KXQTS::TestResult Class Reference

represents the result produced by running a test case. More...

#include <TestResult.h>

List of all members.

Public Types

typedef QList< QPointer< TestResult > > List
enum  Status { Unknown = 0, Pass, Fail, NotTested }

Public Member Functions

QString asSerialized () const
ASTItemastTree () const
QString comment () const
Patternist::Item::List items () const
Patternist::Message::List messages () const
void setComment (const QString &comment)
Status status () const
 TestResult (const QString &testName, const Status status, ASTItem *astTree, const Patternist::Message::List &errors, const Patternist::Item::List &items, const QString &serialized)
void toXML (XMLWriter &receiver) const
virtual ~TestResult ()

Static Public Member Functions

static QString displayName (const TestResult::Status status)
static Status statusFromString (const QString &string)


Detailed Description

represents the result produced by running a test case.

This information TestResult houses is:

Author:
Frans Englich <frans.englich@telia.com>

Definition at line 47 of file TestResult.h.


Member Typedef Documentation

typedef QList<QPointer<TestResult> > KXQTS::TestResult::List

A list of TestResult instances.

Definition at line 78 of file TestResult.h.


Member Enumeration Documentation

enum KXQTS::TestResult::Status

Enumerator:
Unknown  Used when the status is unknown.
Pass  The test case passed.
Fail  The test case failed.
NotTested  The test was not run. Similar to "SKIP".

Definition at line 52 of file TestResult.h.


Constructor & Destructor Documentation

TestResult::TestResult ( const QString &  testName,
const Status  status,
ASTItem astTree,
const Patternist::Message::List errors,
const Patternist::Item::List items,
const QString &  serialized 
)

Constructs a TestResult.

Parameters:
testName the name of the test. For example, Literal-001.
astTree may be null, signalling no AST being available, or point to one.
status the result status of running the test-case. Whether the test-case passed or failed, and so forth.
errors the errors and warnings that were reported while running the test-case
items the XDM items that were outputted, if any
serialized the output when serialized

Definition at line 58 of file TestResult.cpp.


Member Function Documentation

QString TestResult::asSerialized (  )  const

Returns:
the output of this test result(if any) as when being serialized.

Definition at line 122 of file TestResult.cpp.

Referenced by KXQTS::TestResultView::displayTestResult().

Here is the caller graph for this function:

QString TestResult::displayName ( const TestResult::Status  status  )  [static]

Returns:
a string representation for status, as per the anonymous type inside the type test-case, in XQTSResult.xsd. For example, if status is NotTested, is "not tested" returned.

Definition at line 25 of file TestResult.cpp.

References Fail, NotTested, Pass, and Unknown.

Referenced by KXQTS::XQTSTestCase::data(), KXQTS::TestResultView::displayTestResult(), and toXML().

Here is the caller graph for this function:

void TestResult::toXML ( XMLWriter receiver  )  const

Serializes itself to receiver, into a test-case element, as per XQTSResult.xsd.

Definition at line 79 of file TestResult.cpp.

References displayName(), KXQTS::XMLWriter::endElement(), and KXQTS::XMLWriter::startElement().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Thu Feb 8 14:54:31 2007 for Patternist by  doxygen 1.5.1