Hi All, (Dan!)

I just wanted to write a short note to say that I have been using the Isis 
junit viewer to write application tests for an application that I have been 
contracted to write.. and I think it works quite well!

Once I realised I had to (and remembered to) wrap the appropriate 
domain classes (and services), the junit viewer has helped me confirm 
such application domain issues as user rights (only certain users can 
see certain properties, access certain methods, etc), and general 
application usage (if I can't write a straight-forward "test" to achieve the 
required functionality - it's too complicated).

Combined with ecl-emma, I have reasonable confidence that both the 
application and the domain classes are reasonably exercised!

At some point, though, it seems that I need to look into ensuring that 
life-cycle methods are also included - it seems that "validate" is not 
being called before persistance - but this is not a blocker if you're 
aware of it.

Anyway - it works, and I'm finding it very useful.

A simple test looks like:

    public void memberCanNotChangeOwnInitials() throws Exception {
        doLogin("voter@saip");

        try {
            wrappedLoggedInMember.setInitials("X");
            fail("Should have been disabled");
        } catch (DisabledException e) {
            // this is good!
        }
    }

Perhaps someone else'll comment on style, but I think these tests are 
quite clear.

Regards,
Kevin

PS: I have also written an authenticator to use a SQL database. I will 
update the authentication, etc, documentation with HOWTOs shortly.


Reply via email to