Package gwtappcontainer.server.apps.content

Examples of gwtappcontainer.server.apps.content.ContentAPI


    assertTrue(content.equals("content for mumbai"));
  }
 
  @Test
  public void canGetDefaultContentIfCityContentNotAvailable() {
    ContentAPI contentAPI = new ContentAPI();
   
    contentAPI.addNewTag("ishakriyaschedule_default", helper.loginAsDeveloper());
    contentAPI.setContent("content for default", "ishakriyaschedule_default", true, helper.loginAsPortalAdmin());
   
    GeoLocationAPI geoApi = new GeoLocationAPI();
    String content = geoApi.getContentForCity("ishakriyASchedule", "mUMBAi").object.toString();
    assertTrue(content.equals("content for default"));
  }
View Full Code Here


    assertTrue(response.statusCode == Status.ERROR_RESOURCE_DOES_NOT_EXIST)
  }
 
  @Test
  public void canGetDefaultContentIfCityContentNotPublished() {
    ContentAPI contentAPI = new ContentAPI();
   
    //add content for mumbai but don't publish it
    contentAPI.addNewTag("ishakriyaschedule_mumbai", helper.loginAsDeveloper());
    contentAPI.setContent("content for mumbai", "ishakriyaschedule_mumbai",
        false, helper.loginAsPortalAdmin());
   
    //add content for default
    contentAPI.addNewTag("ishakriyaschedule_default", helper.loginAsDeveloper());
    contentAPI.setContent("content for default", "ishakriyaschedule_default",
        true, helper.loginAsPortalAdmin());
   
    GeoLocationAPI api = new GeoLocationAPI();
    String content = api.getContentForCity("ishakriyaSchedule", "mumbai").object.toString();
    assertTrue(content.equals("content for default"));   
View Full Code Here

    assertTrue(content.equals("content for default"));   
  }
 
  @Test
  public void canGetMostReleventContent() {
    ContentAPI contentAPI = new ContentAPI();
   
    //add tags
    contentAPI.addNewTag("testtag_melbourne", helper.loginAsDeveloper());
    contentAPI.addNewTag("testtag_vic", helper.loginAsDeveloper());
    contentAPI.addNewTag("testtag_australia", helper.loginAsDeveloper());
    contentAPI.addNewTag("testtag_default", helper.loginAsDeveloper());
   
    //add content for city
    contentAPI.setContent("content for melbourne", "testtag_melbourne",
        true, helper.loginAsPortalAdmin());
   
    //add content for region
    contentAPI.setContent("content for victoria", "testtag_vic",
        true, helper.loginAsPortalAdmin());
   
    //add content for country
    contentAPI.setContent("content for australia", "testtag_australia",
        true, helper.loginAsPortalAdmin());
   
    //add default content
    contentAPI.setContent("content for default", "testtag_default",
        true, helper.loginAsPortalAdmin());
       
    //city content if available
    GeoLocationAPI geoLocationAPI = new GeoLocationAPI();
    APIResponse response = geoLocationAPI.
        getMostRelevantContent("testtag", "melbourne",
            "vic", "australia");   
    String content = (String) response.object;
    assertTrue(content.equals("content for melbourne"));
    assertTrue(response.userFriendlyMessage.contains("testtag_melbourne"));
   
    //region content if city content is not available
    response = geoLocationAPI.
        getMostRelevantContent("testtag", "portland",
            "vic", "australia");
    content = (String) response.object;
    assertTrue(content.equals("content for victoria"));
    assertTrue(response.userFriendlyMessage.contains("testtag_vic"));
   
    //country content if both city and region not available
    response = geoLocationAPI.
        getMostRelevantContent("testtag", "sydney",
            "new south wales", "australia");
    content = (String) response.object;
    assertTrue(content.equals("content for australia"));
    assertTrue(response.userFriendlyMessage.contains("testtag_australia"));
   
    //default content if city, region and country contents not available
    response = contentAPI.setPublishStatus("testtag_australia", false, helper.loginAsPortalAdmin());
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = geoLocationAPI.
        getMostRelevantContent("testtag", "sydney",
            "new south wales", "australia");
View Full Code Here

TOP

Related Classes of gwtappcontainer.server.apps.content.ContentAPI

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.