|
Jtest API | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jtest.JT
General utility class to be used in Jtest test specifications.
Method Summary | |
static void |
addEvent(java.lang.String message)
Adds an event with the string message to the
"Test Case Input".The only purpose for it is to be able to see when certain events happened while the test case was executing. |
static void |
assert(boolean condition)
Asserts that condition is true .If the condition is false then a "Specification Error" will be reported by Jtest. |
static void |
assert(boolean condition,
java.lang.String message)
Asserts that condition is true .If the condition is false then a "Specification Error" will be reported by Jtest. |
static void |
assert(java.lang.String message,
boolean condition)
Asserts that condition is true .If the condition is false then a "Specification Error" will be reported by Jtest. |
protected static java.lang.Object |
makeStubObject(java.lang.Class cl)
Creates a stub object for the class cl . |
static void |
println(java.lang.String text)
Equivalent to System.out.println (text) .It will always print the text to standard out, even
when running automatic test cases. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void addEvent(java.lang.String message)
message
to the
"Test Case Input".message
- message that identifies the event.public static void assert(boolean condition)
condition
is true
.public static void assert(boolean condition, java.lang.String message)
condition
is true
.message
- message to be used in the error reported.public static void assert(java.lang.String message, boolean condition)
condition
is true
.message
- message to be used in the error reported.protected static java.lang.Object makeStubObject(java.lang.Class cl)
cl
.
Stub objects are very useful when writting user defined stubs. A stub
object is like any other object, with the following differences:Enumeration enum = makeStubObject (Enumeration.class);b) Any method invocation or field reference is an stub even if no stub has been defined for it. If no stub has been defined for it a default stub returning the default initialization value for the method return type or field type is used (i.e.
null
for Object, 0.0d
for double, ...).new java.io.FileInputStream ("what to put here?)"
, one can use:
(FileInputStream) JT.makeStubObject (java.io.FileInputStream.class), this
creates a FileInputStream object, but no constructor is called to
initialize it.
public static void println(java.lang.String text)
System.out.println (text)
.text
to standard out, even
when running automatic test cases.
|
Jtest API | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |