You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Kevin Meyer - KMZ <ke...@kmz.co.za> on 2011/06/30 21:31:31 UTC

junit viewer success story

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.



Re: junit viewer success story

Posted by Dan Haywood <dk...@gmail.com>.
On 04/07/2011 19:30, Kevin Meyer - KMZ wrote:
>
> BTW, I had a look at the Isis sister projects URL, and can't find the
> FitNese (sp?) project - is it lost, or just not yet moved over?
>
It is imported into contrib/initial/import, but the problem with the 
FitNesse viewer is that it depends on FitNesse which is GPL.  Having 
been through the release process I think I can see how this can be made 
compatible with Apache (exclude the dependency, and require the end-user 
to explicitly include the reference to FitNesse themselves).  So I may 
revive it.  Alternatively, it may end up living in apache-extras.org [1]

Cheers
Dan

[1] http://code.google.com/a/apache-extras.org/p/isis-extras/


Re: junit viewer success story

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Hi Dan,

On 3 Jul 2011 at 17:32, Dan Haywood wrote:

> Hi Kevin,
> Thanks for giving this viewer a workout, nice to hear it's been useful.
> 
> If you get a chance I'd be interested in knowing what you make of the 
> BDD viewer (concordion) also.

Every time I read the BDD documentation I get confused...

I can't actually see myself editing XHTML (in addition to Java) to set up 
tests - and (so far) my clients are even less likely than I am!

At the moment, I can get away with a simple "wordy" description of the 
test (without the "words" being enforced) - by appropriately naming my 
@Test annotated methods. I just need to get surefire (or something) to 
generate reports for inclusion in reportbacks! ;)

Perhaps if I get involved with larger teams, or some other business 
condition makes it desireable, I'll revisit the BDD viewer! 

BTW, I had a look at the Isis sister projects URL, and can't find the 
FitNese (sp?) project - is it lost, or just not yet moved over? 

Regards,
Kevin


Re: junit viewer success story

Posted by Dan Haywood <dk...@gmail.com>.
Hi Kevin,
Thanks for giving this viewer a workout, nice to hear it's been useful.

If you get a chance I'd be interested in knowing what you make of the 
BDD viewer (concordion) also.

Cheers
Dan

On 30/06/2011 20:31, Kevin Meyer - KMZ wrote:
> 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.
>
>
>

Re: junit viewer success story

Posted by Kevin Meyer - KMZ <ke...@kmz.co.za>.
Thanks for the responses.

I'm sorting out my thinking by updating the junit viewer documentation.

Once I'm happy with that, I'll see what the next appropriate medium 
might be.

Regards,
Kevin


On 1 Jul 2011 at 9:31, Mark Struberg wrote:

> +1
> 
> We also have project specific blogs on
> 
> http://blogs.apache.org/
> 
> I will ask on general if this is also available for incubator projects.
> 
> LieGrue,
> strub
> 
> --- On Thu, 6/30/11, Mohammad Nour El-Din wrote:
> 
> > Subject: Re: junit viewer success story
> > To: isis-dev@incubator.apache.org
> > Date: Thursday, June 30, 2011, 8:09 PM
> >
> > Perfect why not to write a blog or an
> > article about it and we publish
> > it on our site ?


Re: junit viewer success story

Posted by Mohammad Nour El-Din <no...@gmail.com>.
I am looking forward it :D

On Sun, Jul 3, 2011 at 6:33 PM, Dan Haywood <dk...@gmail.com> wrote:
> Mark, Mohammad,
>
> good idea... I'll request an account and start posting there once I get our
> release out (currently building a new RC for voting on).
>
> Cheers
> Dan
>
>
> On 01/07/2011 09:31, Mark Struberg wrote:
>>
>> +1
>>
>> We also have project specific blogs on
>>
>> http://blogs.apache.org/
>>
>> I will ask on general if this is also available for incubator projects.
>>
>> LieGrue,
>> strub
>>
>> --- On Thu, 6/30/11, Mohammad Nour El-Din<no...@gmail.com>  wrote:
>>
>>> From: Mohammad Nour El-Din<no...@gmail.com>
>>> Subject: Re: junit viewer success story
>>> To: isis-dev@incubator.apache.org
>>> Date: Thursday, June 30, 2011, 8:09 PM
>>> Perfect why not to write a blog or an
>>> article about it and we publish
>>> it on our site ?
>>>
>>> On Thu, Jun 30, 2011 at 9:31 PM, Kevin Meyer - KMZ<ke...@kmz.co.za>
>>> wrote:
>>>>
>>>> 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.
>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks
>>> - Mohammad Nour
>>>   Author of (WebSphere Application Server Community
>>> Edition 2.0 User Guide)
>>>   http://www.redbooks.ibm.com/abstracts/sg247585.html
>>> - LinkedIn: http://www.linkedin.com/in/mnour
>>> - Blog: http://tadabborat.blogspot.com
>>> ----
>>> "Life is like riding a bicycle. To keep your balance you
>>> must keep moving"
>>> - Albert Einstein
>>>
>>> "Writing clean code is what you must do in order to call
>>> yourself a
>>> professional. There is no reasonable excuse for doing
>>> anything less
>>> than your best."
>>> - Clean Code: A Handbook of Agile Software Craftsmanship
>>>
>>> "Stay hungry, stay foolish."
>>> - Steve Jobs
>>>
>



