Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@jakarta.apache.org Received: (qmail 55403 invoked by uid 500); 17 Aug 2001 19:53:50 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: "Avalon Development" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 55327 invoked from network); 17 Aug 2001 19:53:48 -0000 Message-ID: <3B7D763A.9B45C7B0@apache.org> Date: Fri, 17 Aug 2001 15:53:30 -0400 From: Berin Loritsch X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: "avalon-dev@jakarta.apache.org" Subject: 1st test with ExcaliburTestCase and our Monitors Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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