[ 
https://issues.apache.org/jira/browse/BROOKLYN-561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16249406#comment-16249406
 ] 

Aled Sage commented on BROOKLYN-561:
------------------------------------

I suggest that we fix it by changing the coercion from String to URI: if it is 
an empty string, then return a null URI. I believe that is what people really 
expect in Brooklyn, when dealing with YAML inputs and sensors that look like 
empty strings.

> EnrichersSlightlySimplerYamlTest.testWithAppEnricher fails 
> non-deterministically
> --------------------------------------------------------------------------------
>
>                 Key: BROOKLYN-561
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-561
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>            Priority: Minor
>
> The test {{EnrichersSlightlySimplerYamlTest.testWithAppEnricher}} fails 
> non-deterministically in 1.0.0-SNAPSHOT:
> {noformat}
> 2017-11-10 20:17:47,520 INFO  TESTNG FAILED: "Surefire test" - 
> org.apache.brooklyn.qa.camp.EnrichersSlightlySimplerYamlTest.testWithAppEnricher()
>  finished in 1582 ms
> java.lang.AssertionError: Wrong URI:  expected [true] but found [false]
>         at 
> org.apache.brooklyn.qa.camp.EnrichersSlightlySimplerYamlTest.testWithAppEnricher(EnrichersSlightlySimplerYamlTest.java:90)
> {noformat}
> This is because the cluster and app's URIs are initially set to an empty 
> MAIN_URI! There is a joiner that takes the {{urls.list}} and generates an 
> empty string. This is coerced to a URI by calling {{URI.create("")}}, which 
> surprisingly gives you a URI with a null scheme, hostname, etc. You can make 
> the fail consistently by adding the assertions below before setting the IPs 
> on the members of the cluster:
> {noformat}
> EntityAsserts.assertAttributeEqualsContinually(cluster, Attributes.MAIN_URI, 
> null);
> EntityAsserts.assertAttributeEqualsContinually(app, Attributes.MAIN_URI, 
> null);
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to