mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Thumbnail tests are explicity about checking that the transformer is actually working
- Previously, it just got the bean and assumed it was OK - Now it does a check to see that the image transformer is working before running the test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13888 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -34,6 +34,7 @@ import java.util.Map;
|
|||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.repo.content.transform.AbstractContentTransformerTest;
|
import org.alfresco.repo.content.transform.AbstractContentTransformerTest;
|
||||||
|
import org.alfresco.repo.content.transform.ContentTransformer;
|
||||||
import org.alfresco.repo.content.transform.magick.ImageResizeOptions;
|
import org.alfresco.repo.content.transform.magick.ImageResizeOptions;
|
||||||
import org.alfresco.repo.content.transform.magick.ImageTransformationOptions;
|
import org.alfresco.repo.content.transform.magick.ImageTransformationOptions;
|
||||||
import org.alfresco.repo.jscript.ClasspathScriptLocation;
|
import org.alfresco.repo.jscript.ClasspathScriptLocation;
|
||||||
@@ -85,187 +86,191 @@ public class ThumbnailServiceImplTest extends BaseAlfrescoSpringTest
|
|||||||
ContentModel.TYPE_FOLDER).getChildRef();
|
ContentModel.TYPE_FOLDER).getChildRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkTransformer()
|
||||||
/**
|
|
||||||
* TODO: Enable test (when build platform fixed) or ignore this change in merge to HEAD
|
|
||||||
*/
|
|
||||||
public void testDummy()
|
|
||||||
{
|
{
|
||||||
|
ContentTransformer transformer = this.contentService.getImageTransformer();
|
||||||
|
if (transformer == null)
|
||||||
|
{
|
||||||
|
fail("No transformer returned for 'getImageTransformer'");
|
||||||
|
}
|
||||||
|
// Check that it is working
|
||||||
|
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
||||||
|
if (!transformer.isTransformable(
|
||||||
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
|
imageTransformationOptions))
|
||||||
|
{
|
||||||
|
fail("Image transformer is not working. Please check your image conversion command setup.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCreateThumbnailFromImage() throws Exception
|
public void testCreateThumbnailFromImage() throws Exception
|
||||||
{
|
{
|
||||||
// Check that the image transformations are available
|
checkTransformer();
|
||||||
if (this.contentService.getImageTransformer() != null)
|
|
||||||
{
|
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||||
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
NodeRef gifOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_GIF);
|
||||||
NodeRef gifOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_GIF);
|
|
||||||
|
// ===== small: 64x64, marked as thumbnail ====
|
||||||
// ===== small: 64x64, marked as thumbnail ====
|
|
||||||
|
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
||||||
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
imageResizeOptions.setWidth(64);
|
||||||
imageResizeOptions.setWidth(64);
|
imageResizeOptions.setHeight(64);
|
||||||
imageResizeOptions.setHeight(64);
|
imageResizeOptions.setResizeToThumbnail(true);
|
||||||
imageResizeOptions.setResizeToThumbnail(true);
|
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
||||||
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
||||||
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
//ThumbnailDetails createOptions = new ThumbnailDetails();
|
||||||
//ThumbnailDetails createOptions = new ThumbnailDetails();
|
|
||||||
|
NodeRef thumbnail1 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
NodeRef thumbnail1 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
imageTransformationOptions,
|
||||||
imageTransformationOptions,
|
"small");
|
||||||
"small");
|
assertNotNull(thumbnail1);
|
||||||
assertNotNull(thumbnail1);
|
checkThumbnailed(jpgOrig, "small");
|
||||||
checkThumbnailed(jpgOrig, "small");
|
checkThumbnail("small", thumbnail1);
|
||||||
checkThumbnail("small", thumbnail1);
|
outputThumbnailTempContentLocation(thumbnail1, "jpg", "small - 64x64, marked as thumbnail");
|
||||||
outputThumbnailTempContentLocation(thumbnail1, "jpg", "small - 64x64, marked as thumbnail");
|
|
||||||
|
// ===== small2: 64x64, aspect not maintained ====
|
||||||
// ===== small2: 64x64, aspect not maintained ====
|
|
||||||
|
ImageResizeOptions imageResizeOptions2 = new ImageResizeOptions();
|
||||||
ImageResizeOptions imageResizeOptions2 = new ImageResizeOptions();
|
imageResizeOptions2.setWidth(64);
|
||||||
imageResizeOptions2.setWidth(64);
|
imageResizeOptions2.setHeight(64);
|
||||||
imageResizeOptions2.setHeight(64);
|
imageResizeOptions2.setMaintainAspectRatio(false);
|
||||||
imageResizeOptions2.setMaintainAspectRatio(false);
|
ImageTransformationOptions imageTransformationOptions2 = new ImageTransformationOptions();
|
||||||
ImageTransformationOptions imageTransformationOptions2 = new ImageTransformationOptions();
|
imageTransformationOptions2.setResizeOptions(imageResizeOptions2);
|
||||||
imageTransformationOptions2.setResizeOptions(imageResizeOptions2);
|
//ThumbnailDetails createOptions2 = new ThumbnailDetails();
|
||||||
//ThumbnailDetails createOptions2 = new ThumbnailDetails();
|
NodeRef thumbnail2 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
NodeRef thumbnail2 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
imageTransformationOptions2,
|
||||||
imageTransformationOptions2,
|
"small2");
|
||||||
"small2");
|
checkThumbnailed(jpgOrig, "small2");
|
||||||
checkThumbnailed(jpgOrig, "small2");
|
checkThumbnail("small2", thumbnail2);
|
||||||
checkThumbnail("small2", thumbnail2);
|
outputThumbnailTempContentLocation(thumbnail2, "jpg", "small2 - 64x64, aspect not maintained");
|
||||||
outputThumbnailTempContentLocation(thumbnail2, "jpg", "small2 - 64x64, aspect not maintained");
|
|
||||||
|
// ===== half: 50%x50 =====
|
||||||
// ===== half: 50%x50 =====
|
|
||||||
|
ImageResizeOptions imageResizeOptions3 = new ImageResizeOptions();
|
||||||
ImageResizeOptions imageResizeOptions3 = new ImageResizeOptions();
|
imageResizeOptions3.setWidth(50);
|
||||||
imageResizeOptions3.setWidth(50);
|
imageResizeOptions3.setHeight(50);
|
||||||
imageResizeOptions3.setHeight(50);
|
imageResizeOptions3.setPercentResize(true);
|
||||||
imageResizeOptions3.setPercentResize(true);
|
ImageTransformationOptions imageTransformationOptions3 = new ImageTransformationOptions();
|
||||||
ImageTransformationOptions imageTransformationOptions3 = new ImageTransformationOptions();
|
imageTransformationOptions3.setResizeOptions(imageResizeOptions3);
|
||||||
imageTransformationOptions3.setResizeOptions(imageResizeOptions3);
|
// ThumbnailDetails createOptions3 = new ThumbnailDetails();
|
||||||
// ThumbnailDetails createOptions3 = new ThumbnailDetails();
|
NodeRef thumbnail3 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
NodeRef thumbnail3 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
imageTransformationOptions3,
|
||||||
imageTransformationOptions3,
|
"half");
|
||||||
"half");
|
checkThumbnailed(jpgOrig, "half");
|
||||||
checkThumbnailed(jpgOrig, "half");
|
checkThumbnail("half", thumbnail3);
|
||||||
checkThumbnail("half", thumbnail3);
|
outputThumbnailTempContentLocation(thumbnail3, "jpg", "half - 50%x50%");
|
||||||
outputThumbnailTempContentLocation(thumbnail3, "jpg", "half - 50%x50%");
|
|
||||||
|
|
||||||
|
// ===== half2: 50%x50 from gif =====
|
||||||
// ===== half2: 50%x50 from gif =====
|
|
||||||
|
ImageResizeOptions imageResizeOptions4 = new ImageResizeOptions();
|
||||||
ImageResizeOptions imageResizeOptions4 = new ImageResizeOptions();
|
imageResizeOptions4.setWidth(50);
|
||||||
imageResizeOptions4.setWidth(50);
|
imageResizeOptions4.setHeight(50);
|
||||||
imageResizeOptions4.setHeight(50);
|
imageResizeOptions4.setPercentResize(true);
|
||||||
imageResizeOptions4.setPercentResize(true);
|
ImageTransformationOptions imageTransformationOptions4 = new ImageTransformationOptions();
|
||||||
ImageTransformationOptions imageTransformationOptions4 = new ImageTransformationOptions();
|
imageTransformationOptions4.setResizeOptions(imageResizeOptions4);
|
||||||
imageTransformationOptions4.setResizeOptions(imageResizeOptions4);
|
// ThumbnailDetails createOptions4 = new ThumbnailDetails();
|
||||||
// ThumbnailDetails createOptions4 = new ThumbnailDetails();
|
NodeRef thumbnail4 = this.thumbnailService.createThumbnail(gifOrig, ContentModel.PROP_CONTENT,
|
||||||
NodeRef thumbnail4 = this.thumbnailService.createThumbnail(gifOrig, ContentModel.PROP_CONTENT,
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
imageTransformationOptions4,
|
||||||
imageTransformationOptions4,
|
"half2");
|
||||||
"half2");
|
checkThumbnailed(gifOrig, "half2");
|
||||||
checkThumbnailed(gifOrig, "half2");
|
checkThumbnail("half2", thumbnail4);
|
||||||
checkThumbnail("half2", thumbnail4);
|
outputThumbnailTempContentLocation(thumbnail4, "jpg", "half2 - 50%x50%, from gif");
|
||||||
outputThumbnailTempContentLocation(thumbnail4, "jpg", "half2 - 50%x50%, from gif");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDuplicationNames()
|
public void testDuplicationNames()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
if (contentService.getImageTransformer() != null)
|
checkTransformer();
|
||||||
|
|
||||||
|
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||||
|
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
||||||
|
imageResizeOptions.setWidth(64);
|
||||||
|
imageResizeOptions.setHeight(64);
|
||||||
|
imageResizeOptions.setResizeToThumbnail(true);
|
||||||
|
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
||||||
|
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
||||||
|
//ThumbnailDetails createOptions = new ThumbnailDetails();
|
||||||
|
NodeRef thumbnail1 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
|
imageTransformationOptions,
|
||||||
|
"small");
|
||||||
|
assertNotNull(thumbnail1);
|
||||||
|
checkThumbnailed(jpgOrig, "small");
|
||||||
|
checkThumbnail("small", thumbnail1);
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
|
||||||
imageResizeOptions.setWidth(64);
|
|
||||||
imageResizeOptions.setHeight(64);
|
|
||||||
imageResizeOptions.setResizeToThumbnail(true);
|
|
||||||
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
|
||||||
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
|
||||||
//ThumbnailDetails createOptions = new ThumbnailDetails();
|
|
||||||
NodeRef thumbnail1 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
imageTransformationOptions,
|
imageTransformationOptions,
|
||||||
"small");
|
"small");
|
||||||
assertNotNull(thumbnail1);
|
fail("A duplicate exception should have been raised");
|
||||||
checkThumbnailed(jpgOrig, "small");
|
}
|
||||||
checkThumbnail("small", thumbnail1);
|
catch (ThumbnailException exception)
|
||||||
|
{
|
||||||
try
|
// OK since this should have been thrown
|
||||||
{
|
|
||||||
this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
|
||||||
imageTransformationOptions,
|
|
||||||
"small");
|
|
||||||
fail("A duplicate exception should have been raised");
|
|
||||||
}
|
|
||||||
catch (ThumbnailException exception)
|
|
||||||
{
|
|
||||||
// OK since this should have been thrown
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testThumbnailUpdate()
|
public void testThumbnailUpdate()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
if (contentService.getImageTransformer() != null)
|
checkTransformer();
|
||||||
{
|
|
||||||
// First create a thumbnail
|
|
||||||
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
|
||||||
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
|
||||||
imageResizeOptions.setWidth(64);
|
|
||||||
imageResizeOptions.setHeight(64);
|
|
||||||
imageResizeOptions.setResizeToThumbnail(true);
|
|
||||||
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
|
||||||
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
|
||||||
NodeRef thumbnail1 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
|
||||||
imageTransformationOptions,
|
|
||||||
"small");
|
|
||||||
|
|
||||||
// Update the thumbnail
|
|
||||||
this.thumbnailService.updateThumbnail(thumbnail1, imageTransformationOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// First create a thumbnail
|
||||||
|
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||||
|
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
||||||
|
imageResizeOptions.setWidth(64);
|
||||||
|
imageResizeOptions.setHeight(64);
|
||||||
|
imageResizeOptions.setResizeToThumbnail(true);
|
||||||
|
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
||||||
|
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
||||||
|
NodeRef thumbnail1 = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
|
imageTransformationOptions,
|
||||||
|
"small");
|
||||||
|
|
||||||
|
// Update the thumbnail
|
||||||
|
this.thumbnailService.updateThumbnail(thumbnail1, imageTransformationOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testGetThumbnailByName()
|
public void testGetThumbnailByName()
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
if (contentService.getImageTransformer() != null)
|
checkTransformer();
|
||||||
{
|
|
||||||
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||||
|
|
||||||
// Check for missing thumbnail
|
// Check for missing thumbnail
|
||||||
NodeRef result1 = this.thumbnailService.getThumbnailByName(jpgOrig, ContentModel.PROP_CONTENT, "small");
|
NodeRef result1 = this.thumbnailService.getThumbnailByName(jpgOrig, ContentModel.PROP_CONTENT, "small");
|
||||||
assertNull("The thumbnail 'small' should have been missing", result1);
|
assertNull("The thumbnail 'small' should have been missing", result1);
|
||||||
|
|
||||||
// Create the thumbnail
|
// Create the thumbnail
|
||||||
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
|
||||||
imageResizeOptions.setWidth(64);
|
imageResizeOptions.setWidth(64);
|
||||||
imageResizeOptions.setHeight(64);
|
imageResizeOptions.setHeight(64);
|
||||||
imageResizeOptions.setResizeToThumbnail(true);
|
imageResizeOptions.setResizeToThumbnail(true);
|
||||||
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
||||||
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
||||||
this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT,
|
||||||
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
MimetypeMap.MIMETYPE_IMAGE_JPEG,
|
||||||
imageTransformationOptions,
|
imageTransformationOptions,
|
||||||
"small");
|
"small");
|
||||||
|
|
||||||
// Try and retrieve the thumbnail
|
// Try and retrieve the thumbnail
|
||||||
NodeRef result2 = this.thumbnailService.getThumbnailByName(jpgOrig, ContentModel.PROP_CONTENT, "small");
|
NodeRef result2 = this.thumbnailService.getThumbnailByName(jpgOrig, ContentModel.PROP_CONTENT, "small");
|
||||||
assertNotNull(result2);
|
assertNotNull(result2);
|
||||||
checkThumbnail("small", result2);
|
checkThumbnail("small", result2);
|
||||||
|
|
||||||
// Check for an other thumbnail that doesn't exist
|
// Check for an other thumbnail that doesn't exist
|
||||||
NodeRef result3 = this.thumbnailService.getThumbnailByName(jpgOrig, ContentModel.PROP_CONTENT, "anotherone");
|
NodeRef result3 = this.thumbnailService.getThumbnailByName(jpgOrig, ContentModel.PROP_CONTENT, "anotherone");
|
||||||
assertNull("The thumbnail 'anotherone' should have been missing", result3);
|
assertNull("The thumbnail 'anotherone' should have been missing", result3);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO test getThumbnails
|
// TODO test getThumbnails
|
||||||
@@ -325,35 +330,35 @@ public class ThumbnailServiceImplTest extends BaseAlfrescoSpringTest
|
|||||||
|
|
||||||
public void testAutoUpdate() throws Exception
|
public void testAutoUpdate() throws Exception
|
||||||
{
|
{
|
||||||
if (contentService.getImageTransformer() != null)
|
checkTransformer();
|
||||||
|
|
||||||
|
final NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||||
|
|
||||||
|
ThumbnailDefinition details = this.thumbnailService.getThumbnailRegistry().getThumbnailDefinition("medium");
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
final NodeRef thumbnail = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT, details.getMimetype(), details.getTransformationOptions(), details.getName());
|
||||||
|
|
||||||
|
setComplete();
|
||||||
|
endTransaction();
|
||||||
|
|
||||||
|
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>()
|
||||||
{
|
{
|
||||||
final NodeRef jpgOrig = createOrigionalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
public Object execute() throws Exception
|
||||||
|
{
|
||||||
ThumbnailDefinition details = this.thumbnailService.getThumbnailRegistry().getThumbnailDefinition("medium");
|
String ext = ThumbnailServiceImplTest.this.mimetypeMap.getExtension(MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
||||||
final NodeRef thumbnail = this.thumbnailService.createThumbnail(jpgOrig, ContentModel.PROP_CONTENT, details.getMimetype(), details.getTransformationOptions(), details.getName());
|
File origFile = AbstractContentTransformerTest.loadQuickTestFile(ext);
|
||||||
|
|
||||||
setComplete();
|
ContentWriter writer = ThumbnailServiceImplTest.this.contentService.getWriter(jpgOrig, ContentModel.PROP_CONTENT, true);
|
||||||
endTransaction();
|
writer.putContent(origFile);
|
||||||
|
|
||||||
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>()
|
return null;
|
||||||
{
|
}
|
||||||
public Object execute() throws Exception
|
});
|
||||||
{
|
|
||||||
String ext = ThumbnailServiceImplTest.this.mimetypeMap.getExtension(MimetypeMap.MIMETYPE_IMAGE_JPEG);
|
// TODO
|
||||||
File origFile = AbstractContentTransformerTest.loadQuickTestFile(ext);
|
// this test should wait for the async action to run .. will need to commit transaction for that thou!
|
||||||
|
|
||||||
ContentWriter writer = ThumbnailServiceImplTest.this.contentService.getWriter(jpgOrig, ContentModel.PROP_CONTENT, true);
|
//Thread.sleep(1000);
|
||||||
writer.putContent(origFile);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// this test should wait for the async action to run .. will need to commit transaction for that thou!
|
|
||||||
|
|
||||||
//Thread.sleep(1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testHTMLToImageAndSWF() throws Exception
|
public void testHTMLToImageAndSWF() throws Exception
|
||||||
|
Reference in New Issue
Block a user