1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 }