jackye1995 commented on code in PR #4912:
URL: https://github.com/apache/iceberg/pull/4912#discussion_r885258008
##########
aws/src/test/java/org/apache/iceberg/aws/s3/TestS3InputStream.java:
##########
@@ -20,45 +20,216 @@
package org.apache.iceberg.aws.s3;
import com.adobe.testing.s3mock.junit4.S3MockRule;
+import java.io.EOFException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Function;
import org.apache.commons.io.IOUtils;
+import org.apache.iceberg.AssertHelpers;
+import org.apache.iceberg.aws.AwsProperties;
import org.apache.iceberg.io.RangeReadable;
import org.apache.iceberg.io.SeekableInputStream;
+import org.apache.iceberg.metrics.MetricsContext;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.sync.RequestBody;
+import software.amazon.awssdk.core.sync.ResponseTransformer;
import software.amazon.awssdk.services.s3.S3Client;
+import software.amazon.awssdk.services.s3.model.BucketAlreadyExistsException;
+import
software.amazon.awssdk.services.s3.model.BucketAlreadyOwnedByYouException;
import software.amazon.awssdk.services.s3.model.CreateBucketRequest;
+import software.amazon.awssdk.services.s3.model.CreateBucketResponse;
+import software.amazon.awssdk.services.s3.model.GetObjectRequest;
+import software.amazon.awssdk.services.s3.model.GetObjectResponse;
+import software.amazon.awssdk.services.s3.model.HeadObjectRequest;
+import software.amazon.awssdk.services.s3.model.HeadObjectResponse;
+import software.amazon.awssdk.services.s3.model.InvalidObjectStateException;
+import software.amazon.awssdk.services.s3.model.NoSuchKeyException;
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
+import software.amazon.awssdk.services.s3.model.PutObjectResponse;
+import software.amazon.awssdk.services.s3.model.S3Exception;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThrows;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.spy;
public class TestS3InputStream {
@ClassRule
public static final S3MockRule S3_MOCK_RULE =
S3MockRule.builder().silent().build();
- private final S3Client s3 = S3_MOCK_RULE.createS3ClientV2();
+ private final S3Client s3Client = S3_MOCK_RULE.createS3ClientV2();
private final Random random = new Random(1);
@Before
public void before() {
- s3.createBucket(CreateBucketRequest.builder().bucket("bucket").build());
+
s3Client.createBucket(CreateBucketRequest.builder().bucket("bucket").build());
}
@Test
- public void testRead() throws Exception {
+ public void testReadWithNormalClient() throws Exception {
Review Comment:
cannot really figure out a way to do parameterized test here due to the use
of `S3MockRule`, parameterization always gives me initialization failure... I
will continue to see if I can remove the redundant tests, meanwhile I will also
update integration test to run against both normal client and a fuzzy client.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]