Search in sources :

Example 1 with TxJSONProvider

use of org.nhindirect.monitor.providers.TxJSONProvider in project nhin-d by DirectProject.

the class TestUtils method getResource.

public static WebResource getResource(String serviceURL) {
    final ClientConfig config = new DefaultClientConfig();
    config.getSingletons().add(new TxJSONProvider());
    // need to set timeouts so we don't block forever in the event of a bad URL or hung web server
    config.getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, CONNECTION_TIMEOUT);
    config.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, READ_TIMEOUT);
    final Client client = Client.create(config);
    WebResource resource = client.resource(serviceURL);
    return resource;
}
Also used : DefaultClientConfig(com.sun.jersey.api.client.config.DefaultClientConfig) WebResource(com.sun.jersey.api.client.WebResource) DefaultClientConfig(com.sun.jersey.api.client.config.DefaultClientConfig) ClientConfig(com.sun.jersey.api.client.config.ClientConfig) Client(com.sun.jersey.api.client.Client) TxJSONProvider(org.nhindirect.monitor.providers.TxJSONProvider)

Aggregations

Client (com.sun.jersey.api.client.Client)1 WebResource (com.sun.jersey.api.client.WebResource)1 ClientConfig (com.sun.jersey.api.client.config.ClientConfig)1 DefaultClientConfig (com.sun.jersey.api.client.config.DefaultClientConfig)1 TxJSONProvider (org.nhindirect.monitor.providers.TxJSONProvider)1