How do I see what is tested?

2 views
Skip to first unread message

whiskerz

unread,
Jul 19, 2011, 4:25:45 AM7/19/11
to coding kata
Hi,

thanks for all those katas, I really enjoy working my way upward.
However the higher I get the more I would like to see exactly why my
tests fail. Also I noticed the tip on the page saying to actually make
the tests fail in order to see what is going on.

The only thing I ever see when viewing the surefire reports is a
stacktrace saying "AssertionError expected: <true> but was <false>".
I've tried this with the backwards talk, fibonacci, fizz-buzz and
several others.

Can anyone point me to what I might be doing wrong? For example for
the fibonacci I would have actually expected something along the lines
of a message telling me that for the input "6" the expected output was
"8" but the real output was "6" or something like that.

Thanks and take care,

whizz

stephanos

unread,
Jul 19, 2011, 10:57:50 AM7/19/11
to coding kata
Hm, normally there should be a "list of errors" in the 'codingkata'
block - something like:

######################################################
#
# TESTS (total: 8, passed: 1):
#
# (1) EXPECTED '21' FOR [ 8 ] GOT '3'
# (2) EXPECTED '610' FOR [ 15 ] GOT '89'
# (3) EXPECTED '3' FOR [ 4 ] GOT '1'
# (4) EXPECTED '8' FOR [ 6 ] GOT '1'
# (5) EXPECTED '6765' FOR [ 20 ] GOT '987'
# (6) EXPECTED '34' FOR [ 9 ] GOT '5'
# (8) EXPECTED '89' FOR [ 11 ] GOT '13'
#
######################################################

Please check your console / the log.txt (in target/) for this.
I'd also recommend using an IDE (e.g. Netbeans/Eclipse) to execute the
katas, it's easier to view the log.

whiskerz

unread,
Jul 20, 2011, 3:46:46 AM7/20/11
to coding kata
meh console was too small, the log always scrolled past so fast that I
didn't even see one being shown.

Thanks for the tipp! Also found the log.txt in target so I should be
all set now :-).

On a side note, I tried to run mvn clean test so that package and
install routines are not executed resulting in the test goal output to
be directly visible for me (using eclipse and I usually have the
console at the lower end of the screen just about 10 lines high).
However when just running the test goal, no tests are executed at all.
Is this intended or an error?

stephanos

unread,
Jul 20, 2011, 9:42:02 AM7/20/11
to coding kata
Hm, it's been a while since I initially wrote the site, but I think
for some reason the testing and packaging are tied together. I think
it's because 'surefire' is not actually performing them, but my
internal code is.
Reply all
Reply to author
Forward
0 new messages