script |
given test page |
Testpage |
and Test System setup is |
!define TEST_SYSTEM {slim}
!path lib/*.jar
|
and Setup content is |
!define SLIM_FLAGS {-v}
|import |
|fitnesse.slim.test|
|
and Test content is |
!-
import |
fitnesse.slim.test |
java.lang |
Wrong method parameter types raise a meaningful exception
script |
test slim |
one int |
twenty |
Wrong constructor parameter types raise a meaningful exception
TODO this is not as good as for methods
Wrong static method parameter types raise a meaningful exception
called as constructor
script |
java.time.Instant.now |
8.9 |
script |
java.time.Instant.ofEpochSecond |
Hello |
Correct calls
script |
java.lang.String.valueOf |
5 |
called as method
script |
Boolean |
0 |
$sPass= |
String.valueOf |
5 |
$sFail= |
java.time.Instant.ofEpochSecond |
aWrongValue |
$sFail= |
java.time.Instant.from |
9.8 |
Known Limitations (TODO)
Would expect that this uses the String(String) constructor but it rather uses String(Character) and truncates the string
script |
String |
Hello |
check |
to string |
Hello |
check |
get class |
class java.lang.String |
-!
|
when page |
Testpage |
is tested and HTML is extracted |
then |
1 |
assertions pass, |
1 |
fail, |
0 |
are ignored |
6 |
exceptions thrown |
and cell |
Could not invoke constructor for TestSlim.1. |
has result |
error |
and cell |
No converter for java.time.Clock.* |
has result |
error |
and cell |
Can't convert Hello to long.*? |
has result |
error |
and cell |
Can't convert aWrongValue to long.*? |
has result |
error |
and cell |
No converter for java.time.temporal.TemporalAccessor.*? |
has result |
error |
and cell |
Can't convert twenty to integer.*? |
has result |
error |
ensure |
content contains |
<span class="fail">expected [H<span class="diff">ello</span>]</span> |
and cell |
expected.* |
has result |
fail |
show Symbol |
$HTML_Result |
note |
As a TDD developer
To have fast turnaround times
I need to see the exceptions stack trace in the execution log with verbose logging enabled
|
get collapsed executon log for page |
Testpage |
and should contain |
java.lang.NumberFormatException: For input string: "twenty" |
and should contain |
java.lang.NumberFormatException: For input string: "five" |
and should contain |
NO_CONVERTER_FOR_ARGUMENT_NUMBER java.time.Clock |
and should contain |
java.lang.NumberFormatException: For input string: "Hello" |
and should contain |
java.lang.NumberFormatException: For input string: "aWrongValue" |
and should contain |
NO_CONVERTER_FOR_ARGUMENT_NUMBER java.time.temporal.TemporalAccessor. |