com.sleepycat.je.utilint
Interface TestHook<T>


public interface TestHook<T>

TestHook is used induce testing behavior that can't be provoked externally. For example, unit tests may use hooks to throw IOExceptions, or to cause waiting behavior. To use this, a unit test should extend TestHook with a class that overrides the desired method. The desired code will have a method that allows the unit test to specify a hook, and will execute the hook if it is non-null. This should be done within an assert like so: assert TestHookExecute(myTestHook); See Tree.java for examples.


Method Summary
 void doHook()
           
 void doHook(T obj)
           
 void doIOHook()
           
 T getHookValue()
           
 void hookSetup()
           
 

Method Detail

hookSetup

void hookSetup()

doIOHook

void doIOHook()
              throws IOException
Throws:
IOException

doHook

void doHook()

doHook

void doHook(T obj)

getHookValue

T getHookValue()


Copyright (c) 2004-2010 Oracle. All rights reserved.