jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [jclouds] danielestevez commented on a change in pull request #21: Adds methods listAll and listByLocation to VirtualMachineAPI
Date Tue, 14 May 2019 16:25:43 GMT
danielestevez commented on a change in pull request #21: Adds methods listAll and listByLocation
to VirtualMachineAPI
URL: https://github.com/apache/jclouds/pull/21#discussion_r283888904
 
 

 ##########
 File path: providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/compute/AzureComputeServiceLiveTest.java
 ##########
 @@ -67,6 +75,30 @@ public void initializeContext() {
       }, Names.named(TIMEOUT_RESOURCE_DELETED)));
    }
 
+   @Test(dependsOnMethods = "testSuspendResume")
+   @Override
+   public void testListNodesByIds() {
+      final Set<String> nodeIds = copyOf(transform(nodes, new Function<NodeMetadata,
String>() {
+
+         @Override
+         public String apply(NodeMetadata from) {
+            return from.getId();
+         }
+
+      }));
+
+      final Set<? extends ComputeMetadata> listedNodes = client.listNodesByIds(nodeIds);
+
+      assertEquals(listedNodes.size(), nodes.size());
+
+      for (ComputeMetadata listedNode : listedNodes) {
 
 Review comment:
   Sorry, i just added the commits but was writing the explanation:
   * First, after several tests, the case sensitivity problem will not affect the jclouds
provider
   * The only problem is this test, which uses the `Iterables.elementsEqual` method to compare
the node list. This one makes really strict validations (entered in this [commit](https://github.com/apache/jclouds/commit/c566418d87e7b9337e57efed03a6a5e5524e690b#diff-7f014b2e6f9ed5629b02d2b1085e32f7R578)
) like the order and case sensitivity. In Azure we could have some fields (as `providerId`)
changing case. (Note also than other tests like `testListNodes`, `testGet` or `testGetNodesWithDetails`
actually do a much more relaxed validation)
   * I'd really prefer to change the original method but i don't understand why it has all
of those validations. IMHO the base method should make lesser validations and the overrode
methods could add more validations if needed. 
    
   To be discussed! We could
   
   1. Override this one and add a comment
   2. Change the base method

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message