001: /**
002: * Copyright 2006 Webmedia Group Ltd.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: **/package org.araneaframework.mock.core;
016:
017: import org.araneaframework.InputData;
018: import org.araneaframework.OutputData;
019: import org.araneaframework.Path;
020: import org.araneaframework.core.BaseApplicationWidget;
021:
022: /**
023: * @author "Toomas Römer" <toomas@webmedia.ee>
024: *
025: */
026: public class MockEventfulStandardWidget extends BaseApplicationWidget {
027: private boolean updateCalled = false;
028: private boolean eventProcessed = false;
029: private boolean renderCalled = false;
030: private boolean destroyCalled = false;
031:
032: private boolean actionCalled = false;
033:
034: private transient InputData input;
035: private transient OutputData output;
036: private transient Path path;
037:
038: public void render(OutputData output) {
039:
040: this .renderCalled = true;
041: }
042:
043: public void update(InputData input) throws Exception {
044: this .updateCalled = true;
045: this .input = input;
046: }
047:
048: public void event(Path path, InputData input) throws Exception {
049: eventProcessed = true;
050: this .path = path;
051: this .input = input;
052: super .event(path, input);
053: }
054:
055: public void action(Path path, InputData input, OutputData output)
056: throws Exception {
057: actionCalled = true;
058: this .path = path;
059: this .input = input;
060: this .output = output;
061: super .action(path, input, output);
062: }
063:
064: protected void handleAction(InputData input, OutputData output)
065: throws Exception {
066: }
067:
068: protected void handleEvent(InputData input) throws Exception {
069: }
070:
071: public void destroy() {
072: destroyCalled = true;
073: }
074:
075: public boolean getUpdateCalled() {
076: return updateCalled;
077: }
078:
079: public boolean getEventProcessed() {
080: return eventProcessed;
081: }
082:
083: public boolean getRenderCalled() {
084: return renderCalled;
085: }
086:
087: public boolean getActionCalled() {
088: return actionCalled;
089: }
090:
091: public InputData getInput() {
092: return input;
093: }
094:
095: public OutputData getOutput() {
096: return output;
097: }
098:
099: public boolean getDestroyCalled() {
100: return destroyCalled;
101: }
102:
103: public Path getPath() {
104: return path;
105: }
106:
107: public void setEventProcessed(boolean eventProcessed) {
108: this.eventProcessed = eventProcessed;
109: }
110: }
|