mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Added support for pagesize on site collections for preview
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10035 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -144,15 +144,31 @@ public class SiteServiceTest extends BaseWebScriptTest
|
||||
|
||||
public void testGetSites() throws Exception
|
||||
{
|
||||
// == Test basic GET with no filters ==
|
||||
|
||||
MockHttpServletResponse response = getRequest(URL_SITES, 200);
|
||||
JSONArray result = new JSONArray(response.getContentAsString());
|
||||
JSONArray result = new JSONArray(response.getContentAsString());
|
||||
assertNotNull(result);
|
||||
assertEquals(0, result.length());
|
||||
|
||||
// TODO formalise this test once i can be sure that i know what's already in the site store
|
||||
// ie: .. i need to clean up after myself in this test
|
||||
createSite("myPreset", GUID.generate(), "myTitle", "myDescription", true, 200);
|
||||
createSite("myPreset", GUID.generate(), "myTitle", "myDescription", true, 200);
|
||||
createSite("myPreset", GUID.generate(), "myTitle", "myDescription", true, 200);
|
||||
createSite("myPreset", GUID.generate(), "myTitle", "myDescription", true, 200);
|
||||
createSite("myPreset", GUID.generate(), "myTitle", "myDescription", true, 200);
|
||||
|
||||
System.out.println(response.getContentAsString());
|
||||
response = getRequest(URL_SITES, 200);
|
||||
result = new JSONArray(response.getContentAsString());
|
||||
assertNotNull(result);
|
||||
assertEquals(5, result.length());
|
||||
|
||||
response = getRequest(URL_SITES + "?size=3", 200);
|
||||
result = new JSONArray(response.getContentAsString());
|
||||
assertNotNull(result);
|
||||
assertEquals(3, result.length());
|
||||
|
||||
response = getRequest(URL_SITES + "?size=13", 200);
|
||||
result = new JSONArray(response.getContentAsString());
|
||||
assertNotNull(result);
|
||||
assertEquals(5, result.length());
|
||||
}
|
||||
|
||||
public void testGetSite() throws Exception
|
||||
@@ -378,5 +394,17 @@ public class SiteServiceTest extends BaseWebScriptTest
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(0, result.length());
|
||||
|
||||
response = getRequest("/api/people/" + USER_ONE + "/sites?size=1", 200);
|
||||
result = new JSONArray(response.getContentAsString());
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(1, result.length());
|
||||
|
||||
response = getRequest("/api/people/" + USER_ONE + "/sites?size=5", 200);
|
||||
result = new JSONArray(response.getContentAsString());
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(2, result.length());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user