01: /*
02: * Copyright 2006 Dan Shellman
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: */
16: package org.iscreen;
17:
18: /**
19: * This mock validator is for unit testing.
20: *
21: * @author Shellman, Dan
22: */
23: public class MockValidator extends BaseValidator {
24: protected Object service;
25: protected FailureMessage failure;
26: protected String constraint;
27:
28: /**
29: * Default constructor.
30: */
31: public MockValidator() {
32: } //end MockValidator()
33:
34: public void validate(ValidatorContext context, Object beanToValidate) {
35: } //end validate()
36:
37: public void setTestService(Object theService) {
38: service = theService;
39: } //end setTestService()
40:
41: public Object getTestService() {
42: return service;
43: } //end getTestService()
44:
45: public void setTestFailure(FailureMessage msg) {
46: failure = msg;
47: } //end setTestFailure()
48:
49: public FailureMessage getTestFailure() {
50: return failure;
51: } //end getTestFailure()
52:
53: public void setTestConstraint(String theConstraint) {
54: constraint = theConstraint;
55: } //end setTestConstraint()
56:
57: public String getTestConstraint() {
58: return constraint;
59: } //end getTestConstraint()
60: } //end MockValidator
|