KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jmock > core > Stub


1 /* Copyright (c) 2000-2004 jMock.org
2  */

3 package org.jmock.core;
4
5
6 /**
7  * An object that stubs the behaviour of a invokedMethod invocation on behalf of an
8  * {@link org.jmock.core.Invokable} object.
9  */

10 public interface Stub
11         extends SelfDescribing
12 {
13     /**
14      * Processes the invocation.
15      *
16      * @param invocation The invocation to stub.
17      * @return The result of the invocation, if not throwing an exception.
18      * Must return <code>null</code> if the invocation is of a invokedMethod with a void return type.
19      * @throws Throwable An exception to be thrown to the caller, if not returning a value. A checked exception
20      * thrown from this invokedMethod must be in the <code>throws</code> list of the invoked method.
21      */

22     Object JavaDoc invoke( Invocation invocation ) throws Throwable JavaDoc;
23 }
24
Popular Tags