use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testValidXFInPageWithLocalizationWithDifferentCountry_Language.
/**
* Site with country_language localization
* XF component is defined in the page
* XF component points to a different country_language branch as the page
*/
@Test
void testValidXFInPageWithLocalizationWithDifferentCountry_Language() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(CH_FR_PAGE + "/jcr:content/root/xf-component-41");
assertEquals(XF_NAME, experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf41"));
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testCaching.
/**
* Tests that methods that cache results return the same object on subsequent calls.
*/
@Test
void testCaching() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(NO_LOC_PAGE + "/jcr:content/root/xf-component-1");
assertNotNull(experienceFragment.getName());
assertSame(experienceFragment.getName(), experienceFragment.getName());
assertNotNull(experienceFragment.getCssClassNames());
assertSame(experienceFragment.getCssClassNames(), experienceFragment.getCssClassNames());
assertNotNull(experienceFragment.getExportedItems());
assertSame(experienceFragment.getExportedItems(), experienceFragment.getExportedItems());
assertNotNull(experienceFragment.getLocalizedFragmentVariationPath());
assertSame(experienceFragment.getLocalizedFragmentVariationPath(), experienceFragment.getLocalizedFragmentVariationPath());
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testValidXFInPageWithLocalizationWithSameLanguage.
/* ------------------------------- Tests for a site with language localization (/en) -------------------------- */
/**
* Site with language localization
* XF component is defined in the page
* XF component points to the same language branch as the page
*/
@Test
void testValidXFInPageWithLocalizationWithSameLanguage() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(EN_PAGE + "/jcr:content/root/xf-component-10");
assertEquals(XF_NAME, experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf10"));
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testValidXFInTemplateWithLocalizationWithSameCountryLanguage.
/**
* Site with country-language localization
* XF component is defined in the template
* XF component points to the same country-language branch as the page
*/
@Test
void testValidXFInTemplateWithLocalizationWithSameCountryLanguage() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(PRODUCT_PAGE_TEMPLATE + "/structure/jcr:content/xf-component-20a", US_EN_PAGE);
assertEquals(XF_NAME, experienceFragment.getName());
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf20a"));
}
use of com.adobe.cq.wcm.core.components.models.ExperienceFragment in project aem-core-wcm-components by adobe.
the class ExperienceFragmentImplTest method testUndefinedXFInTemplateWithoutLocalization.
/**
* No localization structure
* XF component is defined in the template
* fragmentVariationPath is undefined
*/
@Test
void testUndefinedXFInTemplateWithoutLocalization() {
ExperienceFragment experienceFragment = getExperienceFragmentUnderTest(PRODUCT_PAGE_TEMPLATE + "/structure/jcr:content/xf-component-2a", NO_LOC_PAGE);
Utils.testJSONExport(experienceFragment, Utils.getTestExporterJSONPath(TEST_BASE, "xf2a"));
}
Aggregations