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:
Roy Wetherall
2008-06-11 15:27:03 +00:00
parent 7bea34b914
commit 132c0af749
5 changed files with 54 additions and 5 deletions

View File

@@ -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
{