use of org.eclipse.ecf.remoteservice.client.IRemoteCallable in project ecf by eclipse.
the class RpcRemoteServiceTest method setUp.
protected void setUp() throws Exception {
container = createRpcContainer(RpcConstants.TEST_ECHO_TARGET);
IRemoteCallable callableEcho = RemoteCallableFactory.createCallable(RpcConstants.TEST_ECHO_METHOD_NAME, RpcConstants.TEST_ECHO_METHOD, new IRemoteCallParameter[] { new RemoteCallParameter(RpcConstants.TEST_ECHO_METHOD_PARAM) });
registrationEcho = registerCallable(container, callableEcho, null);
IRemoteCallable callableEchoProxy = RemoteCallableFactory.createCallable(IEcho.class.getName());
registrationEchoProxy = registerCallable(container, callableEchoProxy, null);
IRemoteCallable callableCalc = RemoteCallableFactory.createCallable(RpcConstants.TEST_CALC_PLUS_METHOD_NAME, RpcConstants.TEST_CALC_PLUS_METHOD, new IRemoteCallParameter[] { new RemoteCallParameter(RpcConstants.TEST_CALC_PLUS_METHOD_PARAM1), new RemoteCallParameter(RpcConstants.TEST_CALC_PLUS_METHOD_PARAM2) });
registrationCalc = registerCallable(container, callableCalc, null);
}
use of org.eclipse.ecf.remoteservice.client.IRemoteCallable in project ecf by eclipse.
the class RestRemoteServiceTest method setUp.
protected void setUp() throws Exception {
container = createRestContainer(RestConstants.TEST_TWITTER_TARGET);
IRemoteCallable callable = RestCallableFactory.createCallable(RestConstants.TEST_TWITTER_RESOURCEPATH);
registration = registerCallable(container, callable, null);
}
use of org.eclipse.ecf.remoteservice.client.IRemoteCallable in project ecf by eclipse.
the class RestServiceRegistrationTest method setUp.
protected void setUp() throws Exception {
container = createRestContainer(RestConstants.TEST_TWITTER_TARGET);
Dictionary properties = new Hashtable();
properties.put("user", "null");
IRemoteCallable callable = RestCallableFactory.createCallable("resourcePath");
registration = registerCallable(container, callable, properties);
}
use of org.eclipse.ecf.remoteservice.client.IRemoteCallable in project ecf by eclipse.
the class TwitterRemoteServiceTest method setUp.
protected void setUp() throws Exception {
// Create container
container = createRestContainer(RestConstants.TEST_TWITTER_TARGET);
// Get adapter
IRemoteServiceClientContainerAdapter adapter = (IRemoteServiceClientContainerAdapter) getRemoteServiceClientContainerAdapter(container);
// Setup authentication info
adapter.setConnectContextForAuthentication(ConnectContextFactory.createUsernamePasswordConnectContext(username, password));
// Setup resource handler
adapter.setResponseDeserializer(createRestResource());
// Create and register callable to register service
IRemoteCallParameter[] parameters1 = RemoteCallParameterFactory.createParameters("count", null);
// Setup callable
IRemoteCallable callable1 = RestCallableFactory.createCallable("getUserStatuses", "/statuses/user_timeline.json", parameters1);
IRemoteCallParameter[] parameters2 = RemoteCallParameterFactory.createParameters("body", null);
HttpPostRequestType requestType2 = new HttpPostRequestType(HttpPostRequestType.STRING_REQUEST_ENTITY);
IRemoteCallable callable2 = RestCallableFactory.createCallable("postMethodString", "/statuses/user_timeline.json", parameters2, requestType2);
IRemoteCallParameter[] parameters3 = RemoteCallParameterFactory.createParameters("body", null);
HttpPostRequestType requestType3 = new HttpPostRequestType(HttpPostRequestType.INPUT_STREAM_REQUEST_ENTITY);
IRemoteCallable callable3 = RestCallableFactory.createCallable("postMethodInputStream", "/statuses/user_timeline.json", parameters3, requestType3);
IRemoteCallParameter[] parameters4 = RemoteCallParameterFactory.createParameters("body", null);
HttpPostRequestType requestType4 = new HttpPostRequestType(HttpPostRequestType.BYTEARRAY_REQUEST_ENTITY);
IRemoteCallable callable4 = RestCallableFactory.createCallable("postMethodByteArray", "/statuses/user_timeline.json", parameters4, requestType4);
registration = adapter.registerCallables(new String[] { IUserTimeline.class.getName() }, new IRemoteCallable[][] { { callable1, callable2, callable3, callable4 } }, null);
}
Aggregations