mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Thumbnail Service: removed unessesary code to store transformation options on node, added GET for thumbnail collection resource, created thumbnails are kept in sync with the master file asynchronously
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9452 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -38,6 +38,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.apache.tools.ant.taskdefs.Sleep;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
|
||||
@@ -115,6 +116,12 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
|
||||
System.out.println(response.getContentAsString());
|
||||
}
|
||||
|
||||
// Check getAll whilst we are here
|
||||
MockHttpServletResponse getAllResp = this.getRequest(getThumbnailsURL(jpgNode), 200);
|
||||
JSONArray getArr = new JSONArray(getAllResp.getContentAsString());
|
||||
assertNotNull(getArr);
|
||||
assertEquals(0, getArr.length());
|
||||
|
||||
// Do a image transformation (medium)
|
||||
String url = "/api/node/" + jpgNode.getStoreRef().getProtocol() + "/" + jpgNode.getStoreRef().getIdentifier() + "/" + jpgNode.getId() + "/content/thumbnails";
|
||||
JSONObject tn = new JSONObject();
|
||||
@@ -127,6 +134,13 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
|
||||
System.out.println(thumbnailUrl);
|
||||
response = getRequest(thumbnailUrl, 200);
|
||||
|
||||
// Check getAll whilst we are here
|
||||
getAllResp = this.getRequest(getThumbnailsURL(jpgNode), 200);
|
||||
getArr = new JSONArray(getAllResp.getContentAsString());
|
||||
assertNotNull(getArr);
|
||||
assertEquals(1, getArr.length());
|
||||
assertEquals("medium", getArr.getJSONObject(0).get("thumbnailName"));
|
||||
|
||||
}
|
||||
|
||||
public void testCreateAsyncThumbnail() throws Exception
|
||||
@@ -154,7 +168,6 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
|
||||
getWait(jpgNode, "medium");
|
||||
}
|
||||
|
||||
|
||||
private void getWait(NodeRef node, String thumbnailName)
|
||||
throws Exception
|
||||
{
|
||||
|
Reference in New Issue
Block a user