-- 
Thanks
- Mohammad Nour
  Author of (WebSphere Application Server Community Edition 2.0 User Guide)
  http://www.redbooks.ibm.com/abstracts/sg247585.html
- LinkedIn: http://www.linkedin.com/in/mnour
- Blog: http://tadabborat.blogspot.com
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

"Writing clean code is what you must do in order to call yourself a
professional. There is no reasonable excuse for doing anything less
than your best."
- Clean Code: A Handbook of Agile Software Craftsmanship

"Stay hungry, stay foolish."
- Steve Jobs

Re: junit viewer success story

Posted by Dan Haywood <dk...@gmail.com>.
Mark, Mohammad,

good idea... I'll request an account and start posting there once I get 
our release out (currently building a new RC for voting on).

Cheers
Dan


On 01/07/2011 09:31, Mark Struberg wrote:
> +1
>
> We also have project specific blogs on
>
> http://blogs.apache.org/
>
> I will ask on general if this is also available for incubator projects.
>
> LieGrue,
> strub
>
> --- On Thu, 6/30/11, Mohammad Nour El-Din<no...@gmail.com>  wrote:
>
>> From: Mohammad Nour El-Din<no...@gmail.com>
>> Subject: Re: junit viewer success story
>> To: isis-dev@incubator.apache.org
>> Date: Thursday, June 30, 2011, 8:09 PM
>> Perfect why not to write a blog or an
>> article about it and we publish
>> it on our site ?
>>
>> On Thu, Jun 30, 2011 at 9:31 PM, Kevin Meyer - KMZ<ke...@kmz.co.za>
>> wrote:
>>> 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.
>>>
>>>
>>
>>
>> -- 
>> Thanks
>> - Mohammad Nour
>>    Author of (WebSphere Application Server Community
>> Edition 2.0 User Guide)
>>    http://www.redbooks.ibm.com/abstracts/sg247585.html
>> - LinkedIn: http://www.linkedin.com/in/mnour
>> - Blog: http://tadabborat.blogspot.com
>> ----
>> "Life is like riding a bicycle. To keep your balance you
>> must keep moving"
>> - Albert Einstein
>>
>> "Writing clean code is what you must do in order to call
>> yourself a
>> professional. There is no reasonable excuse for doing
>> anything less
>> than your best."
>> - Clean Code: A Handbook of Agile Software Craftsmanship
>>
>> "Stay hungry, stay foolish."
>> - Steve Jobs
>>

Re: junit viewer success story

Posted by Mark Struberg <st...@yahoo.de>.
+1

We also have project specific blogs on

http://blogs.apache.org/

I will ask on general if this is also available for incubator projects.

LieGrue,
strub

--- On Thu, 6/30/11, Mohammad Nour El-Din <no...@gmail.com> wrote:

> From: Mohammad Nour El-Din <no...@gmail.com>
> Subject: Re: junit viewer success story
> To: isis-dev@incubator.apache.org
> Date: Thursday, June 30, 2011, 8:09 PM
> Perfect why not to write a blog or an
> article about it and we publish
> it on our site ?
> 
> On Thu, Jun 30, 2011 at 9:31 PM, Kevin Meyer - KMZ <ke...@kmz.co.za>
> wrote:
> > 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.
> >
> >
> >
> 
> 
> 
> -- 
> Thanks
> - Mohammad Nour
>   Author of (WebSphere Application Server Community
> Edition 2.0 User Guide)
>   http://www.redbooks.ibm.com/abstracts/sg247585.html
> - LinkedIn: http://www.linkedin.com/in/mnour
> - Blog: http://tadabborat.blogspot.com
> ----
> "Life is like riding a bicycle. To keep your balance you
> must keep moving"
> - Albert Einstein
> 
> "Writing clean code is what you must do in order to call
> yourself a
> professional. There is no reasonable excuse for doing
> anything less
> than your best."
> - Clean Code: A Handbook of Agile Software Craftsmanship
> 
> "Stay hungry, stay foolish."
> - Steve Jobs
> 

Re: junit viewer success story

Posted by Mohammad Nour El-Din <no...@gmail.com>.
Perfect why not to write a blog or an article about it and we publish
it on our site ?

On Thu, Jun 30, 2011 at 9:31 PM, Kevin Meyer - KMZ <ke...@kmz.co.za> wrote:
> 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.
>
>
>



-- 
Thanks
- Mohammad Nour
  Author of (WebSphere Application Server Community Edition 2.0 User Guide)
  http://www.redbooks.ibm.com/abstracts/sg247585.html
- LinkedIn: http://www.linkedin.com/in/mnour
- Blog: http://tadabborat.blogspot.com
----
"Life is like riding a bicycle. To keep your balance you must keep moving"
- Albert Einstein

"Writing clean code is what you must do in order to call yourself a
professional. There is no reasonable excuse for doing anything less
than your best."
- Clean Code: A Handbook of Agile Software Craftsmanship

"Stay hungry, stay foolish."
- Steve Jobs