commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [Math] How to use a class from the "test" source tree?
Date Wed, 13 Jun 2012 12:09:12 GMT
On Wed, Jun 13, 2012 at 12:34:51PM +0200, Benedikt Ritter wrote:
> Hi,
> 2012/6/13 Gilles Sadowski <>:
> > Hi.
> >
> >> >
> >> > Is there a way for an application to depend on the classes defined in the
> >> > "test" subtree of the code repository?
> >>
> >> If the component releases the test jar, then it should be possible.
> >
> > It seems that it's not released as a JAR (probably only in the zip/tar
> > and source archive).
> >
> >>
> >> But if the test code is more generally useful, perhaps it should be
> >> moved to the java subtree.
> >
> > I'd like to make it easy to use "PerfTestUtils" outside of the CM
> > development environment.
> >
> > Is it OK to move it to "main"? Before doing so, I also expected that more
> > people would have a look at it, and agree on the "methodology" (or suggest
> > ways to improve it) and API.
> >
> > When I move it, should it go to the top-level package "o.a.c.m"? Or maybe
> > into "util"? Or even a new "util/perf" subpackage (to separate utilities
> > used by the CM code from utilities used to test the code's performance?
> >
> I don't know, to me it feels rather strange to add a TestPerfUtil to
> the public API of a mathematical library.

I agree.
[That's why I put the class where it is.]

> OTOH TestPerfUtils looks to
> specific to be used outside the context of CM (it uses classes defined
> in CM).

I don't understand that. It's a (mini-)benchmarking tool; it can be used to
time any code, not just CM routines.

> I see two solutions:
> 1. if you need it just for one project, you could simply copy the
> class to that project in the test tree

No. The purpose is to provide a tool to anyone who claims that "changing
X in the CM code will improve performance", so that the claim is backed by
actual numbers.

> 2. if you need it for several projects and there are additional useful
> classes in the test tree that are concerned with tests in context of
> CM, a new component could be created that defines a dependency to CM.
> This dependency (commons-math-testutils ?!) could then be added to
> what ever project in the test scope.

A clean solution, but I don't think that there is enough code to be worth
the burden of a separate project.

A third solution is to indeed publish a JAR composed of the classes in the
"test" subtree of the repository, as hinted at by Sebb.
If it's OK, could someone please make the necessary changes (both for
producing official releases and for daily snapshots)?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message