jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Turli <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs-aws] Health check and Subnet API (#70)
Date Sat, 21 Jan 2017 20:33:19 GMT
andreaturli commented on this pull request.



> +import javax.inject.Named;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+
+import org.jclouds.aws.filters.FormSigner;
+import org.jclouds.elb.binders.BindSubnetIdsToIndexedFormParams;
+import org.jclouds.elb.xml.MemberResultHandler;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.FormParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
+
+/**
+ * Provides access to Amazon ELB via the Query API

please update the javadoc

> +import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.VirtualHost;
+import org.jclouds.rest.annotations.XMLResponseParser;
+
+/**
+ * Provides access to Amazon ELB via the Query API
+ * <p/>
+ * 
+ * @see <a href="http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/APIReference"
+ *      >doc</a>
+ */
+@RequestFilters(FormSigner.class)
+@VirtualHost
+public interface SubnetApi {
+
+

remove line

> +   @Path("/")
+   @XMLResponseParser(MemberResultHandler.class)
+   @FormParams(keys = ACTION, values = "AttachLoadBalancerToSubnets")
+   Set<String> attachLoadBalancerToSubnets(
+           @FormParam("LoadBalancerName") String loadBalancerName,
+           @BinderParam(BindSubnetIdsToIndexedFormParams.class) Iterable<String> subnetNames);
+
+   @Named("DetachLoadBalancerFromSubnets")
+   @POST
+   @Path("/")
+   @XMLResponseParser(MemberResultHandler.class)
+   @FormParams(keys = ACTION, values = "DetachLoadBalancerFromSubnets")
+   Set<String> detachLoadBalancerFromSubnets(
+           @FormParam("LoadBalancerName") String loadBalancerName,
+           @BinderParam(BindSubnetIdsToIndexedFormParams.class) Iterable<String> subnetNames);
+

remove line

> @@ -16,7 +16,7 @@
  */
 package org.jclouds.elb.features;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static org.assertj.core.util.Preconditions.checkNotNull;

why this import?

> +   @AfterClass
+   @Override
+   protected void tearDown() {
+      super.tearDown();
+      if (api.getLoadBalancerApi().get("test") != null) {
+         api.getLoadBalancerApi().delete("test");
+      }
+   }
+   
+   @Test
+   protected void testConfigureHealthCheck() {
+      final Set<String> result = api().attachLoadBalancerToSubnets(loadBalancer.getName(),
loadBalancer.getSubnets());
+   }
+
+   private void checkHealthCheck(HealthCheck healthCheck) {
+//      checkNotNull(healthCheck.getHealthyThreshold(), "Description cannot be null for InstanceState");

remove commented code or re-enable those lines if needed, thanks

> @@ -27,7 +27,7 @@
 
 import org.jclouds.aws.filters.FormSigner;
 import org.jclouds.elb.binders.BindAvailabilityZonesToIndexedFormParams;
-import org.jclouds.elb.xml.AvailabilityZonesResultHandler;
+import org.jclouds.elb.xml.MemberResultHandler;

why have you renamed this handler?

> +package org.jclouds.elb.features;
+
+import java.util.Set;
+
+import org.jclouds.elb.domain.HealthCheck;
+import org.jclouds.elb.domain.Listener;
+import org.jclouds.elb.domain.LoadBalancer;
+import org.jclouds.elb.domain.Protocol;
+import org.jclouds.elb.internal.BaseELBApiLiveTest;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+
+@Test(groups = "live", testName = "HealthCheckApiLiveTest")

set `testName` to `SubnetApiLiveTest`

> + *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.elb.features;
+
+import org.jclouds.elb.internal.BaseELBApiLiveTest;
+import org.testng.annotations.Test;
+
+@Test(groups = "live", testName = "SubnetApiLiveTest")
+public class SubnetApiLiveTest extends BaseELBApiLiveTest {

I think you wan to add 2 test methods for the 2 public methods of SubnetApi, as-is it doesn't
look really useful.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/70#pullrequestreview-17813810
Mime
View raw message