KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > controller > test > TestActionHandler


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.test;
8
9
10 import com.inversoft.verge.mvc.controller.Action;
11 import com.inversoft.verge.mvc.controller.ActionHandlerException;
12
13
14 /**
15  * <p>
16  * This class is a test action handler
17  * </p>
18  *
19  * @author Brian Pontarelli
20  */

21 public class TestActionHandler {
22
23     public boolean simple = false;
24     public boolean exception = false;
25     public final TestActionHandler2 handler2 = new TestActionHandler2();
26
27
28     /**
29      * Instantiates a new <code>TestActionHandler</code>
30      */

31     public TestActionHandler() {
32     }
33
34
35     /**
36      * Tests simple handling
37      */

38     public void handleTestSimple(Action event) {
39         System.out.println("Inside handleTestSimple");
40         simple = true;
41     }
42
43     /**
44      * Tests exception handling
45      */

46     public void handleTestException(Action event) throws ActionHandlerException {
47         System.out.println("Inside handleTestException");
48         exception = true;
49         throw new ActionHandlerException("test");
50     }
51
52     /**
53      * Property method for testing nested handles
54      */

55     public TestActionHandler2 getProperty() {
56         return handler2;
57     }
58
59     /**
60      * Tests exception
61      */

62     public void handleException(Action event) throws Exception JavaDoc {
63         System.out.println("Inside handleException");
64         throw new Exception JavaDoc("test");
65     }
66
67     /**
68      * Tests runtime exception
69      */

70     public void handleRuntimeException(Action event) throws RuntimeException JavaDoc {
71         System.out.println("Inside handleRuntimeException");
72         throw new RuntimeException JavaDoc("test");
73     }
74
75     /**
76      * Tests error
77      */

78     public void handleError(Action event) throws Error JavaDoc {
79         System.out.println("Inside handleError");
80         exception = true;
81         throw new Error JavaDoc("test");
82     }
83
84     /**
85      * Tests throwable
86      */

87     public void handleThrowable(Action event) throws Throwable JavaDoc {
88         System.out.println("Inside handleThrowable");
89         exception = true;
90         throw new Throwable JavaDoc("test");
91     }
92 }
Popular Tags