Repository: brooklyn-server Updated Branches: refs/heads/master 01fe89134 -> a77b33878
Adds OnSubnetNetworkEnricherTest.testTransformWithDefaultPorts (broken) Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/ebbd3771 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/ebbd3771 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/ebbd3771 Branch: refs/heads/master Commit: ebbd37710fecf90e2e5f1af1cb20987159d8c8b5 Parents: 01fe891 Author: Aled Sage <aled.s...@gmail.com> Authored: Tue Oct 11 22:56:36 2016 +0100 Committer: Aled Sage <aled.s...@gmail.com> Committed: Tue Oct 11 22:56:36 2016 +0100 ---------------------------------------------------------------------- .../core/network/OnSubnetNetworkEnricherTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ebbd3771/core/src/test/java/org/apache/brooklyn/core/network/OnSubnetNetworkEnricherTest.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/brooklyn/core/network/OnSubnetNetworkEnricherTest.java b/core/src/test/java/org/apache/brooklyn/core/network/OnSubnetNetworkEnricherTest.java index 4f7dac5..0a896ab 100644 --- a/core/src/test/java/org/apache/brooklyn/core/network/OnSubnetNetworkEnricherTest.java +++ b/core/src/test/java/org/apache/brooklyn/core/network/OnSubnetNetworkEnricherTest.java @@ -196,6 +196,22 @@ public class OnSubnetNetworkEnricherTest extends BrooklynAppUnitTestSupport { assertAttributeEqualsEventually("stringHostAndPort.endpoint.mapped.subnet", ""+privateIp+":1234"); } + @Test(groups="Broken") + public <T> void testTransformsWithDefaultPorts() throws Exception { + AttributeSensor<String> stringUriWithHttpNoPort = Sensors.newStringSensor("string.uriWithHttpNoPort"); + AttributeSensor<String> stringUriWithHttpsNoPort = Sensors.newStringSensor("string.uriWithHttpsNoPort"); + + entity.sensors().set(Attributes.SUBNET_ADDRESS, privateIp); + entity.sensors().set(stringUriWithHttpNoPort, "http://"+publicIp+"/my/path"); + entity.sensors().set(stringUriWithHttpsNoPort, "https://"+publicIp+"/my/path"); + entity.addLocations(ImmutableList.of(machine)); + + entity.enrichers().add(EnricherSpec.create(OnSubnetNetworkEnricher.class)); + + assertAttributeEqualsEventually("string.uriWithHttpNoPort.mapped.subnet", "http://"+privateIp+"/my/path"); + assertAttributeEqualsEventually("string.uriWithHttpsNoPort.mapped.subnet", "https://"+privateIp+"/my/path"); + } + @Test public <T> void testIgnoresNonMatchingSensors() throws Exception { AttributeSensor<URI> sensor1 = Sensors.newSensor(URI.class, "my.different");