##############################################################################
# JBoss, Home of Professional Open Source
# Copyright 2009, Red Hat and individual contributors
# by the @authors tag. See the copyright.txt in the distribution for a
# full listing of individual contributors.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this software; if not, write to the Free
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
#
# @authors Gary Brown
#

RULE test exception exit trigger for testVoidMethod
CLASS TestExceptionExitAuxiliary
METHOD testVoidMethod
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT: "+$^.getMessage())
ENDRULE

RULE test exception exit trigger for testStringMethod
CLASS TestExceptionExitAuxiliary
METHOD testStringMethod
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT: "+$^.getMessage())
ENDRULE

RULE test exception exit trigger for testMethodTryMultiCatch
CLASS TestExceptionExitAuxiliary
METHOD testMethodTryMultiCatch
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT: "+$^.getMessage())
ENDRULE

RULE test exception exit trigger for testMethodNestedTryCatch
CLASS TestExceptionExitAuxiliary
METHOD testMethodNestedTryCatch
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT: "+$^.getMessage())
ENDRULE

RULE test exception exit trigger for testMethodMultiRule A
CLASS TestExceptionExitAuxiliary
METHOD testMethodMultiRule
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT A: "+$^.getMessage());
    THROW new RuntimeException("oops!");
ENDRULE

RULE test exception exit trigger for testMethodMultiRule B
CLASS TestExceptionExitAuxiliary
METHOD testMethodMultiRule
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT B: "+$^.getMessage());
    THROW new RuntimeException("more oops!");
ENDRULE

RULE test exception exit trigger for testMethodMultiRule2 A
CLASS TestExceptionExitAuxiliary
METHOD testMethodMultiRule2
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT A: "+$^.getMessage());
    RETURN
ENDRULE

RULE test exception exit trigger for testMethodMultiRule2 B
CLASS TestExceptionExitAuxiliary
METHOD testMethodMultiRule2
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT B: "+$^.getMessage());
    RETURN
ENDRULE

  RULE test exception exit trigger for testMethodMultiRule3 A
CLASS TestExceptionExitAuxiliary
METHOD testMethodMultiRule3
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT A: "+$^.getMessage());
ENDRULE

RULE test exception exit trigger for testMethodMultiRule3 B
CLASS TestExceptionExitAuxiliary
METHOD testMethodMultiRule3
HELPER org.jboss.byteman.tests.helpers.Default
AT EXCEPTION EXIT
BIND test : Test = $0.getTest()
IF TRUE
DO test.log("EXCEPTIONAL EXIT B: "+$^.getMessage());
ENDRULE
