// attribute is in caps
DefDescriptor<ComponentDef> childDesc = addSourceAutoCleanup(ComponentDef.class, String.format(
baseComponentTag, String.format("extends='%s'", parentDesc.getDescriptorName()),
"<aura:set attribute='PARENTATTR' value='godmother'/>"));
Component childCmp = Aura.getInstanceService().getInstance(childDesc);
assertEquals("mother", childCmp.getValue(new PropertyReferenceImpl("v.parentAttr", AuraUtil
.getExternalLocation("direct attributeset access"))));
assertEquals(
"godmother",
childCmp.getSuper().getValue(
new PropertyReferenceImpl("v.parentAttr", AuraUtil
.getExternalLocation("direct attributeset access"))));
// 2. Attribute reference of facets in markup
DefDescriptor<ComponentDef> outerCmpDesc = addSourceAutoCleanup(
ComponentDef.class,
String.format(baseComponentTag, "",
String.format("<%s PARENTATTR='godfather'/>", parentDesc.getDescriptorName())));
Component outerCmp = Aura.getInstanceService().getInstance(outerCmpDesc);
Component innerCmp = extractFacetsFromComponent(outerCmp).get(0);
assertEquals(parentDesc.getQualifiedName(), innerCmp.getDescriptor().getQualifiedName());
assertEquals("godfather", innerCmp.getValue(new PropertyReferenceImpl("v.parentAttr", AuraUtil
.getExternalLocation("direct attributeset access"))));
// 3. Attribute reference of facets using aura:set
DefDescriptor<ComponentDef> outerCmpUsingSetAttributeDesc = addSourceAutoCleanup(ComponentDef.class,
String.format(baseComponentTag, "", String.format(
"<%1$s> <aura:set attribute='PARENTATTR' value='evilfather'/> </%1$s>",
parentDesc.getDescriptorName())));
outerCmp = Aura.getInstanceService().getInstance(outerCmpUsingSetAttributeDesc);
innerCmp = extractFacetsFromComponent(outerCmp).get(0);
assertEquals(parentDesc.getQualifiedName(), innerCmp.getDescriptor().getQualifiedName());
assertEquals("evilfather", innerCmp.getValue(new PropertyReferenceImpl("v.parentAttr", AuraUtil
.getExternalLocation("direct attributeset access"))));
}