public void testHookExecution() throws Exception {
File script = copyOverFile("tx");
TransactionRequest tx = new TransactionRequest.WFS11(null);
TransactionResponse res = new TransactionResponse.WFS11(null);
Map context = new HashMap();
ScriptEngine eng = scriptMgr.createNewEngine(script);
eng.eval(new FileReader(script));
WfsTxHook hook = getScriptManager().lookupWfsTxHook(script);
hook.handleBefore(eng, tx, context);
hook.handlePreInsert(eng, null, tx, context);
hook.handlePostInsert(eng, null, tx, context);
hook.handlePreUpdate(eng, null, null, tx, context);
hook.handlePostUpdate(eng, null, null, tx, context);
hook.handlePreDelete(eng, null, tx, context);
hook.handlePostDelete(eng, null, tx, context);
hook.handlePreCommit(eng, tx, context);
hook.handlePostCommit(eng, tx, res, context);
hook.handleAbort(eng, tx, res, context);
assertTrue(context.containsKey("before"));
assertTrue(context.containsKey("preInsert"));
assertTrue(context.containsKey("postInsert"));
assertTrue(context.containsKey("preUpdate"));
assertTrue(context.containsKey("postUpdate"));
assertTrue(context.containsKey("preDelete"));
assertTrue(context.containsKey("postDelete"));
assertTrue(context.containsKey("preCommit"));
assertTrue(context.containsKey("postCommit"));
assertTrue(context.containsKey("abort"));
}