01: /*
02: * Copyright 2006-2007, Unitils.org
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.unitils.reflectionassert;
17:
18: /**
19: * Modes defining how to compare two values.
20: * No mode means strict comparison. Each of the modes specify some form of leniency when
21: * comparing the values: <ul>
22: * <li>ignore defaults: compare only fields (and inner values) that have a non default value (eg null) as exepected value</li>
23: * <li>lenient dates: do not compare actual date values, just that they both have a value or not</li>
24: * <li>lenient order: order is not important when comparing collections or arrays</li>
25: * </ul>
26: * The modes can be combined if needed.
27: *
28: * @author Tim Ducheyne
29: * @author Filip Neven
30: * @see org.unitils.reflectionassert.ReflectionComparator
31: */
32: public enum ReflectionComparatorMode {
33:
34: /**
35: * Ignore fields that do not have a default value for the left-hand (expected) side
36: */
37: IGNORE_DEFAULTS,
38:
39: /**
40: * Do not compare the actual time/date value, just that both left-hand (expected) and right-hand side are null or not null.
41: */
42: LENIENT_DATES,
43:
44: /**
45: * Do not compare the order of collections and arrays. Only check that all values of the left-hand (expected) side
46: * collection or array are also contained in the right-hand (actual) side and vice versa.
47: */
48: LENIENT_ORDER
49:
50: }
|