aceptance/integration/unit testing

1 view
Skip to first unread message

colaru

unread,
Jan 18, 2011, 1:32:41 PM1/18/11
to classic dev
Hi Richard.

I understand that you prefer to make unit/integration testing. We must
talk about how we want to do the testing.

As I know we can have this types of tests:

- acceptance testing (maybe using BDD with a framework like http://jbehave.org/
(runnable stories) - nice to have this - will keep the spec clean)
this can be done by you from interface without calling the code
- integration testing (at the services layer for me) - and also in the
presentation layer for you if you want; for DAO I think is unit
testing and not integration because we cannot think at DAO without
database.
- unit testing (at services level mocking DAO's for me) - Also at the
presentation level for you (mocking in GWT the services); at the DAO
level for me

So for me I need:

In general: JUnit 4
For DAO: http://www.dbmaintain.org/overview.html or http://www.dbunit.org/
For mocking: EasyMock or dynamock or other mocking framework

Do you have any preference in what kind of tests to make and utility
frameworks to be used?

transmeta01

unread,
Jan 18, 2011, 7:49:53 PM1/18/11
to classic dev
Hi Cristian,

I don't thing there is a necessity for integration testing, but we
definitely need to unit and integration test. Other tests we should
also include would probably include load tests so we can have some
data for capacity planning.

I am not familiar with http://jbehave.org/, but I will definitely
check it. Thank you for the link. However, the main thing is to keep
things simple and flexible. We could also test our user stories
directly in the unit tests.

I agree about Junit and Easymock. Junit 4.7 library depency is already
in the pom file. You can add Easymock.

I am a little familiar with dbunit; but I am not familiar with
http://www.dbmaintain.org/. I will check that too.

All in all I have no preference for any testing framework. The main
point is to get things tested in a way we can be confident that our
tests are sensible (breath and scope is adequate). As long as we don't
spend more time setting up test infrastructure than writing actual,
usable code. We have to strike a good signal vs noise ratio. For the
database, you can test everything you need to give you confidence that
the DAO is working as it should. So choose whatever tool you think is
best.

For me, the UI testing involves inspection of the DOM resulting from
the GWT code, that the visual part; i.e making sure the UI looks as
the intended (the CSS is corretly applied) and making sure that the
ApplicationController calls the right URI for the right widget, with
the right header params.

I am setting a local Hudson continuous Build server on my machine. I
am looking for a service on the cloud that we can use. That way we can
both see what is happening. I will let you know as soon as I find a
suitable host.

Richard

On Jan 18, 1:32 pm, colaru <col...@gmail.com> wrote:
> Hi Richard.
>
> I understand that you prefer to make unit/integration testing. We must
> talk about how we want to do the testing.
>
> As I know we can have this types of tests:
>
> - acceptance testing (maybe using BDD with a framework likehttp://jbehave.org/
> (runnable stories) - nice to have this - will keep the spec clean)
> this can be done by you from interface without calling the code
> - integration testing (at the services layer for me) - and also in the
> presentation layer for you if you want; for DAO I think is unit
> testing and not integration because we cannot think at DAO without
> database.
> - unit testing (at services level mocking DAO's for me) -  Also at the
> presentation level for you (mocking in GWT the services); at the DAO
> level for me
>
> So for me I need:
>
> In general: JUnit 4
> For DAO:http://www.dbmaintain.org/overview.htmlorhttp://www.dbunit.org/

Cristian Olaru

unread,
Jan 19, 2011, 2:39:12 AM1/19/11
to class...@googlegroups.com
Hi Richard.

I can recommend you this for Hudson: http://www.cloudbees.com/dev.cb

Regards...
--
Cristian Olaru
weblog: http://olaru.blogspot.com
mobile: 0743163039

Richard Mutezintare

unread,
Jan 19, 2011, 9:30:49 AM1/19/11
to class...@googlegroups.com
Thanks I will check it out.

Richard

transmeta01

unread,
Jan 19, 2011, 10:32:28 AM1/19/11
to classic dev
Check out http://seleniumhq.org/docs/05_selenium_rc.html, seems pretty
complete.

Richard

On Jan 19, 9:30 am, Richard Mutezintare <transmet...@gmail.com> wrote:
> Thanks I will check it out.
>
> Richard
>
>
>
>
>
>
>
> On Wed, Jan 19, 2011 at 2:39 AM, Cristian Olaru <col...@gmail.com> wrote:
> > Hi Richard.
>
> > I can recommend you this for Hudson:http://www.cloudbees.com/dev.cb
>
> > Regards...
>
> > On Wed, Jan 19, 2011 at 2:49 AM, transmeta01 <transmet...@gmail.com>wrote:
>
> >> Hi Cristian,
>
> >> I don't thing there is a necessity for integration testing, but we
> >> definitely need to unit and integration test. Other tests we should
> >> also include would probably include load tests so we can have some
> >> data for capacity planning.
>
> >> I am not familiar withhttp://jbehave.org/, but I will definitely

colaru

unread,
Jan 21, 2011, 4:55:21 PM1/21/11
to classic dev
Hi Richard.

Finally I committed on HG a first working example of a DAO test (I
made a commit in this evening). Will be easy extended to other DAO's.
And alto I will use it to make integration tests of the services
layer.

I used Unitils http://www.unitils.org/summary.html and is a good
integration for all the testing frameworks I described in the last
mail. Is the best choice for testing the back-end. Unfortunately I
find some constrains: it doesn't support Hibernate 3.5 - JPA 2 by
default. I must find a solution for this - but now I use for testing
JPA 1 - it work fine with the annotated classes. I will find a
solution for this. It has integration with Mock objects and this will
make easy to unit test also the services.

Regards,
Cristian

On Jan 19, 4:30 pm, Richard Mutezintare <transmet...@gmail.com> wrote:
> Thanks I will check it out.
>
> Richard
>
> On Wed, Jan 19, 2011 at 2:39 AM, Cristian Olaru <col...@gmail.com> wrote:
> > Hi Richard.
>
> > I can recommend you this for Hudson:http://www.cloudbees.com/dev.cb
>
> > Regards...
>
> > On Wed, Jan 19, 2011 at 2:49 AM, transmeta01 <transmet...@gmail.com>wrote:
>
> >> Hi Cristian,
>
> >> I don't thing there is a necessity for integration testing, but we
> >> definitely need to unit and integration test. Other tests we should
> >> also include would probably include load tests so we can have some
> >> data for capacity planning.
>
> >> I am not familiar withhttp://jbehave.org/, but I will definitely

Richard Mutezintare

unread,
Jan 21, 2011, 6:35:54 PM1/21/11
to class...@googlegroups.com

Hi Cristian, thanks for the feedback. I will look @ the code and give you my feedback.

Regards
Richard

Richard Mutezintare

unread,
Jan 21, 2011, 8:22:01 PM1/21/11
to class...@googlegroups.com

Hi Cristian, make site it works with librairies and their version as specified in the pom.

Regards
Richard

colaru

unread,
Jan 22, 2011, 5:35:40 AM1/22/11
to classic dev
Hi Richard.

I want a confirmation from you that signatures for services are fine
defined (or in an acceptable state for how you will use them from
presentation) because I already started to implement and test them.
For us the services layer will be the interface for us and I want to
be shore I implement the right services that are needed by you.

Regards...

On Jan 22, 3:22 am, Richard Mutezintare <transmet...@gmail.com> wrote:
> Hi Cristian, make site it works with librairies and their version as
> specified in the pom.
>
> Regards
> Richard
> On Jan 21, 2011 4:55 PM, "colaru" <col...@gmail.com> wrote:
>
> > Hi Richard.
>
> > Finally I committed on HG a first working example of a DAO test (I
> > made a commit in this evening). Will be easy extended to other DAO's.
> > And alto I will use it to make integration tests of the services
> > layer.
>
> > I used Unitilshttp://www.unitils.org/summary.htmland is a good

transmeta01

unread,
Jan 22, 2011, 2:07:39 PM1/22/11
to classic dev
Hi Cristian, the current interfaces are just a starting point. They
are not complete. In the service package, you should find an interface
for each one of the module in the user stories list. You can change
the interfaces, so long as the all the user stories (i.e feature are
complete) are implemented. You can start implementation and unit test,
one module at the time. If you have any questions, let me know.

Regards
Richard

On Jan 22, 5:35 am, colaru <col...@gmail.com> wrote:
> Hi Richard.
>
> I want a confirmation from you that signatures for services are fine
> defined (or in an acceptable state for how you will use them from
> presentation) because I already started to implement and test them.
> For us the services layer will be the interface for us and I want to
> be shore I implement the right services that are needed by you.
>
> Regards...
>
> On Jan 22, 3:22 am, Richard Mutezintare <transmet...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Cristian, make site it works with librairies and their version as
> > specified in the pom.
>
> > Regards
> > Richard
> > On Jan 21, 2011 4:55 PM, "colaru" <col...@gmail.com> wrote:
>
> > > Hi Richard.
>
> > > Finally I committed on HG a first working example of a DAO test (I
> > > made a commit in this evening). Will be easy extended to other DAO's.
> > > And alto I will use it to make integration tests of the services
> > > layer.
>
> > > I used Unitilshttp://www.unitils.org/summary.htmlandis a good

Cristian Olaru

unread,
Jan 22, 2011, 4:04:41 PM1/22/11
to class...@googlegroups.com
Hi Richard.

Today I also make a switch from MYSQL to HSQLDB. Now the tests (services and DAO) are running by default on HSQLDB. We can easy switch again to Mysql from configurations. Will be difficult to maintain 2 schema - there are big differences in syntax. But I will try.

I started to implement and test around User/Authentication module. Everything is fine. I will continue with the "Order management" module.

- I will suffix all services interfaces with "Service" and I will create a new package for implementations
- the name "order" is not fine for the table and the entity- I have problems in HSQLDB scrip because is a conflict with the SQL sintax (ORDER BY...). so, we must find a new name for it: orders

I still have some problems in running the application:

[INFO] [WARN] Failed to load servlet class 'ca.ioniq.server.GreetingServiceImpl' declared in 'ca.ioniq.classicJUnit.JUnit'
[INFO] java.lang.ClassNotFoundException: ca.ioniq.server.GreetingServiceImpl

Maybe this class is not committed?

Regards...

Richard Mutezintare

unread,
Jan 22, 2011, 4:56:50 PM1/22/11
to class...@googlegroups.com
Hi Cristiian, thanks for the update. 

On Sat, Jan 22, 2011 at 4:04 PM, Cristian Olaru <col...@gmail.com> wrote:
Hi Richard.

Today I also make a switch from MYSQL to HSQLDB. Now the tests (services and DAO) are running by default on HSQLDB. We can easy switch again to Mysql from configurations. Will be difficult to maintain 2 schema - there are big differences in syntax. But I will try.

you can configure Hibernate to generate the dialect, and specify to create-drop the tables of the db you want. That is what I do when I am in dev mode and still discovery my entities and tables structure. Or maybe there is a better way??? I will think about it and let you know.
 


I started to implement and test around User/Authentication module. Everything is fine. I will continue with the "Order management" module.

That is good new. Continue with the good work. 

- I will suffix all services interfaces with "Service" and I will create a new package for implementations
- the name "order" is not fine for the table and the entity- I have problems in HSQLDB scrip because is a conflict with the SQL sintax (ORDER BY...). so, we must find a new name for it: orders

rename the table "orders", it's fine.
 

I still have some problems in running the application:

[INFO] [WARN] Failed to load servlet class 'ca.ioniq.server.GreetingServiceImpl' declared in 'ca.ioniq.classicJUnit.JUnit'
[INFO] java.lang.ClassNotFoundException: ca.ioniq.server.GreetingServiceImpl

These 2 classes come with the project template of the maven GWT plugin, you can safely remove them of comment out all references in the code to them.

colaru

unread,
Jan 23, 2011, 9:55:04 AM1/23/11
to classic dev
Hi Richard,

See my responses:

On Jan 22, 11:56 pm, Richard Mutezintare <transmet...@gmail.com>
wrote:
> Hi Cristiian, thanks for the update.
>
> On Sat, Jan 22, 2011 at 4:04 PM, Cristian Olaru <col...@gmail.com> wrote:
> > Hi Richard.
>
> > Today I also make a switch from MYSQL to HSQLDB. Now the tests (services
> > and DAO) are running by default on HSQLDB. We can easy switch again to Mysql
> > from configurations. Will be difficult to maintain 2 schema - there are big
> > differences in syntax. But I will try.
>
> you can configure Hibernate to generate the dialect, and specify to
> create-drop the tables of the db you want. That is what I do when I am in
> dev mode and still discovery my entities and tables structure. Or maybe
> there is a better way??? I will think about it and let you know.
>

I managed to do this. I added this and everything works fine:
<property name="hibernate.hbm2ddl.auto" value="create" />

>
>
> > I started to implement and test around User/Authentication module.
> > Everything is fine. I will continue with the "Order management" module.
>
> That is good new. Continue with the good work.
>
>
>
> > - I will suffix all services interfaces with "Service" and I will create a
> > new package for implementations
> > - the name "order" is not fine for the table and the entity- I have
> > problems in HSQLDB scrip because is a conflict with the SQL sintax (ORDER
> > BY...). so, we must find a new name for it: orders
>
> rename the table "orders", it's fine.
>

I renamed the table.
>
>
> > I still have some problems in running the application:
>
> > [INFO] [WARN] Failed to load servlet class
> > 'ca.ioniq.server.GreetingServiceImpl' declared in
> > 'ca.ioniq.classicJUnit.JUnit'
> > [INFO] java.lang.ClassNotFoundException:
> > ca.ioniq.server.GreetingServiceImpl
>
> These 2 classes come with the project template of the maven GWT plugin, you
> can safely remove them of comment out all references in the code to them.
>
>
>
> > Maybe this class is not committed?
>
> > Regards...
>
> >> > > > I used Unitilshttp://www.unitils.org/summary.htmlandisa good

Cristian Olaru

unread,
Jan 23, 2011, 10:37:08 AM1/23/11
to classic dev
Hi Richard.

Something is strange in HG. After the last update I lost the changes from 2 or 3 change sets committed by me in the past. I put again on HG with this changeset: https://bitbucket.org/transmeta01/classic/changeset/725412ff99a3

Maybe something is not ok in the way I use HG - but I remember I push all my changes to Bitbucket repo in the past.

Please make a update in your local copy and verify.

Regards...

Cristian Olaru

unread,
Jan 23, 2011, 11:30:05 AM1/23/11
to classic dev
I created a branch in the past (by mistake I guess). Now I committed all the changes in the main branch.
HG.JPG

Richard Mutezintare

unread,
Jan 23, 2011, 5:54:10 PM1/23/11
to class...@googlegroups.com
Yes, it looks like you branched the main stream. You can merge your branch in to the main and I will pull your changeset. 

Richard

Cristian Olaru

unread,
Jan 24, 2011, 4:56:47 AM1/24/11
to class...@googlegroups.com
Hi Richard.

Is all ready done - I pushed all my new changes on the main branch.

Regards...
Reply all
Reply to author
Forward
0 new messages