String.format(baseComponentTag, "extensible='true'",
"<aura:attribute name='parentAttr1' type='String' default='mother'/>"
+ "<aura:attribute name='parentAttr2' type='String' default='father'/>"
+ "<aura:attribute name='relativeAttr' type='String' default='aunt'/>"));
Component parentCmp = Aura.getInstanceService().getInstance(parentDesc);
assertEquals("mother", parentCmp.getValue(new PropertyReferenceImpl("v.parentAttr1", AuraUtil
.getExternalLocation("direct attributeset access"))));
assertEquals("mother", parentCmp.getValue(new PropertyReferenceImpl("v.PARENTATTR1", AuraUtil
.getExternalLocation("direct attributeset access"))));
// 2. Attributes inherited through parent
DefDescriptor<ComponentDef> childDesc = addSourceAutoCleanup(ComponentDef.class, String.format(
baseComponentTag, String.format("extends='%s'", parentDesc.getDescriptorName()),
"<aura:set attribute='parentAttr2' value='godFather'/>"));
Component childCmp = Aura.getInstanceService().getInstance(childDesc);
assertEquals("mother", childCmp.getValue(new PropertyReferenceImpl("v.parentAttr1", AuraUtil
.getExternalLocation("direct attributeset access"))));
assertEquals("mother", childCmp.getValue(new PropertyReferenceImpl("v.PARENTAttr1", AuraUtil
.getExternalLocation("direct attributeset access"))));
assertEquals(
"mother",
childCmp.getSuper().getValue(
new PropertyReferenceImpl("v.pARENTAttr1", AuraUtil
.getExternalLocation("direct attributeset access"))));
// Override default value will not change the value on the child
assertEquals("father", childCmp.getValue(new PropertyReferenceImpl("v.PARENTAttr2", AuraUtil
.getExternalLocation("direct attributeset access"))));
// Override default value will not change the value on the parent,
// <aura:set> sets the
// value of the parent
assertEquals(
"godFather",
childCmp.getSuper().getValue(
new PropertyReferenceImpl("v.PARENTAttr2", AuraUtil
.getExternalLocation("direct attributeset access"))));
}