You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Alex Blewitt <Al...@ioshq.com> on 2003/08/12 16:37:43 UTC

[Testing] New test directory(s)

At present, we only have one test directory in the source code. IMHO we 
need at least two -- one for the unit tests, and one for the 
use-cases/spec-tests.

Ideally code shouldn't get into CVS unless the unit tests run 100%; 
however, (naturally) we'd expect the use-cases to start off at 0% and 
climb ever towards 100% as the lifetime of the project goes on.

Can someone set up the Maven project structure to have the two types of 
test? If we can't have two test directories for source code, then can 
we agree on a naming convention like org.apache.geronimo for unit 
tests, and usecase.Xxx or test.Xxx (such as 
usecase.j2ee.ejb.DeploymentUseCase) to allow the two to be separated?

Also, if use-case tests are going to be different from unit-tests, do 
we want to use/allow a different suffix other than XxxTest.java?

Alex.


Re: Clover coverage reports

Posted by James Strachan <ja...@yahoo.co.uk>.
I've not setup a nightly build just yet. There was some discussion on 
the general@incubator list over where the generated website should go. 
As soon as we've got a nightly build running somewhere it'll get 
updated. Though it'll probably move from my home directory to somewhere 
else :)


On Wednesday, August 13, 2003, at 01:27  am, Ed Letifov wrote:

> Hello James,
>
>   Any idea why clover coverage reports here
>   http://www.apache.org/~jstrachan/geronimo/clover/index.html do not
>   get updated with the information about all the wonderful unit tests
>   we add? The page needs a rebuild?
>
> -- 
> Best regards,
>  Ed                            mailto:e.letifov@chello.nl
>
>

James
-------
http://radio.weblogs.com/0112098/


Clover coverage reports

Posted by Ed Letifov <e....@chello.nl>.
Hello James,

  Any idea why clover coverage reports here
  http://www.apache.org/~jstrachan/geronimo/clover/index.html do not
  get updated with the information about all the wonderful unit tests
  we add? The page needs a rebuild?
  
-- 
Best regards,
 Ed                            mailto:e.letifov@chello.nl


Re: [Testing] New test directory(s)

Posted by Jason Dillon <ja...@coredevelopers.net>.
I strongly suggest that we do not use generic names for modules like 
web or jms.  Doing so will make it difficult to manage large re-factors 
which are going to be likely once this project gets more mature.

For example, if we started out with a kernel module, which implemented 
a JMX based kernel, when and if we ever re-factored to use Container-X, 
the second impl would be forced to work around the namespace of the 
previous impl.

--jason


On Wednesday, August 13, 2003, at 01:32  AM, James Strachan wrote:

> Geronimo is gonna have a very modular build. There will eventually be 
> quite a few modules for the core container, jsr 77 implementation, web 
> connector, Axis connector, jms integration and so forth.
>
> Each module will have its own Maven build and should have its own unit 
> tests for just that module. Then developers working on one part of the 
> system can hack code, refactor in their own part of the system without 
> having to build everything else.
>
>
> For specification / functional tests, we'll probably want a full 
> container (or at least several modules) on which to do the tests. e.g. 
> EJB tests will need deployment + ejb + transactions and maybe jms for 
> example. So having the specification tests inside a module might be 
> the wrong granularity.
>
>
> So we might want a completely separate Maven project which is all of 
> the functional tests of the system. i.e. it takes a binary build of 
> the whole container & runs functionality testing on it.
>
> e.g. our directory structure could be...
>
> geronimo
> 	# root project
> 	modules/
> 		core/
> 			# core container
> 		web/
> 			# web connector
> 		axis/
> 			# axis connector
> 		jms/
> 			# jms connectors
>
> 		...
> 	testsuite/
> 		# the functional tests which test the whole container
>
>
> Then you can build a module (say the jms module) and run its unit 
> tests. Or you can build the whole container (building all the 
> sub-modules) and run all the tests on the entire container.
>
>
> Who knows the functional tests might become reusable as themselves - 
> on other containers or projects (heck Sun could use them in the TCK if 
> they wish) so keeping the tests in a separate build might help folks 
> reuse the functional tests elsewhere - like the jms tests the OpenJMS 
> guys did.
>
>
> On Tuesday, August 12, 2003, at 06:02  pm, Bruce Snyder wrote:
>
>> This one time, at band camp, Alex Blewitt said:
>>
>> AB>At present, we only have one test directory in the source code. 
>> IMHO we
>> AB>need at least two -- one for the unit tests, and one for the
>> AB>use-cases/spec-tests.
>> AB>
>> AB>Ideally code shouldn't get into CVS unless the unit tests run 100%;
>> AB>however, (naturally) we'd expect the use-cases to start off at 0% 
>> and
>> AB>climb ever towards 100% as the lifetime of the project goes on.
>>
>> You're preaching to the choir here ;-). I'm a big believer in this
>> stategy as well because I've used it in the past and I've seen the
>> benefit in productivity. But I'm also a big believer in the test first
>> methodology. For me, writing tests before I ever write the code saves
>> me a lot of refactoring time.
>>
>> AB>Can someone set up the Maven project structure to have the two 
>> types of
>> AB>test? If we can't have two test directories for source code, then 
>> can
>> AB>we agree on a naming convention like org.apache.geronimo for unit
>> AB>tests, and usecase.Xxx or test.Xxx (such as
>> AB>usecase.j2ee.ejb.DeploymentUseCase) to allow the two to be 
>> separated?
>>
>> There's already a directory structure like so:
>>
>>     src/java
>>     src/test
>>
>> We need to keep all the tests in their respective package structure 
>> for
>> the testing of protected and package scoped objects. I suggested 
>> earlier
>> that we add:
>>
>>     src/spec-test
>>
>> which is where the specification tests will live. Is this acceptable?
>>
>> AB>Also, if use-case tests are going to be different from unit-tests, 
>> do
>> AB>we want to use/allow a different suffix other than XxxTest.java?
>>
>> How about *SpecTest.java?
>>
>> Bruce
>> -- 
>> perl -e 'print 
>> unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
>>
>>
>>
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


