KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > actionflow > test > ActionHandler2


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.controller.actionflow.test;
8
9
10 import junit.framework.Assert;
11
12 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowAction;
13
14
15 /**
16  * This class is a ActionHandler for testing purposes
17  *
18  * @author Brian Pontarelli
19  */

20 public class ActionHandler2 {
21
22     private static boolean exceptionCalled;
23     public static boolean step3;
24
25
26     /**
27      * Constructs a new <code>ActionHandler2</code>.
28      */

29     public ActionHandler2() {
30         exceptionCalled = false;
31     }
32
33
34     /**
35      * Sets the called boolean and returns successException string
36      */

37     public Object JavaDoc handleException(ActionFlowAction action) {
38         exceptionCalled = true;
39         Assert.assertTrue("Action should be the exception",
40             action.getAction()instanceof Exception JavaDoc);
41         System.out.println("Handling Exception in ActionHandler2");
42         return "successException";
43     }
44
45     /**
46      * Handles step 3
47      */

48     public Object JavaDoc handleThreeStep3(ActionFlowAction action) {
49         step3 = true;
50         System.out.println("Handling threeStep3 in ActionHandler2");
51         return "success";
52     }
53
54     /**
55      * Gets the value of exceptionCalled
56      */

57     public static boolean isExceptionCalled() {
58         return exceptionCalled;
59     }
60 }
61
Popular Tags