View Javadoc

1   /*
2    * Copyright (c) 2002 Peter Antman, Teknik i Media  <peter.antman@tim.se>
3    *
4    * $Id: Agent.java,v 1.1.1.1 2004/05/19 12:33:40 pra Exp $
5    *
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 2 of the License, or (at your option) any later version
10   * 
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this library; if not, write to the Free Software
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  package org.backsource.alert;
21  import java.util.Properties;
22  import junit.framework.Test;
23  /***
24   * Agent capabilities.
25   *
26   * <p>All agents in the alert framwork must be JUnit testcases. To be able
27   * to participate in an alert run they must also implement the extended
28   * Agent interface. This is because the tests in agent are dynamicall 
29   * instantiated an one testcase class may be used for multiple alerts.
30   * It must therefore be possible to give an instance of a testcase a unique
31   * name that is different from its class name and test method. It must also
32   * be possible to give it a unique set of properties.</p>
33   *
34   * <p>An agent will be given its name from the alert configuration file. It
35   * will also be given al the properties defined for that particular instance.</p>
36   * <p>Even if an Agent is a JUnit test case it should normally not throw an assert through the JUnit assert methods, but instead throw one if {@link AlertError} or {@link AlertWarning}, since these are threade specially by the AlertReporter.</p>
37   *<p>The allready avaliable agens are in {@link org.backsource.alert.agent}.</p> 
38   *
39   * @author <a href="mailto:pra@tim.se">Peter Antman</a>
40   * @version $Revision: 1.1.1.1 $
41   */
42  
43  public interface Agent extends Test {
44     /***
45      * Initialize the agent with a unique describing name and its properties.
46      */
47     public void initialize(String agentName, Properties prop) throws Exception;
48  }// Agent