Re: [Testing] New test directory(s)

Posted by James Strachan <ja...@yahoo.co.uk>.
Geronimo is gonna have a very modular build. There will eventually be 
quite a few modules for the core container, jsr 77 implementation, web 
connector, Axis connector, jms integration and so forth.

Each module will have its own Maven build and should have its own unit 
tests for just that module. Then developers working on one part of the 
system can hack code, refactor in their own part of the system without 
having to build everything else.


For specification / functional tests, we'll probably want a full 
container (or at least several modules) on which to do the tests. e.g. 
EJB tests will need deployment + ejb + transactions and maybe jms for 
example. So having the specification tests inside a module might be the 
wrong granularity.


So we might want a completely separate Maven project which is all of 
the functional tests of the system. i.e. it takes a binary build of the 
whole container & runs functionality testing on it.

e.g. our directory structure could be...

geronimo
	# root project
	modules/
		core/
			# core container
		web/
			# web connector
		axis/
			# axis connector
		jms/
			# jms connectors

		...
	testsuite/
		# the functional tests which test the whole container


Then you can build a module (say the jms module) and run its unit 
tests. Or you can build the whole container (building all the 
sub-modules) and run all the tests on the entire container.


Who knows the functional tests might become reusable as themselves - on 
other containers or projects (heck Sun could use them in the TCK if 
they wish) so keeping the tests in a separate build might help folks 
reuse the functional tests elsewhere - like the jms tests the OpenJMS 
guys did.


On Tuesday, August 12, 2003, at 06:02  pm, Bruce Snyder wrote:

> This one time, at band camp, Alex Blewitt said:
>
> AB>At present, we only have one test directory in the source code. 
> IMHO we
> AB>need at least two -- one for the unit tests, and one for the
> AB>use-cases/spec-tests.
> AB>
> AB>Ideally code shouldn't get into CVS unless the unit tests run 100%;
> AB>however, (naturally) we'd expect the use-cases to start off at 0% 
> and
> AB>climb ever towards 100% as the lifetime of the project goes on.
>
> You're preaching to the choir here ;-). I'm a big believer in this
> stategy as well because I've used it in the past and I've seen the
> benefit in productivity. But I'm also a big believer in the test first
> methodology. For me, writing tests before I ever write the code saves
> me a lot of refactoring time.
>
> AB>Can someone set up the Maven project structure to have the two 
> types of
> AB>test? If we can't have two test directories for source code, then 
> can
> AB>we agree on a naming convention like org.apache.geronimo for unit
> AB>tests, and usecase.Xxx or test.Xxx (such as
> AB>usecase.j2ee.ejb.DeploymentUseCase) to allow the two to be 
> separated?
>
> There's already a directory structure like so:
>
>     src/java
>     src/test
>
> We need to keep all the tests in their respective package structure for
> the testing of protected and package scoped objects. I suggested 
> earlier
> that we add:
>
>     src/spec-test
>
> which is where the specification tests will live. Is this acceptable?
>
> AB>Also, if use-case tests are going to be different from unit-tests, 
> do
> AB>we want to use/allow a different suffix other than XxxTest.java?
>
> How about *SpecTest.java?
>
> Bruce
> -- 
> perl -e 'print 
> unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
>
>
>

