Package gwtappcontainer.shared.apis

Examples of gwtappcontainer.shared.apis.APIResponse


   
    ContentAPI api = new ContentAPI();
    String tag = "tag_" + UUID.randomUUID();
   
    User user = UserServiceFactory.getUserService().getCurrentUser();
    APIResponse resp = api.addNewTag(tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    resp = api.getAllTags();
    assertTrue(resp.statusCode == Status.SUCCESS);
   
View Full Code Here


     
    //assign this tag to user
    helper.loginAsPortalAdmin();
    User user = UserServiceFactory.getUserService().getCurrentUser();
    ContentAPI contentApi = new ContentAPI();
    APIResponse resp = contentApi.assignUserAsContentAdmin(email,
        tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    //check if role exists
    AdminAPI adminApi = new AdminAPI();
View Full Code Here

    addNewTag(tag);
     
    //login as developer and assign this tag to user   
    ContentAPI contentApi = new ContentAPI();
   
    APIResponse response = contentApi.assignUserAsContentAdmin(email, tag,
        helper.loginAsDeveloper());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);   
  }
View Full Code Here

    String email = "test@example.com";
    addNewUser(email);
   
    ContentAPI api = new ContentAPI();
   
    APIResponse resp = api.assignUserAsContentAdmin(email, tag,
        helper.loginAsPortalAdmin());
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    String content = "dummy content";
    User user = helper.loginAs(email);
View Full Code Here

       
    ContentAPI api = new ContentAPI();
       
    String content = "dummy content";
    User user = helper.loginAsPortalAdmin();
    APIResponse resp = api.setContent(content, tag, false, user);
   
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    //ensure content can be retrieved
    resp = api.getContent(tag, user);
View Full Code Here

    for (int i = 0; i < 255; i++) {
      content.append("1");
    }
           
    User user = helper.loginAsPortalAdmin();
    APIResponse resp = api.setContent(content.toString(),
        tag, true, helper.loginAsPortalAdmin());
   
    resp = api.setLargeContent(tag, true,
        content.toString(), content.toString(), content.toString(),
        null, null, "1111", null, null, null,
View Full Code Here

    ContentAPI api = new ContentAPI();
       
    String content = "dummy content";
    User user = helper.loginAsPortalReadOnly();
       
    APIResponse resp = api.setContent(content, tag, false, user);
    assertTrue(resp.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);   
  }
View Full Code Here

       
    ContentAPI api = new ContentAPI();
       
    String content = "dummy content";
    User user = helper.loginAsPortalAdmin();
    APIResponse resp = api.setContent(content, tag, false, user);
   
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    //ensure error when not logged in     
    resp = api.getContent(tag, null);
View Full Code Here

       
    ContentAPI api = new ContentAPI();
       
    String content = "dummy content";
    User user = helper.loginAsPortalAdmin();
    APIResponse resp = api.setContent(content, tag, true, user);
   
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    //ensure content can be retrieved even without login
    resp = api.getContent(tag, null);
View Full Code Here

  public void getContentForInvalidTagGivesResourceNotFoundError() {
    String tag = "tag_" + UUID.randomUUID();
   
    ContentAPI api = new ContentAPI();
   
    APIResponse response = api.getContent(tag, helper.loginAsPortalAdmin());
    assertTrue(response.statusCode == Status.ERROR_RESOURCE_DOES_NOT_EXIST);   
  }
View Full Code Here

TOP

Related Classes of gwtappcontainer.shared.apis.APIResponse

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.