mirror of https://github.com/apache/jclouds.git
fix loginPort parsing in byon
This commit is contained in:
parent
2a4e89912b
commit
3621b0e8c7
|
@ -79,6 +79,7 @@ public class NodeToNodeMetadata implements Function<Node, NodeMetadata> {
|
|||
NodeMetadataBuilder builder = new NodeMetadataBuilder();
|
||||
builder.ids(from.getId());
|
||||
builder.name(from.getName());
|
||||
builder.loginPort(from.getLoginPort());
|
||||
builder.hostname(from.getHostname());
|
||||
builder.location(findLocationWithId(from.getLocationId()));
|
||||
builder.group(from.getGroup());
|
||||
|
|
|
@ -73,10 +73,15 @@ public class NodeToNodeMetadataTest {
|
|||
}
|
||||
|
||||
public static NodeMetadata expectedNodeMetadataFromResource(int id, String resource, Location location) {
|
||||
return expectedNodeMetadataFromResource(id, resource, location, 22);
|
||||
}
|
||||
|
||||
public static NodeMetadata expectedNodeMetadataFromResource(int id, String resource, Location location, int loginPort) {
|
||||
return new NodeMetadataBuilder()
|
||||
.ids("cluster-" + id)
|
||||
.group("hadoop")
|
||||
.name("cluster-" + id)
|
||||
.loginPort(loginPort)
|
||||
.hostname("cluster-" + id + ".mydomain.com")
|
||||
.location(location)
|
||||
.state(NodeState.RUNNING)
|
||||
|
@ -98,4 +103,9 @@ public class NodeToNodeMetadataTest {
|
|||
"virginia", provider)));
|
||||
assertEquals(credentialStore, ImmutableMap.of("node#cluster-1", new Credentials("myUser", NodesFromYamlTest.key)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNodesParseLoginPort() throws Exception {
|
||||
assertEquals(parser.apply(NodesFromYamlTest.TEST3), expectedNodeMetadataFromResource(2, resource, provider, 2022));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue