Github user aledsage commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/1093#issuecomment-163981939
How about a test like this in `ExternalConfigYamlTest`:
@Test
public void testExternalisedLocationConfigAccessedDuringLocationInit()
throws Exception {
String yaml = Joiner.on("\n").join(
"services:",
"- type: org.apache.brooklyn.core.test.entity.TestApplication",
"location:",
" aws-ec2:",
" identity: myidentity",
" credential: mycredential",
" region: $brooklyn:external(\"myprovider\", \"mykey\")");
TestApplication app = (TestApplication)
createAndStartApplication(new StringReader(yaml));
waitForApplicationTasks(app);
LocationInternal loc = (LocationInternal) Iterables.getOnlyElement(
app.getLocations() );
assertEquals(loc.config().getLocalBag().getDescription(),
"aws-ec2:myHardcodedVal");
}
Does that now pass for you? It fails for me in master:
org.apache.brooklyn.util.exceptions.CompoundRuntimeException: Unable to
instantiate item, 2 errors including: Transformer for brooklyn-camp gave an
error creating this plan: Illegal parameter for 'location' (aws-ec2); not
resolvable: java.lang.ClassCastException:
org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.BrooklynDslCommon$DslExternal
cannot be cast to java.lang.String
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---