01: package org.jingle.mocquer.internal;
02:
03: /**
04: * This class is a nice implementation of BehaviorSet interface
05: *
06: * @author JianLu
07: * @version 1.0 2004-10-27
08: * @since 1.0
09: */
10: public class NiceBehaviorSet extends NormalBehaviorSet {
11: /**
12: * (non-Javadoc)
13: * @see org.jingle.mocquer.internal.NormalBehaviorSet#findBehavior(org.jingle.mockobject.internal.MockBehavior)
14: */
15: protected MockBehavior findBehavior(MockBehavior behavior) {
16: MockBehavior mb = super .findBehavior(behavior);
17: if (mb == null) {
18: mb = new MockBehavior();
19: mb.setMethod(behavior.getMethod());
20: mb.setArguments(behavior.getArguments());
21: mb.setRetValue(MockUtil.getDefaultValue(behavior
22: .getMethod().getReturnType()));
23: }
24: return mb;
25: }
26: }
|