use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testInheritedPageImage_pageImageAltValueFromResource_withFileResource.
@Test
protected void testInheritedPageImage_pageImageAltValueFromResource_withFileResource() {
Image image = getImageUnderTest(PAGE3_IMAGE0_PATH);
assertEquals("/core/content/test_page3/_jcr_content/root/page3_image0.coreimg.png", image.getSrc(), "getSrc()");
assertEquals("featured image alt", image.getAlt(), "getAlt()");
assertNull(image.getFileReference(), "getFileReference()");
assertNull(image.getUuid(), "getUuid()");
assertEquals("image-96253254e2", image.getId(), "getId()");
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, PAGE3_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 testInheritedPageImage_fromTemplate_withLink.
@Test
protected void testInheritedPageImage_fromTemplate_withLink() {
Image image = getImageUnderTest(TEMPLATE_IMAGE_INHERITED_PATH2);
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, TEMPLATE_IMAGE_INHERITED_PATH2));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testImageWithOneSmartSizeAndPolicyDelegate.
@Override
@Test
protected void testImageWithOneSmartSizeAndPolicyDelegate() {
context.contentPolicyMapping(resourceType, "allowedRenditionWidths", new int[] { 600 });
context.request().setParameterMap(ImmutableMap.of("contentPolicyDelegatePath", IMAGE0_PATH));
Image image = getImageUnderTest(AbstractImageTest.IMAGE3_PATH);
assertArrayEquals(new int[] { 600 }, image.getWidths());
assertTrue(image.isLazyEnabled());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, AbstractImageTest.IMAGE3_PATH + "-with-policy-delegate"));
}
use of com.adobe.cq.wcm.core.components.models.Image in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ImageImplTest method testLazyLoadedDisabled.
@Test
protected void testLazyLoadedDisabled() {
context.contentPolicyMapping(resourceType, "disableLazyLoading", true, "allowedRenditionWidths", new int[] { 600 });
Image image = getImageUnderTest(AbstractImageTest.IMAGE3_PATH);
assertFalse(image.isLazyEnabled());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, AbstractImageTest.IMAGE3_PATH + "-with-lazy-loading-disabled"));
}
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.
@Override
@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());
assertTrue(image.isLazyEnabled());
Utils.testJSONExport(image, Utils.getTestExporterJSONPath(testBase, AbstractImageTest.IMAGE0_PATH));
}
Aggregations