org.scalatest.PrivateMethodTester

class Invoker

[source: org/scalatest/PrivateMethodTester.scala]

final class Invoker(target : AnyRef)
extends AnyRef
Class used via an implicit conversion to enable private methods to be tested.
Method Summary
def invokePrivate [T](invocation : Invocation[T]) : T
Invoke a private method. This method will attempt to invoke via reflection a private method. The name of the method to invoke is contained in the methodName field of the passed Invocation. The arguments to pass are contained in the args field. The object on which to invoke the private method is the target object passed to this Invoker's primary constructor. The type parameter, T, is the return type of the private method.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
def invokePrivate[T](invocation : Invocation[T]) : T
Invoke a private method. This method will attempt to invoke via reflection a private method. The name of the method to invoke is contained in the methodName field of the passed Invocation. The arguments to pass are contained in the args field. The object on which to invoke the private method is the target object passed to this Invoker's primary constructor. The type parameter, T, is the return type of the private method.
Parameters
invocation - the Invocation object containing the method name symbol and args of the invocation.
Returns
the value returned by the invoked private method
Throws
IllegalArgumentException - if the target object does not have a method of the name, with argument types compatible with the objects in the passed args array, specified in the passed Invocation object.


Copyright (C) 2001-2009 Artima, Inc. All rights reserved.