01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: TestHook.java,v 1.7.2.2 2008/01/07 15:14:18 cwl Exp $
07: */
08:
09: package com.sleepycat.je.utilint;
10:
11: import java.io.IOException;
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() throws IOException;
25:
26: public void doHook();
27:
28: public Object getHookValue();
29: }
|