*/
public void testBasicProviderScenario() throws Exception {
Map<String, Object> attributes = Maps.newHashMap();
attributes.put("implNumber", "3");
Component component = Aura.getInstanceService().getInstance("test:test_Provider_Interface", ComponentDef.class,
attributes);
assertEquals("Java Provider: Failed to retrieve the right implementation for the interface.", component
.getDescriptor().getQualifiedName(), "markup://test:test_Provider_providerImpl3");
// Verify that the attributes passed off to the interface were inherited
// by the component provided by the provider
assertEquals("Failed to initialize attributes on the component",
component.getAttributes().getExpression("implNumber"), "3");
assertEquals("Failed to pass of arguments and its values from the interface to the provided component",
component.getAttributes().getExpression("defaultAttr"), "meh");
this.serializeAndGoldFile(component, "_providerImpl3");
attributes.put("implNumber", "1");
component = Aura.getInstanceService().getInstance("test:test_Provider_Interface", ComponentDef.class,
attributes);
assertEquals("Java Provider: Failed to retrieve the right implementation for the interface.", component
.getDescriptor().getQualifiedName(), "markup://test:test_Provider_providerImpl1");
// Verify that the attributes passed off to the interface were inherited
// by the component provided by the provider
assertEquals("Failed to initialize attributes on the component",
component.getAttributes().getExpression("implNumber"), "1");
assertEquals("Implementing component does not have its attributes",
component.getAttributes().getExpression("ComponentSpecificAttr"), "iammine");
this.serializeAndGoldFile(component, "_providerImpl1");
// Request a component which is using the interface
// test:test_Provider_Interface
component = Aura.getInstanceService().getInstance("test:test_Provider_Component", ComponentDef.class, null);
assertEquals("Java Provider: Failed to retrieve the component using the test interface.", component
.getDescriptor().getQualifiedName(), "markup://test:test_Provider_Component");
this.serializeAndGoldFile(component, "_component");
}