|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.uds.cs.st.dd.core.tester.JUnitTester
This tester is used for automatic JUnit testing. A JUnit-test is started in a separate thread. As soon as it is terminated, the test outcome will be returned. Note that the parameter c of the test function is not used (since all JUnit tests are executed without parameters).
Field Summary | |
private int |
precision
Precision of the test outcomes. |
static int |
PRECISION_HIGH
High precision: return DD.FAIL only if stack traces and messages * are identical. |
static int |
PRECISION_LOW
Low precision: whenever a JUnit test fails, return DD.FAIL. |
static int |
PRECISION_NORMAL
Normal precision: return DD.FAIL only if the current failing * stack trace equals the original failing stack trace (so, the * failure occurs at the same location), return DD.UNRESOLVED, * if the test fails at a different location. |
private int |
testCounter
Counter that is increased each time, a test is executed (for debugging * purpose only). |
protected junit.framework.Test |
testObject
The test object that runs the tests. |
private Throwable |
throwable
Original exception trace of the failing test. |
protected long |
time
Time the initial test has taken to complete its run. |
private static int |
TIME_MULTIPLICATOR
Determines the factor that is multiplied with the time to abort a test * case. |
private static int |
TIME_OFFSET
Determines the minimum time in milliseconds that has to pass until * a test is considered to be non-determinating. |
Constructor Summary | |
JUnitTester()
Creates a new JUnitTester object with no attached test object. |
|
JUnitTester(junit.framework.Test testObject)
Creates a new JUnitTester object and links it with the specified * test object. |
Method Summary | |
private int |
compareElements(StackTraceElement[] origElems,
StackTraceElement[] currElems)
Compares two StackTraceElement arrays as described in compareTraces. |
private int |
compareTraces(junit.framework.TestFailure fail)
Compares two failure traces. |
private int |
determineTestOutcome(junit.framework.TestResult result)
Determines the test outcome based on the precision. |
junit.framework.Test |
getTestObject()
|
void |
setPrecision(int precision)
Sets the test outcome precision. |
void |
setTestObject(junit.framework.Test testObject)
Sets the current JUnit-test. |
void |
setThrowable(Throwable throwable)
Sets the original failing exception. |
int |
test(TConfiguration c)
Performs a JUnit test and returns the test outcome. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PRECISION_LOW
public static final int PRECISION_NORMAL
public static final int PRECISION_HIGH
private int precision
private Throwable throwable
private static final int TIME_OFFSET
private static final int TIME_MULTIPLICATOR
protected junit.framework.Test testObject
protected long time
private int testCounter
Constructor Detail |
public JUnitTester()
public JUnitTester(junit.framework.Test testObject)
Method Detail |
private int compareElements(StackTraceElement[] origElems, StackTraceElement[] currElems)
private int compareTraces(junit.framework.TestFailure fail)
private int determineTestOutcome(junit.framework.TestResult result)
public int test(TConfiguration c)
test
in interface Tester
public junit.framework.Test getTestObject()
public void setTestObject(junit.framework.Test testObject)
testObject
- JUnit-test to set.public void setThrowable(Throwable throwable)
public void setPrecision(int precision)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |