You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Alex Karasulu <ao...@bellsouth.net> on 2004/06/09 17:25:23 UTC

[testutils] Is there any commons area for generic test code?

Hi,

I've often found it necessary to write some of the same test code
snippets over and over again.  Namely I'm referring to test cases for
private methods that use reflection as well as other common snippets of
code dealing with unit tests.  Some of these snippets could have become
JUnit extensions.

Is there a place where we can collect and localize utility methods and
classes used for unit testing?  I have not found anything yet.

Is it even worth doing this?

If the answer is "no", then "yes" to the two questions above, is it
worth creating a sandbox area where we can start gathering useful
utilities for unit testing?  

IMO most projects could benefit from unit testing utilities or
extensions that do not come out of the box with JUnit or mock objects. 
Personally I'm looking for a place where I can keep generic test code
that could be used across projects, while sharing testing strategies and
techniques with others.  Sometimes nothing better communicates ideas
than actual code.  So if nothing already exists perhaps we can use this
area as a place to gather modest utilities; very simple tools.  It can
grow as demands increase and need not be a full fledged production:
meaning there is no rush or stress to make it into a release or a
deliverable.  

Also perhaps things like the commons collections testing framework could
be kept here as well.  Don't if this is the right thing to do but just a
thought.  It might not be a good idea since it is so specific to
collections but this can be discussed over time.

Why this email now?

I sat down this morning to write a few JUnit tests and realized I needed
to write the same darn utility code over again for common issues I deal
with while testing.  That's what triggered this email.  9 out of 10
times I can find existing JUnit AddOns that help but sometimes they need
to be altered or augmented in some respect.  Rather then impose
dependencies where I cannot make additions to the code I thought it
would be nice if we had our own test utilities where additions can be
made on demand.  I thought for sure others had this wish at some point.

WDYT?

Alex




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Fri, 2004-06-11 at 11:51, Rodney Waldhoff wrote:
> On Fri, 11 Jun 2004, Alex Karasulu wrote:
> 
> > I looked at JUX just now and saw that you have one class there called
> > ObjectTestCase.java.  Would you rather move the stuff already put into
> > test to JUX or just add this class to the test project?
> 
> Feel free to move it (and its tests) over to the test project.  If I can 
> find the time, maybe I'll poke around a bit in the test project as well.

Groovy will do that! 

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Rodney Waldhoff <rw...@apache.org>.
On Fri, 11 Jun 2004, Alex Karasulu wrote:

> I looked at JUX just now and saw that you have one class there called
> ObjectTestCase.java.  Would you rather move the stuff already put into
> test to JUX or just add this class to the test project?

Feel free to move it (and its tests) over to the test project.  If I can 
find the time, maybe I'll poke around a bit in the test project as well.

- Rod <http://radio.weblogs.com/0122027/>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Fri, 2004-06-11 at 08:53, Rodney Waldhoff wrote:
> On Wed, 9 Jun 2004, Alex Karasulu wrote:
> 
> > Is there a place where we can collect and localize utility methods and
> > classes used for unit testing?  I have not found anything yet.
> >
> > Is it even worth doing this?
> >
> > If the answer is "no", then "yes" to the two questions above, is it
> > worth creating a sandbox area where we can start gathering useful
> > utilities for unit testing?
> 
> The existing sandbox project JUX 
> (http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/jux/) was 
> created for a simliar purpose, although it looks like someone has removed 
> its web prescence.  The code there has gone stagnant but is still works as 
> well as ever.

Doh! I wish I knew about this earlier.  

> Also, someone once contacted me about a simliar and apparently 
> larger project on sourceforge, although I can't find it now, junit 
> add-ons or something like that.

Yeah I saw Pete's post about that too.  Here was the response to that
one: 

http://baywhape.notlong.com

I looked at JUX just now and saw that you have one class there called
ObjectTestCase.java.  Would you rather move the stuff already put into
test to JUX or just add this class to the test project?  

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Rodney Waldhoff <rw...@apache.org>.
On Wed, 9 Jun 2004, Alex Karasulu wrote:

> Is there a place where we can collect and localize utility methods and
> classes used for unit testing?  I have not found anything yet.
>
> Is it even worth doing this?
>
> If the answer is "no", then "yes" to the two questions above, is it
> worth creating a sandbox area where we can start gathering useful
> utilities for unit testing?

The existing sandbox project JUX 
(http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/jux/) was 
created for a simliar purpose, although it looks like someone has removed 
its web prescence.  The code there has gone stagnant but is still works as 
well as ever.

Also, someone once contacted me about a simliar and apparently 
larger project on sourceforge, although I can't find it now, junit 
add-ons or something like that.

- Rod

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
> contrary to as someone pointed out on this thread I think this subject 
> is very exciting.  For my development projects I have also founded a 

Sorry man I did not mean to insult those who are religious about testing
when I said it was boring.  It's just not my favorite topic although I
do enjoy it.

>   - Assertions for common issues: instanceof, thrown exceptions, array 
> element equality etc.
>   - Threading: validate error free execution and termination of threads.
>   - Futures: constraints Future objects.
>   - Beans: validate property accessors and property change events.
>   - DataObject: validate implementation of equals, hashCode and 
> serialization.
>   - Logging: add log interface to TestCase
>   - Watchdog: terminate test after maximum execution time.

Sounds like good stuff.  If you're already a committer why not add your
code.

> This is all to say that I encourage the effort to found the sandbox 
> project.  I will try to contribute from these if suitable once the test 
> project materializes.

Oh the sandbox project has already been created.  Both Oliver and I have
started adding to it already.

> For these extensions dependencies on Logging, BeanUtils and even 
> Functors have been introduced.
> I do not see the need to avoid dependency in a test-utils project. 
> Test-utils are used during the development and are usually not part of 
> the developed product.  I would not put the minimization of dependencies 
> too high on the agenda, as the testing has a different scope.

That's actually a very good point!  These dependencies are shed and do
not come with the project deliverable.  Let's do away with that criteria
then.

> For the name, IMO 'testutils' is a better choice than 'test' as it 
> provides for less ambiguity.  Maybe even the focus on UnitTesting should 
> be highlighted: 'unittestutils'.

Actually I was thinking more than just unit testing.  It could contain
code to build harnesses and such for things like stress tests and
integration tests.  Also there is the shorter package name although this
is not the driving factor of course :-).  If others want to change the
name too then we can do it.  See if you can reach consensus on it.

Good to see your interest.

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Arnd Kohrs <ak...@free.fr>.
Alex Karasulu wrote:

 >
 > Back on topic, I'm fine with guidelines. But I only have general ones at
 > the moment:
 >
 >  o I want to minimize dependencies avoiding them whenever possible.
 >  o Keep things simple.
 >  o This should not be an area for dumping project test code.
 >  o Keep the amount of specificity low: meaning this is not where you
 >    keep your test cases for testing an LDAP server or a cryptography
 >    library etcetera.  It should be for generic test utilities
 >    in addition to junit used for writing unit tests, beta tests,
 >    and stress tests
 >  o Commons-test should be here for making your domain specific
 >    TestCases all that much easier to write while avoiding the
 >    duplication of common testing and setup code.
 >
 > Alex
 >

Hi Everyone,

contrary to as someone pointed out on this thread I think this subject 
is very exciting.  For my development projects I have also founded a 
package of extensions for JUnit testing:  The following areas were 
important so far:
  - Assertions for common issues: instanceof, thrown exceptions, array 
element equality etc.
  - Threading: validate error free execution and termination of threads.
  - Futures: constraints Future objects.
  - Beans: validate property accessors and property change events.
  - DataObject: validate implementation of equals, hashCode and 
serialization.
  - Logging: add log interface to TestCase
  - Watchdog: terminate test after maximum execution time.

Some extensions are static and others integrate with the JUnit 
framework, ie. inherit from TestCase in order to maximize automation.

The intention of the extensions was to permit to write JUnit test-cases 
quickly without duplication and simple access to the features also for 
the not-so-seasoned JUnit users.  So these extensions are all accessible 
through one TestCase class: BellsAndWhistlesTestCase.

This is all to say that I encourage the effort to found the sandbox 
project.  I will try to contribute from these if suitable once the test 
project materializes.

For these extensions dependencies on Logging, BeanUtils and even 
Functors have been introduced.
I do not see the need to avoid dependency in a test-utils project. 
Test-utils are used during the development and are usually not part of 
the developed product.  I would not put the minimization of dependencies 
too high on the agenda, as the testing has a different scope.

For the name, IMO 'testutils' is a better choice than 'test' as it 
provides for less ambiguity.  Maybe even the focus on UnitTesting should 
be highlighted: 'unittestutils'.

Cheers,
Arnd




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Michael Davey <Mi...@coderage.org>.
Alex Karasulu wrote:

>
>>
>>On Thu, 2004-06-10 at 21:39, Pete Gieser wrote:
>>    
>>
>>>I may have missed it, but I wanted to mention that there exists
>>>a sourceforge project that may have some overlap.
>>>
>>>http://sourceforge.net/projects/junit-addons
>>>
>>>FWIW.
>>>
>>>Pete
>>>      
>>>
>
>This is good stuff and pretty much in line with what I was thinking.  
>There is a lot of overlap certainly.  I actually saw this project
>several times before.  Many of my utilities map closely to classes in
>this project.  The Addons project admin inspired Bill Venners, who's
>writings later influenced me.
>  
>
There is also this, by Cedric Beust:

http://www.beust.com/testng/


I think it makes sense to collect our own test related code first, then 
scour the rest of Apache for interesting stuff.  Once we have done, that 
we can try to work with junit-addons and testng to integrate any stuff 
that is unique to commons-test; and see if either or both communities 
would like to come to Apache (if appropriate).

-- 
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Thu, 2004-06-10 at 16:06, Martin van den Bemt wrote:
> We probably should check for some overlap.
> I have some Exception test stuff that could also come in handy. 
> It allows you to test classloader exceptions (except NoClassDefFound,
> still have to figure that one out..). To get it into commons I need to
> make it more usable for others except myself however :)
> 
> Mvgr,
> Martin
> 
> On Thu, 2004-06-10 at 21:39, Pete Gieser wrote:
> > I may have missed it, but I wanted to mention that there exists
> > a sourceforge project that may have some overlap.
> > 
> > http://sourceforge.net/projects/junit-addons
> > 
> > FWIW.
> > 
> > Pete

This is good stuff and pretty much in line with what I was thinking.  
There is a lot of overlap certainly.  I actually saw this project
several times before.  Many of my utilities map closely to classes in
this project.  The Addons project admin inspired Bill Venners, who's
writings later influenced me.

The most important thing is to have a central place where all ASF
projects can add reusable test code to.  Uniqueness is not what I was
shooting for.  Let's be honest testing code is not the most exciting
topic in the world.  We just want to stop writing the same code over and
over for every new project.  So the key really is not to innovate
something new but to prevent duplication and enable ease of access for
other Apache projects to add their own two cents when they want.  There
are also other quality concerns.  I'm under the impression that a
commons sandbox project is more accessible to us as a community, more so
than a sf.net project.  If there is overlap between this project and
ours its not a big deal.

On the other hand, it would be nice if we could combine our efforts.  So
much of the code basically maps to his already with very minor
differences: we're solving for the same problems.  I'm sure we will be
replicating most of his efforts, however it does not seem like all that
much to do, these utilities are snippets of code at best.  Again nothing
worth overly analyzing but just doing.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [testutils] Is there any commons area for generic test code?

Posted by Martin van den Bemt <ml...@mvdb.net>.
We probably should check for some overlap.
I have some Exception test stuff that could also come in handy. 
It allows you to test classloader exceptions (except NoClassDefFound,
still have to figure that one out..). To get it into commons I need to
make it more usable for others except myself however :)

Mvgr,
Martin

On Thu, 2004-06-10 at 21:39, Pete Gieser wrote:
> I may have missed it, but I wanted to mention that there exists
> a sourceforge project that may have some overlap.
> 
> http://sourceforge.net/projects/junit-addons
> 
> FWIW.
> 
> Pete
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
-- 
Mvgr,
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [testutils] Is there any commons area for generic test code?

Posted by Pete Gieser <pg...@tampabay.rr.com>.
I may have missed it, but I wanted to mention that there exists
a sourceforge project that may have some overlap.

http://sourceforge.net/projects/junit-addons

FWIW.

Pete


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
> AK> I'll kick start a little sandbox project for common test related code
> AK> shared across ASF projects.
> AK>
> AK> What shall we call it?  I figure 'test' is short and to the point.
> 
> Yes. But I believe we must setup some kind of guide line, what we try to 
> include and what not. E.g. I also have a very simple http server in my test 
> package, because I had to test classes that encapsulate some kind of 
> client-side http-communication. While I see this as candidate, I would rather 
> not want someone to enhance this for multithreading support and so on ...

Np we'll manage the particulars along the way.  Take myself for
instance.  I have two measily classes at the moment.  One is an
exception and another extends JUnit TestCase to allow for testing
private methods and accessing private members.  This is not domain
specific code and can be used in any project.  

Eventually I might use attributes to generate test case code that
creates public conduit methods and accessors in test cases to test
private code.  This would make test code a lot cleaner.

Back on topic, I'm fine with guidelines. But I only have general ones at
the moment: 

 o I want to minimize dependencies avoiding them whenever possible.  
 o Keep things simple.  
 o This should not be an area for dumping project test code.  
 o Keep the amount of specificity low: meaning this is not where you 
   keep your test cases for testing an LDAP server or a cryptography
   library etcetera.  It should be for generic test utilities 
   in addition to junit used for writing unit tests, beta tests, 
   and stress tests 
 o Commons-test should be here for making your domain specific
   TestCases all that much easier to write while avoiding the 
   duplication of common testing and setup code.  
  
Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Jörg Schaible <jo...@gmx.de>.
On Thursday 10 June 2004 16:18, Alex Karasulu wrote:
AK> On Thu, 2004-06-10 at 05:28, Jörg Schaible wrote:
AK> > Hi Alex,
AK> >
AK> > in our project I have meanwhile also a collection of utility classes,
 that I AK> > use over again in unit tests. It might be good to have a more
 common pool. AK>
AK> Great news Jörg!  You put us over the top wrt my personal quota of 3
AK> interested people.  So you, Micheal Davey and I have shown interest so
AK> lets roll.

:)

AK> I'll kick start a little sandbox project for common test related code
AK> shared across ASF projects.
AK>
AK> What shall we call it?  I figure 'test' is short and to the point.

Yes. But I believe we must setup some kind of guide line, what we try to 
include and what not. E.g. I also have a very simple http server in my test 
package, because I had to test classes that encapsulate some kind of 
client-side http-communication. While I see this as candidate, I would rather 
not want someone to enhance this for multithreading support and so on ...

-- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Thu, 2004-06-10 at 05:28, Jörg Schaible wrote:
> Hi Alex,
> 
> in our project I have meanwhile also a collection of utility classes, that I
> use over again in unit tests. It might be good to have a more common pool.

Great news Jörg!  You put us over the top wrt my personal quota of 3
interested people.  So you, Micheal Davey and I have shown interest so
lets roll.

I'll kick start a little sandbox project for common test related code
shared across ASF projects.  

What shall we call it?  I figure 'test' is short and to the point.

Alex




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Alex,

in our project I have meanwhile also a collection of utility classes, that I
use over again in unit tests. It might be good to have a more common pool.

This might be also a candidate:
http://issues.apache.org/bugzilla/show_bug.cgi?id=27663

-- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
[snip]
> Just a thought - It might be interesting to look at the possibility of 
> auto-generating testcode from the annotation features of Java 1.5.  Take 
> a look at these for some ideas:
> 
> http://www.langrsoft.com/articles/annotations2.html
> http://www.onjava.com/pub/a/onjava/2004/04/21/declarative.html?page=last

Nice! Sounds like an interesting idea. I'll take a look at this some
more and get back to you off list.  

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Michael Davey <Mi...@coderage.org>.
Alex Karasulu wrote:


[snip]

>...I don't have enough material myself that I could say was a coherent
>group.  There is perhaps 100 lines or so of code I find myself writing
>every time I start writing tests in a new project project. 
>  
>
[snip]

>I don't think I have enough material alone for it. 
>I think I wrote this email more as a feeler to see if others wanted a
>place to put such utilities.  If 2 or more people besides myself respond
>and they have stuff to put there then I'll take the plunge otherwise its
>probably not worth it. 
>  
>
I, too, get bored with cutting and pasting testcase code.

Just a thought - It might be interesting to look at the possibility of 
auto-generating testcode from the annotation features of Java 1.5.  Take 
a look at these for some ideas:

http://www.langrsoft.com/articles/annotations2.html
http://www.onjava.com/pub/a/onjava/2004/04/21/declarative.html?page=last

It might be that Apache isn't the best place for such a project, 
though.  I guess the community will decide.

-- 
Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
Thanks for the honest feedback Matthew.  

On Wed, 2004-06-09 at 12:23, matthew.hawthorne wrote:
> Alex Karasulu wrote:
> > Is there a place where we can collect and localize utility methods and
> > classes used for unit testing?  I have not found anything yet.
> > 
> > Is it even worth doing this?
> 
> The problem with a project like this is that the scope would be hard to 
> define.  The only
> common  thing that I use in my tests are:
> 
> -  java.util.Random to generate test data
> 
> - extentions of junit.extensions.TestDecorator or 
> junit.textui.ResultPrinter in order to
> do some debugging, such as printing when a test starts
> 
> So I think it would be hard to get a nice group of test utils that feel 
> like they
> truly belong together.

Yeah I don't have enough material myself that I could say was a coherent
group.  There is perhaps 100 lines or so of code I find myself writing
every time I start writing tests in a new project project. 

> If you have commit access, as far as I know there is nothing stopping 
> you from
> creating a new sandbox project and committing some of your ideas.  If 
> you've got
> some cool things then I'm sure others would get interested.

Thanks for the tip.  I don't think I have enough material alone for it. 
I think I wrote this email more as a feeler to see if others wanted a
place to put such utilities.  If 2 or more people besides myself respond
and they have stuff to put there then I'll take the plunge otherwise its
probably not worth it. 

Thanks,
Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by "matthew.hawthorne" <ma...@apache.org>.
Alex Karasulu wrote:
> Is there a place where we can collect and localize utility methods and
> classes used for unit testing?  I have not found anything yet.
> 
> Is it even worth doing this?

The problem with a project like this is that the scope would be hard to 
define.  The only
common  thing that I use in my tests are:

-  java.util.Random to generate test data

- extentions of junit.extensions.TestDecorator or 
junit.textui.ResultPrinter in order to
do some debugging, such as printing when a test starts

So I think it would be hard to get a nice group of test utils that feel 
like they
truly belong together.

If you have commit access, as far as I know there is nothing stopping 
you from
creating a new sandbox project and committing some of your ideas.  If 
you've got
some cool things then I'm sure others would get interested.


> Also perhaps things like the commons collections testing framework could
> be kept here as well.  Don't if this is the right thing to do but just a
> thought.  It might not be a good idea since it is so specific to
> collections but this can be discussed over time.

I think the [collections] testing framework belongs in [collections].  I 
don't think that
the test framework is [collections]-specific, but I do think that it 
falls better under the
scope of [collections] than it would a separate testing project.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Thu, 2004-06-10 at 11:48, Oliver Zeigermann wrote:
> Alex Karasulu wrote:
> 
> > On Thu, 2004-06-10 at 10:29, Oliver Zeigermann wrote:
> > 
> >>I could contribute a class called RendezvousBarrier. It is simple, but 
> >>very useful when testing stuff in concurrent szenarios and you want to 
> >>make non-deterministic runs of more than one thread deterministic for 
> >>certain tests.
> > 
> > 
> > Is this test specific?  Sounds like its more specific to threading
> > concerns.  However I think testing multi-threaded code is your goal and
> > in that case we're probably going to need these constructs to setup a
> > multi-threaded test harness.  It does make sense.  Let's talk about this
> > some more.  I have a feeling the Transaction stuff you're working on is
> > driving some of this eh?
> 
> I use the barrier in many tests for the transaction stuff and it is as 
> well simple to use as useful. The barrier is not really test specific, 
> but - as I said - especially useful for testing.

Good enough for me let's put it in.  Plus we probably want to limit the
number of dependencies as much as possible so depending on other jars
for this fuctionality is not currently an option.  

Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Oliver Zeigermann <oz...@c1-fse.de>.
Alex Karasulu wrote:

> On Thu, 2004-06-10 at 10:29, Oliver Zeigermann wrote:
> 
>>I could contribute a class called RendezvousBarrier. It is simple, but 
>>very useful when testing stuff in concurrent szenarios and you want to 
>>make non-deterministic runs of more than one thread deterministic for 
>>certain tests.
> 
> 
> Is this test specific?  Sounds like its more specific to threading
> concerns.  However I think testing multi-threaded code is your goal and
> in that case we're probably going to need these constructs to setup a
> multi-threaded test harness.  It does make sense.  Let's talk about this
> some more.  I have a feeling the Transaction stuff you're working on is
> driving some of this eh?

I use the barrier in many tests for the transaction stuff and it is as 
well simple to use as useful. The barrier is not really test specific, 
but - as I said - especially useful for testing.

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Oliver Zeigermann <oz...@c1-fse.de>.
Right, I will add my stuff at random as well...

Oliver

Alex Karasulu wrote:

> On Thu, 2004-06-10 at 11:36, Oliver Zeigermann wrote:
> 
>>Nice, will do so ASAP. Any idea how to structure all this?
> 
> 
> The only structure I have in mind right now is the o.a.c.test package
> :-).  Perhaps as we fill it with matter we'll start to see more of a
> structure naturally emerge.  
> 
> I got me one or two classes to add.  I'll do that sometime today. 
> Perhaps we can look at it in a couple o weeks and see then.
> 
> Alex
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Thu, 2004-06-10 at 11:36, Oliver Zeigermann wrote:
> Nice, will do so ASAP. Any idea how to structure all this?

The only structure I have in mind right now is the o.a.c.test package
:-).  Perhaps as we fill it with matter we'll start to see more of a
structure naturally emerge.  

I got me one or two classes to add.  I'll do that sometime today. 
Perhaps we can look at it in a couple o weeks and see then.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Oliver Zeigermann <oz...@c1-fse.de>.
Nice, will do so ASAP. Any idea how to structure all this?

Oliver

Alex Karasulu wrote:

> Olivier, Jörg, Michael, 
> 
> 
>>Sure this is just what we need I think.  Let me get it setup and
>>mavenize it and we can just start adding our test code and organizing
>>it.  I'll get on it right now.
> 
> 
> Ok its done - you can checkout or update the jakarata-commons-sandbox
> and a new test directory should be there for adding your test utility
> code there.  
> 
> Cheers,
> Alex
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
Olivier, Jörg, Michael, 

> Sure this is just what we need I think.  Let me get it setup and
> mavenize it and we can just start adding our test code and organizing
> it.  I'll get on it right now.

Ok its done - you can checkout or update the jakarata-commons-sandbox
and a new test directory should be there for adding your test utility
code there.  

Cheers,
Alex


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Alex Karasulu <ao...@bellsouth.net>.
On Thu, 2004-06-10 at 10:29, Oliver Zeigermann wrote:
> I could contribute a class called RendezvousBarrier. It is simple, but 
> very useful when testing stuff in concurrent szenarios and you want to 
> make non-deterministic runs of more than one thread deterministic for 
> certain tests.

Is this test specific?  Sounds like its more specific to threading
concerns.  However I think testing multi-threaded code is your goal and
in that case we're probably going to need these constructs to setup a
multi-threaded test harness.  It does make sense.  Let's talk about this
some more.  I have a feeling the Transaction stuff you're working on is
driving some of this eh?

> Additionally, I have a set of methods that do comparison on files. They 
> include checking the content of text files as well as checking what 
> files are in certain directories.

I needed that a couple months ago actually.

> If of any interest I could offer to contribute and maintain all of them 
> in a testutils component...

Sure this is just what we need I think.  Let me get it setup and
mavenize it and we can just start adding our test code and organizing
it.  I'll get on it right now.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [testutils] Is there any commons area for generic test code?

Posted by James Carman <ja...@carmanconsulting.com>.
There is a class called Rendezvous in Mr. Lea's code.  I assumed that's what
you're attempting.

-----Original Message-----
From: Oliver Zeigermann [mailto:ozeigermann@c1-fse.de] 
Sent: Thursday, June 10, 2004 10:52 AM
To: Jakarta Commons Developers List
Subject: Re: [testutils] Is there any commons area for generic test code?

I suppose you refer to CyclicBarrier, right? Actually, RendezvousBarrier 
is heaviliy "inspired" by this one, but addionally allows to increase 
the barries without the current thread being forced to wait for the 
others. Maybe it would have been possible to use the one from Douge Lea 
anyway, but is it worth including the whole package?

Cheers,
Oliver

James Carman wrote:

> That sort of code (the rendezvous) is going to be included in the 1.5
> release of Java.  In the meantime, it's included in a code library
> http://gee.cs.oswego.edu/dl/cpj/) by Doug Lea who wrote Concurrent
> Programming in Java.
> 
> -----Original Message-----
> From: Oliver Zeigermann [mailto:ozeigermann@c1-fse.de] 
> Sent: Thursday, June 10, 2004 10:29 AM
> To: Jakarta Commons Developers List
> Subject: Re: [testutils] Is there any commons area for generic test code?
> 
> I could contribute a class called RendezvousBarrier. It is simple, but 
> very useful when testing stuff in concurrent szenarios and you want to 
> make non-deterministic runs of more than one thread deterministic for 
> certain tests.
> 
> Additionally, I have a set of methods that do comparison on files. They 
> include checking the content of text files as well as checking what 
> files are in certain directories.
> 
> A few other methods as well.
> 
> If of any interest I could offer to contribute and maintain all of them 
> in a testutils component...
> 
> Oliver
> 
> Alex Karasulu wrote:
> 
> 
>>Hi,
>>
>>I've often found it necessary to write some of the same test code
>>snippets over and over again.  Namely I'm referring to test cases for
>>private methods that use reflection as well as other common snippets of
>>code dealing with unit tests.  Some of these snippets could have become
>>JUnit extensions.
>>
>>Is there a place where we can collect and localize utility methods and
>>classes used for unit testing?  I have not found anything yet.
>>
>>Is it even worth doing this?
>>
>>If the answer is "no", then "yes" to the two questions above, is it
>>worth creating a sandbox area where we can start gathering useful
>>utilities for unit testing?  
>>
>>IMO most projects could benefit from unit testing utilities or
>>extensions that do not come out of the box with JUnit or mock objects. 
>>Personally I'm looking for a place where I can keep generic test code
>>that could be used across projects, while sharing testing strategies and
>>techniques with others.  Sometimes nothing better communicates ideas
>>than actual code.  So if nothing already exists perhaps we can use this
>>area as a place to gather modest utilities; very simple tools.  It can
>>grow as demands increase and need not be a full fledged production:
>>meaning there is no rush or stress to make it into a release or a
>>deliverable.  
>>
>>Also perhaps things like the commons collections testing framework could
>>be kept here as well.  Don't if this is the right thing to do but just a
>>thought.  It might not be a good idea since it is so specific to
>>collections but this can be discussed over time.
>>
>>Why this email now?
>>
>>I sat down this morning to write a few JUnit tests and realized I needed
>>to write the same darn utility code over again for common issues I deal
>>with while testing.  That's what triggered this email.  9 out of 10
>>times I can find existing JUnit AddOns that help but sometimes they need
>>to be altered or augmented in some respect.  Rather then impose
>>dependencies where I cannot make additions to the code I thought it
>>would be nice if we had our own test utilities where additions can be
>>made on demand.  I thought for sure others had this wish at some point.
>>
>>WDYT?
>>
>>Alex
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Oliver Zeigermann <oz...@c1-fse.de>.
I suppose you refer to CyclicBarrier, right? Actually, RendezvousBarrier 
is heaviliy "inspired" by this one, but addionally allows to increase 
the barries without the current thread being forced to wait for the 
others. Maybe it would have been possible to use the one from Douge Lea 
anyway, but is it worth including the whole package?

Cheers,
Oliver

James Carman wrote:

> That sort of code (the rendezvous) is going to be included in the 1.5
> release of Java.  In the meantime, it's included in a code library
> http://gee.cs.oswego.edu/dl/cpj/) by Doug Lea who wrote Concurrent
> Programming in Java.
> 
> -----Original Message-----
> From: Oliver Zeigermann [mailto:ozeigermann@c1-fse.de] 
> Sent: Thursday, June 10, 2004 10:29 AM
> To: Jakarta Commons Developers List
> Subject: Re: [testutils] Is there any commons area for generic test code?
> 
> I could contribute a class called RendezvousBarrier. It is simple, but 
> very useful when testing stuff in concurrent szenarios and you want to 
> make non-deterministic runs of more than one thread deterministic for 
> certain tests.
> 
> Additionally, I have a set of methods that do comparison on files. They 
> include checking the content of text files as well as checking what 
> files are in certain directories.
> 
> A few other methods as well.
> 
> If of any interest I could offer to contribute and maintain all of them 
> in a testutils component...
> 
> Oliver
> 
> Alex Karasulu wrote:
> 
> 
>>Hi,
>>
>>I've often found it necessary to write some of the same test code
>>snippets over and over again.  Namely I'm referring to test cases for
>>private methods that use reflection as well as other common snippets of
>>code dealing with unit tests.  Some of these snippets could have become
>>JUnit extensions.
>>
>>Is there a place where we can collect and localize utility methods and
>>classes used for unit testing?  I have not found anything yet.
>>
>>Is it even worth doing this?
>>
>>If the answer is "no", then "yes" to the two questions above, is it
>>worth creating a sandbox area where we can start gathering useful
>>utilities for unit testing?  
>>
>>IMO most projects could benefit from unit testing utilities or
>>extensions that do not come out of the box with JUnit or mock objects. 
>>Personally I'm looking for a place where I can keep generic test code
>>that could be used across projects, while sharing testing strategies and
>>techniques with others.  Sometimes nothing better communicates ideas
>>than actual code.  So if nothing already exists perhaps we can use this
>>area as a place to gather modest utilities; very simple tools.  It can
>>grow as demands increase and need not be a full fledged production:
>>meaning there is no rush or stress to make it into a release or a
>>deliverable.  
>>
>>Also perhaps things like the commons collections testing framework could
>>be kept here as well.  Don't if this is the right thing to do but just a
>>thought.  It might not be a good idea since it is so specific to
>>collections but this can be discussed over time.
>>
>>Why this email now?
>>
>>I sat down this morning to write a few JUnit tests and realized I needed
>>to write the same darn utility code over again for common issues I deal
>>with while testing.  That's what triggered this email.  9 out of 10
>>times I can find existing JUnit AddOns that help but sometimes they need
>>to be altered or augmented in some respect.  Rather then impose
>>dependencies where I cannot make additions to the code I thought it
>>would be nice if we had our own test utilities where additions can be
>>made on demand.  I thought for sure others had this wish at some point.
>>
>>WDYT?
>>
>>Alex
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [testutils] Is there any commons area for generic test code?

Posted by James Carman <ja...@carmanconsulting.com>.
That sort of code (the rendezvous) is going to be included in the 1.5
release of Java.  In the meantime, it's included in a code library
http://gee.cs.oswego.edu/dl/cpj/) by Doug Lea who wrote Concurrent
Programming in Java.

-----Original Message-----
From: Oliver Zeigermann [mailto:ozeigermann@c1-fse.de] 
Sent: Thursday, June 10, 2004 10:29 AM
To: Jakarta Commons Developers List
Subject: Re: [testutils] Is there any commons area for generic test code?

