Package org.fusesource.restygwt.client

Examples of org.fusesource.restygwt.client.Resource


   
    @Test
    public void testCancelRequest() {

        //configure RESTY
        Resource resource = new Resource(GWT.getModuleBaseURL() + "api/getendpoint");


        ExampleService service = GWT.create(ExampleService.class);
        ((RestServiceProxy) service).setResource(resource);
View Full Code Here


  }

  public void testSimpleGeneration()
  {
    TestInterfaceA a = GWT.create(TestInterfaceA.class);
    ((RestServiceProxy)a).setResource(new Resource("/path/to/interfaceA"));
    TestInterfaceB b = a.getInterfaceB("fred");
    assertEquals("/path/to/interfaceA/interfaceB/fred", ((RestServiceProxy)b).getResource().getPath());
  }
View Full Code Here

    private static final int REQUEST_TIMEOUT = 2000;
    private Resource resource;

    @Override
    protected void gwtSetUp() throws Exception {
        resource = new Resource(GWT.getModuleBaseURL() + "jsonp-service");
    }
View Full Code Here

    private static final int REQUEST_TIMEOUT = 2000;
    private MethodService service;

    @Override
    protected void gwtSetUp() throws Exception {
        Resource resource = new Resource(GWT.getModuleBaseURL() + "test/fail");
        service = GWT.create(MethodService.class);
        ((RestServiceProxy) service).setResource(resource);
    }
View Full Code Here

    }

    public void testJsonResource() {

        // Initialize the pizza service..
        Resource resource = new Resource(GWT.getModuleBaseURL() + "pizza-service");

        JSONValue request = createRequestObject();

        resource.post().json(request).send(new JsonCallback() {
            public void onSuccess(Method method, JSONValue response) {
                assertNotNull(response);
                System.out.println(response);
                finishTest();
            }
View Full Code Here

        Defaults.setDispatcher(dispatcher);

        /*
         *  setup the service, usually done in gin
         */
        Resource resource = new Resource(GWT.getModuleBaseURL());
        final ModelChangeAnnotatedService service = GWT.create(ModelChangeAnnotatedService.class);
        ((RestServiceProxy) service).setResource(resource);

        final ModelChangedEventHandlerImpl handler = new ModelChangedEventHandlerImpl();
        eventBus.addHandler(ModelChangeEvent.TYPE, handler);
View Full Code Here

   
    @Override
    protected void gwtSetUp() throws Exception {
        super.gwtSetUp();       
        service = GWT.create(TestRestService.class)
        Resource resource = new Resource(GWT.getModuleBaseURL() + "echo");
        ((RestServiceProxy) service).setResource(resource);
    }
View Full Code Here


        /*
         *  setup the service, usually done in gin
         */
        Resource resource = new Resource(GWT.getModuleBaseURL());
        service = GWT.create(BlockingTimeoutService.class);
        ((RestServiceProxy) service).setResource(resource);
    }
View Full Code Here

    public void testTimeout() {

        org.fusesource.restygwt.client.Defaults.setRequestTimeout(1000);

        Resource resource = new Resource(GWT.getModuleBaseURL() + "api/getendpoint");

        ExampleService service = GWT.create(ExampleService.class);
        ((RestServiceProxy) service).setResource(resource);

        service.getExampleDto(new MethodCallback<ExampleDto>() {
View Full Code Here

        });
    }

    private void placeOrder() {
        PizzaService service = GWT.create(PizzaService.class);
        Resource resource = new Resource(GWT.getModuleBaseURL() + "pizza-service");
        ((RestServiceProxy) service).setResource(resource);

        PizzaOrder order = new PizzaOrder();
        order.delivery = true;
        order.delivery_address.add("3434 Pinerun Ave.");
View Full Code Here

TOP

Related Classes of org.fusesource.restygwt.client.Resource

Copyright © 2018 www.massapicom. 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.