1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). 5 * You may not use this file except in compliance with the License. 6 * A copy of the License is located at 7 * 8 * http://aws.amazon.com/apache2.0 9 * 10 * or in the "license" file accompanying this file. This file is distributed 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 * express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 16 package software.amazon.awssdk.modulepath.tests.integtests; 17 18 import org.slf4j.Logger; 19 import org.slf4j.LoggerFactory; 20 import software.amazon.awssdk.testutils.service.AwsTestBase; 21 22 /** 23 * Base Api Call class 24 */ 25 public abstract class BaseApiCall extends AwsTestBase { 26 27 private static final Logger logger = LoggerFactory.getLogger(BaseApiCall.class); 28 29 private final String serviceName; 30 BaseApiCall(String serviceName)31 public BaseApiCall(String serviceName) { 32 this.serviceName = serviceName; 33 } 34 usingApacheClient()35 public void usingApacheClient() { 36 logger.info("Starting testing {} client with Apache http client", serviceName); 37 apacheClientRunnable().run(); 38 } 39 usingUrlConnectionClient()40 public void usingUrlConnectionClient() { 41 logger.info("Starting testing {} client with url connection http client", serviceName); 42 urlHttpConnectionClientRunnable().run(); 43 } 44 usingNettyClient()45 public void usingNettyClient() { 46 logger.info("Starting testing {} client with netty client", serviceName); 47 nettyClientRunnable().run(); 48 } 49 apacheClientRunnable()50 public abstract Runnable apacheClientRunnable(); 51 urlHttpConnectionClientRunnable()52 public abstract Runnable urlHttpConnectionClientRunnable(); 53 nettyClientRunnable()54 public abstract Runnable nettyClientRunnable(); 55 } 56