use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testDMImageOneSmartSize.
protected void testDMImageOneSmartSize(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 });
}
});
Image image = getImageUnderTest(IMAGE32_PATH);
assertTrue(image.isDmImage());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE32_PATH + "-one-smart-size"));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testGetDataLayerJson.
protected void testGetDataLayerJson(String resourceType) {
Image image = getImageUnderTest(IMAGE6_PATH);
assertNotNull(image.getData());
String expected = "{\"image-db7ae5b54e\":{\"@type\":\"" + resourceType + "\",\"repo:modifyDate\":\"2017-03-20T08:33:42Z\",\"dc:title\":\"Adobe Systems Logo and Wordmark\",\"xdm:linkURL\":\"/core/content/test-image.html\",\"image\":{\"repo:id\":\"60a1a56e-f3f4-4021-a7bf-ac7a51f0ffe5\",\"repo:modifyDate\":\"2017-03-20T10:20:39Z\",\"@type\":\"image/gif\",\"repo:path\":\"/content/dam/core/images/Adobe_Systems_logo_and_wordmark.gif\",\"xdm:smartTags\":{\"nature\":0.74,\"lake\":0.79,\"water\":0.78,\"landscape\":0.75}}}}";
assertEquals(Json.createReader(new StringReader(expected)).read(), Json.createReader(new StringReader(image.getData().getJson())).read());
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testImageWithOneSmartSize.
@Test
@Override
protected void testImageWithOneSmartSize() {
context.contentPolicyMapping(resourceType, "allowedRenditionWidths", new int[] { 600 });
Image image = getImageUnderTest(AbstractImageTest.IMAGE3_PATH);
assertArrayEquals(new int[] { 600 }, image.getWidths());
assertFalse(image.isLazyEnabled());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, AbstractImageTest.IMAGE3_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 testDMImageWithImageModifiers.
protected void testDMImageWithImageModifiers(String resourceType) {
context.contentPolicyMapping(resourceType, Image.PN_DESIGN_DYNAMIC_MEDIA_ENABLED, true);
Image image = getImageUnderTest(IMAGE34_PATH);
assertTrue(image.isDmImage());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE34_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 testDMImageWithImagePresetTwoSmartSizes.
protected void testDMImageWithImagePresetTwoSmartSizes(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(IMAGE33_PATH);
assertTrue(image.isDmImage());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, IMAGE33_PATH + "-two-smart-sizes"));
}
Aggregations