use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testDMImageWithImagePreset.
protected void testDMImageWithImagePreset(String resourceType) {
context.contentPolicyMapping(resourceType, Image.PN_DESIGN_DYNAMIC_MEDIA_ENABLED, true);
Image image = getImageUnderTest(IMAGE33_PATH);
assertTrue(image.isDmImage());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE33_PATH));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testImageWithLazyThreshold.
protected void testImageWithLazyThreshold(String resourceType) {
context.contentPolicyMapping(resourceType, Image.PN_DESIGN_LAZY_THRESHOLD, 100);
Image image = getImageUnderTest(AbstractImageTest.IMAGE3_PATH);
assertEquals(100, image.getLazyThreshold());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, AbstractImageTest.IMAGE3_PATH + "-with-lazy-threshold"));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testDMImageWithSmartCropRenditionTwoSmartSizes.
protected void testDMImageWithSmartCropRenditionTwoSmartSizes(String resourceType) {
context.contentPolicyMapping(resourceType, new HashMap<String, Object>() {
{
put(Image.PN_DESIGN_DYNAMIC_MEDIA_ENABLED, true);
put(Image.PN_DESIGN_ALLOWED_RENDITION_WIDTHS, new int[] { 600, 800 });
}
});
Image image = getImageUnderTest(IMAGE36_PATH);
assertTrue(image.isDmImage());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE36_PATH + "-two-smart-sizes"));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testImageWithMoreThanOneSmartSize.
@Test
protected void testImageWithMoreThanOneSmartSize() {
context.contentPolicyMapping(resourceType, "allowedRenditionWidths", new int[] { 600, 700, 800, 2000, 2500 });
Image image = getImageUnderTest(AbstractImageTest.IMAGE0_PATH);
assertArrayEquals(new int[] { 600, 700, 800, 2000, 2500 }, image.getWidths());
assertFalse(image.isLazyEnabled());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, AbstractImageTest.IMAGE0_PATH));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testDMImage.
protected void testDMImage(String resourceType) {
context.contentPolicyMapping(resourceType, Image.PN_DESIGN_DYNAMIC_MEDIA_ENABLED, true);
Image image = getImageUnderTest(IMAGE32_PATH);
assertTrue(image.isDmImage());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE32_PATH));
}
Aggregations