Saturday, November 3, 2007

StackStripesExtension

Source code: stackstripes-shaoxuan-1.0.1104.zip

Thanks to the reading pages and the lectures in class, I did not encounter much problems in this assignment. The only one problem I faced is emma failed at the beginning. This problem is discussed in our google group. I finally found out that it is because the default directory where the coverage.ec will be save is relative to the directory where you launch the tomcat. So there seems no universal environment independent approach to this problem. Even if we change the output directory to an absolute path, it will still need to do different setting in different environment, at least in different OS such as Mac and Windows. As I am used to launch my tomcat from HOME directory, I modified the emma.build.xml to look for coverage.ec in HOME directory.

EMMA coverage:
[concat] Emma Coverage summary
[concat] class: 100% (2/2)
[concat] method: 100% (18/18)
[concat] block: 98% (141/144)
[concat] line: 96% (46/48)

The only 2 lines that are not tested is the statement that catch EmptyStackException in doubleIt when calling in action bean. However, these 2 lines will never been reach because the the empty stack is checked in doubleIt method in stackModel. But I still what to keep these 2 lines of code in case the program will break down in the future, and keep it that way rather than just throws it because "nothing should go wrong in the view".

No comments: