org.gcube.common.clients.delegates
Class MockDelegate<S>

java.lang.Object
  extended by org.gcube.common.clients.delegates.MockDelegate<S>
Type Parameters:
S - the type of service endpoint stubs used by Calls
All Implemented Interfaces:
ProxyDelegate<S>

public class MockDelegate<S>
extends Object
implements ProxyDelegate<S>

A ProxyDelegate for mock testing.

Author:
Fabio Simeoni

Method Summary
 ProxyConfig<?,S> config()
          Returns the configuration of the proxy.
<V> V
make(Call<S,V> call)
          Makes a Call to a given service endpoint.
static
<S> ProxyDelegate<S>
mockDelegate(ProxyPlugin<?,S,?> plugin, S endpoint)
          Creates an instance with a ProxyPlugin and a mock endpoints.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mockDelegate

public static <S> ProxyDelegate<S> mockDelegate(ProxyPlugin<?,S,?> plugin,
                                                S endpoint)
Creates an instance with a ProxyPlugin and a mock endpoints.

Parameters:
plugin - the plugin
endpoint - the endpoint

make

public <V> V make(Call<S,V> call)
       throws Exception
Description copied from interface: ProxyDelegate
Makes a Call to a given service endpoint.

Specified by:
make in interface ProxyDelegate<S>
Type Parameters:
V - the type of the value returned from the call
Parameters:
call - the call
Returns:
the value returned from the call
Throws:
Exception - if the call fails

config

public ProxyConfig<?,S> config()
Description copied from interface: ProxyDelegate
Returns the configuration of the proxy.

Specified by:
config in interface ProxyDelegate<S>
Returns:
the configuration


Copyright © 2012. All Rights Reserved.