James
-------
http://radio.weblogs.com/0112098/


Re: [Testing] New test directory(s)

Posted by Alex Blewitt <Al...@ioshq.com>.
On Tuesday, Aug 12, 2003, at 18:02 Europe/London, Bruce Snyder wrote:

> This one time, at band camp, Alex Blewitt said:
>
> AB>Can someone set up the Maven project structure to have the two 
> types of
> AB>test? If we can't have two test directories for source code, then 
> can
> AB>we agree on a naming convention like org.apache.geronimo for unit
> AB>tests, and usecase.Xxx or test.Xxx (such as
> AB>usecase.j2ee.ejb.DeploymentUseCase) to allow the two to be 
> separated?
>
> There's already a directory structure like so:
>
>     src/java
>     src/test
>
> We need to keep all the tests in their respective package structure for
> the testing of protected and package scoped objects. I suggested 
> earlier
> that we add:
>
>     src/spec-test
>
> which is where the specification tests will live. Is this acceptable?

There may be a difference between 
testing-that-it-meets-the-J2EE-specification and 
testing-that-a-user-can-do-what-they-want. There may be an overlap 
between the two, but that doesn't imply they are one and the same. I 
believe that a test to verify specification compliance will essentially 
be a low-level test (an ejbCreate must have an associated 
ejbPostCreate, for example). However, use-cases will be bigger than 
this (such as taking an EJB, running it through the 
verifier/deployer/installer, and then checking it can be accessed via 
JNDI).

So I think that 'spec-test' may be unnecessarily specific to 
specification testing if that is the alternative name.

Of course, no reason why we couldn't have 3 test directories; 
unit-test, spec-test and use-case-test (or just use-case)

> AB>Also, if use-case tests are going to be different from unit-tests, 
> do
> AB>we want to use/allow a different suffix other than XxxTest.java?
>
> How about *SpecTest.java?

Same as point above. Not all SpecTests will necessarily be 
UseCaseTests, and IMHO UseCaseTest is a silly name; perhaps XxxUseCase 
would be better.

Is XxxSpecTest that meaningful? Well, if it's in a separate directory 
for specification tests anyway, not really that necessary. For that 
matter, if we have a bunch of use-cases, then if they're in a separate 
directory we could just life with the InstallAndRetrieveEJBTest.java 
type names rather than specific extension types. Anyone else have any 
other preferences/ideas?

Alex.


Re: [Testing] New test directory(s)

Posted by Bruce Snyder <fe...@frii.com>.
This one time, at band camp, Alex Blewitt said:

AB>At present, we only have one test directory in the source code. IMHO we 
AB>need at least two -- one for the unit tests, and one for the 
AB>use-cases/spec-tests.
AB>
AB>Ideally code shouldn't get into CVS unless the unit tests run 100%; 
AB>however, (naturally) we'd expect the use-cases to start off at 0% and 
AB>climb ever towards 100% as the lifetime of the project goes on.

You're preaching to the choir here ;-). I'm a big believer in this
stategy as well because I've used it in the past and I've seen the
benefit in productivity. But I'm also a big believer in the test first
methodology. For me, writing tests before I ever write the code saves
me a lot of refactoring time.

AB>Can someone set up the Maven project structure to have the two types of 
AB>test? If we can't have two test directories for source code, then can 
AB>we agree on a naming convention like org.apache.geronimo for unit 
AB>tests, and usecase.Xxx or test.Xxx (such as 
AB>usecase.j2ee.ejb.DeploymentUseCase) to allow the two to be separated?

There's already a directory structure like so: 

    src/java
    src/test

We need to keep all the tests in their respective package structure for
the testing of protected and package scoped objects. I suggested earlier
that we add:

    src/spec-test

which is where the specification tests will live. Is this acceptable? 

AB>Also, if use-case tests are going to be different from unit-tests, do 
AB>we want to use/allow a different suffix other than XxxTest.java?

How about *SpecTest.java? 

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'