View Javadoc

1   /*
2    * The contents of this file are subject to the terms 
3    * of the Common Development and Distribution License 
4    * (the "License").  You may not use this file except 
5    * in compliance with the License.
6    * 
7    * You can obtain a copy of the license at 
8    * http://www.sun.com/cddl/cddl.html. 
9    * See the License for the specific language governing 
10   * permissions and limitations under the License.
11   * 
12   * When distributing Covered Code, include this CDDL 
13   * HEADER in each file and include the License file at 
14   * license.txt.  If applicable, add the following below 
15   * this CDDL HEADER, with the fields enclosed by brackets 
16   * "[]" replaced with your own identifying information: 
17   * Portions Copyright [yyyy] [name of copyright owner]
18   * 
19   * Portions Copyright 2004 eBay, Inc.
20   */
21  package com.ebay.carad.os.vitalsigns.dataretrievers;
22  
23  /***
24   * <p>Interface for any sort of logging functionality. It simply is invoked
25   * through .test() and returns a float value, which is intended to be logged
26   * somewhere.</p>
27   * 
28   * <p>Very useful for tests such as web tests logging overall time taken
29   * to perform entire test, etc...</p>
30   * 
31   * @author Jeremy Kraybill
32   * @author Jeremy Thomerson
33   * @version $Id$
34   */
35  public interface ITester extends Cloneable {
36  
37      public static final ITester NO_OP_TESTER = new ITester() {
38          public Object clone() throws CloneNotSupportedException {
39              return NO_OP_TESTER;
40          }
41          public float test() {
42              return 0;
43          }
44      };
45      
46  	/***
47  	 * Executes the test. If the test fails, the tester should throw a
48  	 * <code>ReportingException</code> rather than an <code>Error</code>.
49  	 * 
50  	 * @return the time in seconds to execute the test (if it ran successfully), or
51  	 * whatever other data this tester logs.
52  	 */
53  	public float test();
54  
55  	public Object clone() throws CloneNotSupportedException;
56  
57  }