01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.mock.core;
16:
17: import org.araneaframework.InputData;
18: import org.araneaframework.OutputData;
19: import org.araneaframework.Path;
20: import org.araneaframework.core.BaseWidget;
21:
22: /**
23: * @author "Toomas Römer" <toomas@webmedia.ee>
24: *
25: */
26: public class MockEventfulBaseWidget extends BaseWidget {
27: private static final long serialVersionUID = 1L;
28: private boolean updateCalled = false;
29: private boolean eventCalled = false;
30: private boolean renderCalled = false;
31: private boolean actionCalled = false;
32: private boolean destroyCalled = false;
33: private boolean disableCalled = false;
34: private boolean enableCalled = false;
35:
36: protected void action(Path path, InputData input, OutputData output)
37: throws Exception {
38: actionCalled = true;
39: }
40:
41: protected void update(InputData input) throws Exception {
42: updateCalled = true;
43: }
44:
45: protected void event(Path path, InputData input) throws Exception {
46: eventCalled = true;
47: }
48:
49: protected void render(OutputData output) throws Exception {
50: renderCalled = true;
51: }
52:
53: protected void disable() throws Exception {
54: super .disable();
55: disableCalled = true;
56: }
57:
58: protected void enable() throws Exception {
59: super .enable();
60: enableCalled = true;
61: }
62:
63: public void destroy() throws Exception {
64: destroyCalled = true;
65: }
66:
67: public boolean isActionCalled() {
68: return actionCalled;
69: }
70:
71: public boolean isEventCalled() {
72: return eventCalled;
73: }
74:
75: public boolean isRenderCalled() {
76: return renderCalled;
77: }
78:
79: public boolean isUpdateCalled() {
80: return updateCalled;
81: }
82:
83: public boolean getDestroyCalled() {
84: return destroyCalled;
85: }
86:
87: public boolean isDisableCalled() {
88: return disableCalled;
89: }
90:
91: public boolean isEnableCalled() {
92: return enableCalled;
93: }
94: }
|