Improve testing (tools & dev-test cycle)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Improve testing (tools & dev-test cycle)

Rene Scheibe
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am not happy how I have to develop/test components in hot-deploy. It
does not encourage test-driven development. That's also reflected in the
quite low number of unit tests in the whole OFBiz system. :-(

1. What are the plans to migrate to JUnit4?
- - I just have seen a post about renaming tests
(http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766) but no
follow-up
- - if I want to migrate OFBiz to JUnit4 do you have any tips or is there
anything special I have to take care of?

2. Is it possible to run multiple test suites at the same time?
- - the current ant task "run-single-test-suite" only takes 1
test.component and test.suiteName
- - OFBiz should not be restarted for each test suite

3. Is there a way to "hot-deploy" a component jar for testing purposes?
- - the OFBiz startup time is way to high to have a good dev-test-feedback
loop
- - where should I start if I want to enhance OFBiz to make this possible

Regards,
Rene Scheibe
- --
René Scheibe * [hidden email]
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Sitz: Unterföhring * Amtsgericht München * HRB 135082
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxVWZQACgkQUXs9EHvIuCrwKQCeNc0k8Ou/6rafg/63dY1qGYH0
ffAAnRLr/1314bInUrCcm/4Io/DVMCsz
=OaYt
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

BJ Freeman
Glad your willing to put some time in on Testing.

subscribe to and search the Dev list there has been recent discussions.

#1 i suggest you check out the most current copy if you have not already
then migrate to Junit4 locally. If you test it and it workks submit a Jira.
#2 do an ./ant -p on the current options to doing Tests.
#3 not clear on what you hope to accomplish, since everything is loaded
before hot deploy.
However if you understand the dependecies for the component you wish to
test you can edit the component-load.xml.



René Scheibe sent the following on 8/1/2010 4:25 AM:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I am not happy how I have to develop/test components in hot-deploy. It
> does not encourage test-driven development. That's also reflected in the
> quite low number of unit tests in the whole OFBiz system. :-(
>
> 1. What are the plans to migrate to JUnit4?
> - - I just have seen a post about renaming tests
> (http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766) but no
> follow-up
> - - if I want to migrate OFBiz to JUnit4 do you have any tips or is there
> anything special I have to take care of?
>
> 2. Is it possible to run multiple test suites at the same time?
> - - the current ant task "run-single-test-suite" only takes 1
> test.component and test.suiteName
> - - OFBiz should not be restarted for each test suite
>
> 3. Is there a way to "hot-deploy" a component jar for testing purposes?
> - - the OFBiz startup time is way to high to have a good dev-test-feedback
> loop
> - - where should I start if I want to enhance OFBiz to make this possible
>
> Regards,
> Rene Scheibe
> - --
> René Scheibe * [hidden email]
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> Sitz: Unterföhring * Amtsgericht München * HRB 135082
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkxVWZQACgkQUXs9EHvIuCrwKQCeNc0k8Ou/6rafg/63dY1qGYH0
> ffAAnRLr/1314bInUrCcm/4Io/DVMCsz
> =OaYt
> -----END PGP SIGNATURE-----
>
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Erwan de FERRIERES
In reply to this post by Rene Scheibe
Le 01/08/2010 13:25, René Scheibe a écrit :

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I am not happy how I have to develop/test components in hot-deploy. It
> does not encourage test-driven development. That's also reflected in the
> quite low number of unit tests in the whole OFBiz system. :-(
>
> 1. What are the plans to migrate to JUnit4?
> - - I just have seen a post about renaming tests
> (http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766) but no
> follow-up
> - - if I want to migrate OFBiz to JUnit4 do you have any tips or is there
> anything special I have to take care of?
Hi Rene,
One of the things which still needs to be done is separating test source
code from application code. At the moment, everything is still present
under src/org/ofbiz, instead of src/main and src/test.
This would be, from my POV, a very good improvement which could just go
in the right direction in adding more tests !!

Cheers,
--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

BJ Freeman
just note under Eclipse you will get bunch of errors if the package does
not match the path.
if you do command line compile the class will not be in right path in
the /build/classes folder and hence in the jar.
There was talk on the develist about different loads so the test jars
are not loaded for production.


Erwan de FERRIERES sent the following on 8/1/2010 5:25 AM:

> Le 01/08/2010 13:25, René Scheibe a écrit :
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I am not happy how I have to develop/test components in hot-deploy. It
>> does not encourage test-driven development. That's also reflected in the
>> quite low number of unit tests in the whole OFBiz system. :-(
>>
>> 1. What are the plans to migrate to JUnit4?
>> - - I just have seen a post about renaming tests
>> (http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766) but no
>> follow-up
>> - - if I want to migrate OFBiz to JUnit4 do you have any tips or is there
>> anything special I have to take care of?
> Hi Rene,
> One of the things which still needs to be done is separating test source
> code from application code. At the moment, everything is still present
> under src/org/ofbiz, instead of src/main and src/test.
> This would be, from my POV, a very good improvement which could just go
> in the right direction in adding more tests !!
>
> Cheers,
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Adrian Crum-2
In reply to this post by Erwan de FERRIERES
--- On Sun, 8/1/10, Erwan de FERRIERES <[hidden email]> wrote:

> Le 01/08/2010 13:25, René Scheibe a
> écrit :
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > I am not happy how I have to develop/test components
> in hot-deploy. It
> > does not encourage test-driven development. That's
> also reflected in the
> > quite low number of unit tests in the whole OFBiz
> system. :-(
> >
> > 1. What are the plans to migrate to JUnit4?
> > - - I just have seen a post about renaming tests
> > (http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766)
> but no
> > follow-up
> > - - if I want to migrate OFBiz to JUnit4 do you have
> any tips or is there
> > anything special I have to take care of?
> Hi Rene,
> One of the things which still needs to be done is
> separating test source code from application code. At the
> moment, everything is still present under src/org/ofbiz,
> instead of src/main and src/test.
> This would be, from my POV, a very good improvement which
> could just go in the right direction in adding more tests

I would like to see that change too.

-Adrian



Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Adrian Crum-2
In reply to this post by BJ Freeman
Eclipse works fine with the folder structure Erwan suggested. Apache Commons does it that way and it works great!.

-Adrian

--- On Sun, 8/1/10, BJ Freeman <[hidden email]> wrote:

> From: BJ Freeman <[hidden email]>
> Subject: Re: Improve testing (tools & dev-test cycle)
> To: [hidden email]
> Date: Sunday, August 1, 2010, 5:35 AM
> just note under Eclipse you will get
> bunch of errors if the package does
> not match the path.
> if you do command line compile the class will not be in
> right path in
> the /build/classes folder and hence in the jar.
> There was talk on the develist about different loads so the
> test jars
> are not loaded for production.
>
>
> Erwan de FERRIERES sent the following on 8/1/2010 5:25 AM:
> > Le 01/08/2010 13:25, René Scheibe a écrit :
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> I am not happy how I have to develop/test
> components in hot-deploy. It
> >> does not encourage test-driven development. That's
> also reflected in the
> >> quite low number of unit tests in the whole OFBiz
> system. :-(
> >>
> >> 1. What are the plans to migrate to JUnit4?
> >> - - I just have seen a post about renaming tests
> >> (http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766)
> but no
> >> follow-up
> >> - - if I want to migrate OFBiz to JUnit4 do you
> have any tips or is there
> >> anything special I have to take care of?
> > Hi Rene,
> > One of the things which still needs to be done is
> separating test source
> > code from application code. At the moment, everything
> is still present
> > under src/org/ofbiz, instead of src/main and
> src/test.
> > This would be, from my POV, a very good improvement
> which could just go
> > in the right direction in adding more tests !!
> >
> > Cheers,
>



Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Rene Scheibe
In reply to this post by BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/01/2010 02:24 PM, BJ Freeman wrote:
> Glad your willing to put some time in on Testing.
>
> subscribe to and search the Dev list there has been recent discussions.
>
> #1 i suggest you check out the most current copy if you have not already
> then migrate to Junit4 locally. If you test it and it workks submit a Jira.
I already started some days ago. Let's see...
I just wanted to know if there is any stumbling blocks or OFBiz
specialities in running the tests.

> #2 do an ./ant -p on the current options to doing Tests.
I already examined build.xml and the OFBiz starter sources. Looks like
the last needs to be extended to take multiple "test.component"s and
"test.suiteName"s.

> #3 not clear on what you hope to accomplish, since everything is loaded
> before hot deploy. However if you understand the dependecies for the component you wish to
> test you can edit the component-load.xml.
What I meant was that during development I want to have a much faster
dev-test cycle. Therefore an OFBiz instance should be running so that
redeploying only the changed jar files is possible. It should also be
possible to redeploy & run the component/functional tests against a
running OFBiz instance. (I was doing some plugin development for
Atlassian's Confluence. There it is possible to hot-deploy your stuff. I
managed to get my code build+deployed+tested within 10-20s) I guess this
goes deep into the framework itself. So the question is, if there is
already such (partially) functionality. If not, where should I take a
look to get some more insights?

Regards,
Rene Scheibe
- --
René Scheibe * [hidden email]
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Sitz: Unterföhring * Amtsgericht München * HRB 135082
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxVrt8ACgkQUXs9EHvIuCqlTQCdGFp6rUOKxWCIFt1xQNiz+/Ga
HxEAmwccPdFiJRnlmwuvilbBKROKPIc/
=S1PU
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Rene Scheibe
In reply to this post by Erwan de FERRIERES
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/01/2010 02:25 PM, Erwan de FERRIERES wrote:

> Le 01/08/2010 13:25, René Scheibe a écrit :
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> I am not happy how I have to develop/test components in hot-deploy. It
>> does not encourage test-driven development. That's also reflected in the
>> quite low number of unit tests in the whole OFBiz system. :-(
>>
>> 1. What are the plans to migrate to JUnit4?
>> - - I just have seen a post about renaming tests
>> (http://comments.gmane.org/gmane.comp.java.ofbiz.devel/44766) but no
>> follow-up
>> - - if I want to migrate OFBiz to JUnit4 do you have any tips or is there
>> anything special I have to take care of?
> Hi Rene,
> One of the things which still needs to be done is separating test source
> code from application code. At the moment, everything is still present
> under src/org/ofbiz, instead of src/main and src/test.
We already managed this change for our components under hot-deploy.

Our (preferred) structure is:
src/main
src/test/unit (real unit tests without any environment interaction)
src/test/component (tests using a  running OFBiz framework)
src/test/functional (Selenium tests)

This doesn't follow the maven way in putting everything under src/main
and src/test. But distinguishing between different test types is a must.
We also already migrated our unit tests (real unit tests) to JUnit4. All
code (business logic & tests) can additionally to Java be written in
Groovy which is the preferred way in our team as it's more concise (it's
time for IDEs to improve :-).

BUT: I have seen discussions in the mailing lists some time ago that the
current source code structure is based on the fact that business logic
and test should be next to each other in your IDE and that other Apache
projects are doing it the same way. So it's quite interesting that this
is not settled - yes, I am also voting against that structure. ;-)

The migration for the whole OFBiz would be quite hard. A lot of files
had to be moved and the "test" package be removed. But the more
difficult task would be to migrate all customer components under
hot-deploy or to provide both ways to structure your source.

Regards,
Rene Scheibe
- --
René Scheibe * [hidden email]
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Sitz: Unterföhring * Amtsgericht München * HRB 135082
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxVsvUACgkQUXs9EHvIuCpvQgCfX1dMwBqeYdwiOugIjhcAiiQ9
GiIAmQHEuM/2Es3gDIdSqjzRAlVe/iB/
=gINB
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Erwan de FERRIERES
Le 01/08/2010 19:46, René Scheibe a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1

> This doesn't follow the maven way in putting everything under src/main
> and src/test. But distinguishing between different test types is a must.
> We also already migrated our unit tests (real unit tests) to JUnit4. All
> code (business logic&  tests) can additionally to Java be written in
> Groovy which is the preferred way in our team as it's more concise (it's
> time for IDEs to improve :-).

Have you migrated only your tests or have you also migrated OFBiz to
manage JUnit4 ? If so, a JIRA issue would be very appreciated !

Cheers,

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

BJ Freeman
In reply to this post by Rene Scheibe
those on the dev list are the experts on the build.xml And test.
I consider myself a novice at both.
did you look at
run-test-list
how is what you propose different?

as far as doing a hot-deploy without stopping ofbiz, I think is now
possible with Tomcat 6, but not sure.

I have add the devlist to this email so it will show up there.
so if you could respond to the devlist only then you may get better help.



René Scheibe sent the following on 8/1/2010 10:29 AM:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 08/01/2010 02:24 PM, BJ Freeman wrote:
>> Glad your willing to put some time in on Testing.
>>
>> subscribe to and search the Dev list there has been recent discussions.
>>
>> #1 i suggest you check out the most current copy if you have not already
>> then migrate to Junit4 locally. If you test it and it workks submit a Jira.
> I already started some days ago. Let's see...
> I just wanted to know if there is any stumbling blocks or OFBiz
> specialities in running the tests.
>
>> #2 do an ./ant -p on the current options to doing Tests.
> I already examined build.xml and the OFBiz starter sources. Looks like
> the last needs to be extended to take multiple "test.component"s and
> "test.suiteName"s.
>
>> #3 not clear on what you hope to accomplish, since everything is loaded
>> before hot deploy. However if you understand the dependecies for the component you wish to
>> test you can edit the component-load.xml.
> What I meant was that during development I want to have a much faster
> dev-test cycle. Therefore an OFBiz instance should be running so that
> redeploying only the changed jar files is possible. It should also be
> possible to redeploy&  run the component/functional tests against a
> running OFBiz instance. (I was doing some plugin development for
> Atlassian's Confluence. There it is possible to hot-deploy your stuff. I
> managed to get my code build+deployed+tested within 10-20s) I guess this
> goes deep into the framework itself. So the question is, if there is
> already such (partially) functionality. If not, where should I take a
> look to get some more insights?
>
> Regards,
> Rene Scheibe
> - --
> René Scheibe * [hidden email]
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> Sitz: Unterföhring * Amtsgericht München * HRB 135082
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkxVrt8ACgkQUXs9EHvIuCqlTQCdGFp6rUOKxWCIFt1xQNiz+/Ga
> HxEAmwccPdFiJRnlmwuvilbBKROKPIc/
> =S1PU
> -----END PGP SIGNATURE-----
>
Reply | Threaded
Open this post in threaded view
|

Re: Improve testing (tools & dev-test cycle)

Scott Gray-2
In reply to this post by Rene Scheibe
On 2/08/2010, at 5:29 AM, René Scheibe wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 08/01/2010 02:24 PM, BJ Freeman wrote:
>> Glad your willing to put some time in on Testing.
>>
>> subscribe to and search the Dev list there has been recent discussions.
>>
>> #1 i suggest you check out the most current copy if you have not already
>> then migrate to Junit4 locally. If you test it and it workks submit a Jira.
> I already started some days ago. Let's see...
> I just wanted to know if there is any stumbling blocks or OFBiz
> specialities in running the tests.
>
>> #2 do an ./ant -p on the current options to doing Tests.
> I already examined build.xml and the OFBiz starter sources. Looks like
> the last needs to be extended to take multiple "test.component"s and
> "test.suiteName"s.
I think test.suiteName is optional so you can run all tests in a given component by only specifying the component.  We could always look at improving this further if you have any ideas.

>> #3 not clear on what you hope to accomplish, since everything is loaded
>> before hot deploy. However if you understand the dependecies for the component you wish to
>> test you can edit the component-load.xml.
> What I meant was that during development I want to have a much faster
> dev-test cycle. Therefore an OFBiz instance should be running so that
> redeploying only the changed jar files is possible. It should also be
> possible to redeploy & run the component/functional tests against a
> running OFBiz instance. (I was doing some plugin development for
> Atlassian's Confluence. There it is possible to hot-deploy your stuff. I
> managed to get my code build+deployed+tested within 10-20s) I guess this
> goes deep into the framework itself. So the question is, if there is
> already such (partially) functionality. If not, where should I take a
> look to get some more insights?
>
> Regards,
> Rene Scheibe
> - --
> René Scheibe * [hidden email]
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> Sitz: Unterföhring * Amtsgericht München * HRB 135082
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAkxVrt8ACgkQUXs9EHvIuCqlTQCdGFp6rUOKxWCIFt1xQNiz+/Ga
> HxEAmwccPdFiJRnlmwuvilbBKROKPIc/
> =S1PU
> -----END PGP SIGNATURE-----


smime.p7s (3K) Download Attachment