KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > utilint > TestHook


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: TestHook.java,v 1.7 2006/10/30 21:14:29 bostic Exp $
7  */

8
9 package com.sleepycat.je.utilint;
10
11 import java.io.IOException JavaDoc;
12
13 /**
14  * TestHook is used induce testing behavior that can't be provoked externally.
15  * For example, unit tests may use hooks to throw IOExceptions, or to cause
16  * waiting behavior.
17  *
18  * To use this, a unit test should extend TestHook with a class that overrides
19  * the desired method. The desired code will have a method that allows the unit
20  * test to specify a hook, and will execute the hook if it is non-null.
21  */

22 public interface TestHook {
23
24     public void doIOHook()
25     throws IOException JavaDoc;
26
27     public void doHook();
28
29     public Object JavaDoc getHookValue();
30 }
31
Popular Tags