avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject 1st test with ExcaliburTestCase and our Monitors
Date Fri, 17 Aug 2001 19:53:30 GMT
The tests pass with flying colors.  It turns out that the PropertyChangeListeners
need to be given some time to operate--and they can run outside the current thread.

We have two monitors:

The ActiveMonitor and the PassiveMonitor.

The ActiveMonitor polls the Resource every X milliseconds
(specified by the "frequency" element).  If the resource
has changed then the "last-modified" time changes.  This
allows you to monitor resources that might be altered by
third parties.

The PassiveMonitor does nothing except manage the Resources
in the same manner that all Monitors manage resources.

All Resources have the responsibility to notify all listeners
if it has been modified through the Resource class.  As both
an example and a practical example, the StreamResource is used
by all classes that manage the contents by IO streams.  When
a writing IO stream (obtained from the StreamResource) closes,
the StreamResource notifies all of its listeners.

It works pretty well!

The we can have an implementation of the Cache that is notified
by the Monitor section.

Also, you can test your own Monitors by adding a simple test
script to get the Monitor in question.

We might want to set up the ExcaliburTestCase so that the
initialize() and dispose() methods are called only once during
the life of the test.  In order to do that, we have to use a
TestDecorator that performs that action.

JUnit calls setUp() and tearDown() around each testXXXX() method.

---------------------------------------------------------------------
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