MCPcopy Create free account
hub / github.com/apache/cloudberry / TEST_F

Function TEST_F

gpcontrib/gpcloud/test/s3common_writer_test.cpp:109–128  ·  view source on GitHub ↗

We need to mock uploadPartOfData() and completeMultiPart() in GZip mode, because even an empty string will produce 20+ bytes for GZip header and trailer, and then in open() may flush those data into S3KeyWriter.

Source from the content-addressed store, hash-verified

107// because even an empty string will produce 20+ bytes for GZip header and trailer,
108// and then in open() may flush those data into S3KeyWriter.
109TEST_F(S3CommonWriteTest, UsingGZip) {
110 EXPECT_CALL(mockS3Interface, getUploadId(_))
111 .WillOnce(Invoke(&mockS3Interface, &MockS3InterfaceForCompressionWrite::mockGetUploadId));
112 EXPECT_CALL(mockS3Interface, uploadPartOfData(_, _, _, _))
113 .WillOnce(
114 Invoke(&mockS3Interface, &MockS3InterfaceForCompressionWrite::mockUploadPartOfData));
115 EXPECT_CALL(mockS3Interface, completeMultiPart(_, _, _))
116 .WillOnce(
117 Invoke(&mockS3Interface, &MockS3InterfaceForCompressionWrite::mockCompleteMultiPart));
118
119 S3Params params("s3://abc/def");
120 params.setAutoCompress(true);
121 params.setNumOfChunks(1);
122 params.setChunkSize(S3_ZIP_COMPRESS_CHUNKSIZE + 1);
123
124 this->open(params);
125
126 ASSERT_EQ(this->upstreamWriter, &this->compressWriter);
127 ASSERT_TRUE(NULL != dynamic_cast<CompressWriter *>(this->upstreamWriter));
128}
129
130// We need not to mock uploadPartOfData() and completeMultiPart() in plain mode,
131TEST_F(S3CommonWriteTest, UsingPlain) {

Callers

nothing calls this directly

Calls 9

setAutoCompressMethod · 0.80
setNumOfChunksMethod · 0.80
setChunkSizeMethod · 0.45
openMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45
getRawDataMethod · 0.45
simpleUncompressMethod · 0.45
getDataSizeMethod · 0.45

Tested by

no test coverage detected