org.unitils.mock.dummy
Class DummyObjectUtil

java.lang.Object
  extended by org.unitils.mock.dummy.DummyObjectUtil

public class DummyObjectUtil
extends Object

Class for handling the dummy object behavior. A dummy object is a proxy that will return default values for every method. This can be used to quickly create test objects without having to worry about correctly filling in every field.

Author:
Filip Neven, Tim Ducheyne

Nested Class Summary
static class DummyObjectUtil.DummyObjectInvocationHandler
          Invocation handler for the dummy proxy object that will return default values for every invocation.
 
Constructor Summary
DummyObjectUtil()
           
 
Method Summary
static
<T> T
createDummy(Class<T> type)
          Creates the dummy proxy object.
static
<T> T
createDummy(Class<T> type, MockBehavior mockBehaviour)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyObjectUtil

public DummyObjectUtil()
Method Detail

createDummy

public static <T> T createDummy(Class<T> type)
Creates the dummy proxy object.

Parameters:
type - The type for the proxy, not null
Returns:
The proxy, not null

createDummy

public static <T> T createDummy(Class<T> type,
                                MockBehavior mockBehaviour)


Copyright © 2011. All Rights Reserved.