Examples of ClientResource


Examples of com.nexirius.util.resource.ClientResource

    /**
     * create and initialize default instance
     */
    public static ViewerFactory getDefaultInstance(String resourceFileName)
            throws Exception {
        ClientResource resource = new ClientResourceImpl(resourceFileName);

        ClientResourceToolkit.initialise(resource);

        instance = new ViewerFactory(resource);
        instance.setCommandProcessor(new DefaultProcessor());
View Full Code Here

Examples of org.restlet.client.resource.ClientResource

     * @param serializer
     *            The object serializer.
     */
    public GwtClientProxy(String uri, String serializationPolicy,
            Serializer serializer) {
        this.clientResource = new ClientResource(uri);
        this.serializationPolicy = serializationPolicy;
        this.serializer = serializer;
    }
View Full Code Here

Examples of org.restlet.resource.ClientResource

    Reference validationURL = new Reference(casServerURL + "proxyValidate");
    validationURL.addQueryParameter("service", getServiceURL(request));
    validationURL.addQueryParameter("ticket", serviceTicket);
    validationURL.addQueryParameter("pgtUrl", getServiceURL(request));

    ClientResource serviceValidate = new ClientResource(validationURL);
    try {
      Representation validationResult = serviceValidate.get();
      ServiceResponse serviceResponse = ServiceResponseParser.parse(validationResult.getStream());

      if (serviceResponse instanceof AuthSuccess) {
        AuthSuccess authSuccess = (AuthSuccess)serviceResponse;
        request.getClientInfo().setUser(new User(authSuccess.getUser()));
View Full Code Here

Examples of org.restlet.resource.ClientResource

      }
    });
   
    server.start();
   
    new ClientResource("http://localhost:8182").get().write(System.out);
   
    server.stop();
  }
View Full Code Here

Examples of org.restlet.resource.ClientResource


    @Test
    public void testNoPaging() throws IOException, ResourceException, JSONException
    {
        ClientResource resource = new ClientResource(TestComponent.getBaseUrl() + "/numbers");
        assertError(resource);
    }
View Full Code Here

Examples of org.restlet.resource.ClientResource


    @Test
    public void testInvalidPaging() throws IOException, ResourceException, JSONException
    {
        ClientResource resource = new ClientResource(TestComponent.getBaseUrl() + "/numbers");
        resource.getRequest().getAttributes()
                .put(HeaderConstants.ATTRIBUTE_HEADERS, new Form(PagingHeaderResource.ITEM_RANGE_HEADER + "=foo"));
        assertError(resource);
    }
View Full Code Here

Examples of org.restlet.resource.ClientResource


    @Test
    public void testPaging() throws IOException, ResourceException, JSONException
    {
        ClientResource resource = new ClientResource(TestComponent.getBaseUrl() + "/numbers");
        resource.getRequest()
                .getAttributes()
                .put(HeaderConstants.ATTRIBUTE_HEADERS,
                        new Form(PagingHeaderResource.ITEM_RANGE_HEADER + "=items=5-23"));
        assertJson(resource);
    }
View Full Code Here

Examples of org.restlet.resource.ClientResource


    @Test
    public void testNoPaging() throws IOException, ResourceException, JSONException
    {
        ClientResource resource = new ClientResource(TestComponent.getBaseUrl() + "/numbers");
        assertError(resource);
    }
View Full Code Here

Examples of org.restlet.resource.ClientResource


    @Test
    public void testInvalidPaging() throws IOException, ResourceException, JSONException
    {
        ClientResource resource = new ClientResource(TestComponent.getBaseUrl() + "/numbers?foo");
        assertError(resource);
    }
View Full Code Here

Examples of org.restlet.resource.ClientResource


    @Test
    public void testPaging() throws IOException, ResourceException, JSONException
    {
        ClientResource resource = new ClientResource(TestComponent.getBaseUrl() + "/numbers?offset=5&pageSize=19");
        assertJson(resource);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.