Fix to thumbnail test which would fail if the PDF2SWF tool was not present

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9361 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-06-03 09:53:47 +00:00
parent 732d49ae4e
commit 7d0bd2863d

View File

@@ -101,17 +101,21 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
public void testCreateThumbnail() throws Exception
{
String url = "/api/node/" + pdfNode.getStoreRef().getProtocol() + "/" + pdfNode.getStoreRef().getIdentifier() + "/" + pdfNode.getId() + "/content/thumbnails";
System.out.println(url);
JSONObject tn = new JSONObject();
tn.put("thumbnailName", "webpreview");
System.out.println(tn.toString());
MockHttpServletResponse response = this.postRequest(url, 200, tn.toString(), "application/json");
//JSONObject result = new JSONObject(response.getContentAsString());
System.out.println(response.getContentAsString());
// Check for pdfToSWF transformation before doing test
if (this.contentService.getTransformer(MimetypeMap.MIMETYPE_PDF, MimetypeMap.MIMETYPE_FLASH) != null)
{
String url = "/api/node/" + pdfNode.getStoreRef().getProtocol() + "/" + pdfNode.getStoreRef().getIdentifier() + "/" + pdfNode.getId() + "/content/thumbnails";
System.out.println(url);
JSONObject tn = new JSONObject();
tn.put("thumbnailName", "webpreview");
System.out.println(tn.toString());
MockHttpServletResponse response = this.postRequest(url, 200, tn.toString(), "application/json");
//JSONObject result = new JSONObject(response.getContentAsString());
System.out.println(response.getContentAsString());
}
}