I could contribute a class called RendezvousBarrier. It is simple, but 
very useful when testing stuff in concurrent szenarios and you want to 
make non-deterministic runs of more than one thread deterministic for 
certain tests.

Additionally, I have a set of methods that do comparison on files. They 
include checking the content of text files as well as checking what 
files are in certain directories.

A few other methods as well.

If of any interest I could offer to contribute and maintain all of them 
in a testutils component...

Oliver

Alex Karasulu wrote:

> Hi,
> 
> I've often found it necessary to write some of the same test code
> snippets over and over again.  Namely I'm referring to test cases for
> private methods that use reflection as well as other common snippets of
> code dealing with unit tests.  Some of these snippets could have become
> JUnit extensions.
> 
> Is there a place where we can collect and localize utility methods and
> classes used for unit testing?  I have not found anything yet.
> 
> Is it even worth doing this?
> 
> If the answer is "no", then "yes" to the two questions above, is it
> worth creating a sandbox area where we can start gathering useful
> utilities for unit testing?  
> 
> IMO most projects could benefit from unit testing utilities or
> extensions that do not come out of the box with JUnit or mock objects. 
> Personally I'm looking for a place where I can keep generic test code
> that could be used across projects, while sharing testing strategies and
> techniques with others.  Sometimes nothing better communicates ideas
> than actual code.  So if nothing already exists perhaps we can use this
> area as a place to gather modest utilities; very simple tools.  It can
> grow as demands increase and need not be a full fledged production:
> meaning there is no rush or stress to make it into a release or a
> deliverable.  
> 
> Also perhaps things like the commons collections testing framework could
> be kept here as well.  Don't if this is the right thing to do but just a
> thought.  It might not be a good idea since it is so specific to
> collections but this can be discussed over time.
> 
> Why this email now?
> 
> I sat down this morning to write a few JUnit tests and realized I needed
> to write the same darn utility code over again for common issues I deal
> with while testing.  That's what triggered this email.  9 out of 10
> times I can find existing JUnit AddOns that help but sometimes they need
> to be altered or augmented in some respect.  Rather then impose
> dependencies where I cannot make additions to the code I thought it
> would be nice if we had our own test utilities where additions can be
> made on demand.  I thought for sure others had this wish at some point.
> 
> WDYT?
> 
> Alex
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [testutils] Is there any commons area for generic test code?

Posted by Oliver Zeigermann <oz...@c1-fse.de>.
I could contribute a class called RendezvousBarrier. It is simple, but 
very useful when testing stuff in concurrent szenarios and you want to 
make non-deterministic runs of more than one thread deterministic for 
certain tests.

Additionally, I have a set of methods that do comparison on files. They 
include checking the content of text files as well as checking what 
files are in certain directories.

A few other methods as well.

If of any interest I could offer to contribute and maintain all of them 
in a testutils component...

Oliver

Alex Karasulu wrote:

> Hi,
> 
> I've often found it necessary to write some of the same test code
> snippets over and over again.  Namely I'm referring to test cases for
> private methods that use reflection as well as other common snippets of
> code dealing with unit tests.  Some of these snippets could have become
> JUnit extensions.
> 
> Is there a place where we can collect and localize utility methods and
> classes used for unit testing?  I have not found anything yet.
> 
> Is it even worth doing this?
> 
> If the answer is "no", then "yes" to the two questions above, is it
> worth creating a sandbox area where we can start gathering useful
> utilities for unit testing?  
> 
> IMO most projects could benefit from unit testing utilities or
> extensions that do not come out of the box with JUnit or mock objects. 
> Personally I'm looking for a place where I can keep generic test code
> that could be used across projects, while sharing testing strategies and
> techniques with others.  Sometimes nothing better communicates ideas
> than actual code.  So if nothing already exists perhaps we can use this
> area as a place to gather modest utilities; very simple tools.  It can
> grow as demands increase and need not be a full fledged production:
> meaning there is no rush or stress to make it into a release or a
> deliverable.  
> 
> Also perhaps things like the commons collections testing framework could
> be kept here as well.  Don't if this is the right thing to do but just a
> thought.  It might not be a good idea since it is so specific to
> collections but this can be discussed over time.
> 
> Why this email now?
> 
> I sat down this morning to write a few JUnit tests and realized I needed
> to write the same darn utility code over again for common issues I deal
> with while testing.  That's what triggered this email.  9 out of 10
> times I can find existing JUnit AddOns that help but sometimes they need
> to be altered or augmented in some respect.  Rather then impose
> dependencies where I cannot make additions to the code I thought it
> would be nice if we had our own test utilities where additions can be
> made on demand.  I thought for sure others had this wish at some point.
> 
> WDYT?
> 
> Alex
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org