avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject JUnit AvalonTestCase
Date Thu, 09 Aug 2001 05:31:11 GMT

I've followed the discussion about dropping Testlet in favor of JUnit
with great interest.

What I think is missing in this area of unit tests of Avalon
components are specialized TestCases.

The idea came when I was looking at the DataSourceTestCase (and wanted
to adapt it for my own components). When one needs to test Components
you'll mostly need to create a logger (Loggable), maybe a Context
(Contextualizable), a Configuration object (Configurable) and sometimes
also a ComponentManager (Composer). And at least here where you have to
test a Composer you probably wish to have a CM setup easily. This is
what the aforementioned TestCases should set up for you.

If there is interest I'd like to contribute specialized JUnit
TestCases for Avalon. I initially thought of two TestCases:

FrameworkTestCase (uses framework.component.DefaultComponentManager)
ExcaliburTestCase (uses excalibur.component.ExcaliburComponentManager)

The discussion I'd like to make is about how things like Context,
Configuration (be it an already created Configuration object, a String
or a File containing the configuration) and the roles got passed into
the TestCase for setup of the CM. The possibilities are:

Constructor:
	This would set it up once for every test in the class but
	gives no possibility to change it (ie. Configuration,
	Context) for different tests.

separate method:
	This would allow to use it as a test case itself and it
	could be called every time you need to change something.

setup/tearDown method:
	This would set up the CM for every test (including disposing
	of the component itself in the tearDown method) but also no
	way to use different configs for different tests in the same
	TestCase.

Thoughts?

Giacomo


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


Mime
View raw message