ccc.commons
Class Testing

java.lang.Object
  extended by ccc.commons.Testing

public final class Testing
extends java.lang.Object

Helper methods for testing.

Author:
Civic Computing Ltd.

Method Summary
static void construct(java.lang.Class<?> clazz)
          Constructs an instance of a class.
static
<T> T
dummy(java.lang.Class<T> theInterface)
          Create a test dummy.
static java.lang.String dummyString(char c, int length)
          Create a dummy string by repeating the specified character, 'length' times.
static
<T> T
stub(java.lang.Class<T> theInterface)
          Create a test dummy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

dummy

public static <T> T dummy(java.lang.Class<T> theInterface)
Create a test dummy.

Type Parameters:
T - The type of the interface.
Parameters:
theInterface - The interface the dummy should implement.
Returns:
An instance of type T.

stub

public static <T> T stub(java.lang.Class<T> theInterface)
Create a test dummy.

Type Parameters:
T - The type of the interface.
Parameters:
theInterface - The interface the dummy should implement.
Returns:
An instance of type T.

dummyString

public static java.lang.String dummyString(char c,
                                           int length)
Create a dummy string by repeating the specified character, 'length' times.

Parameters:
c - The character to repeat.
length - The length of the string.
Returns:
The dummy string 'c*length'.

construct

public static void construct(java.lang.Class<?> clazz)
Constructs an instance of a class.

Calls the no-args constructor, making it accessible if necessary.

Parameters:
clazz - The class to construct.


Copyright © 2010. All Rights Reserved.