Classes | Functions
log_batch_test.cpp File Reference
#include <aws/core/utils/logging/AWSLogging.h>
#include <aws/core/utils/logging/ConsoleLogSystem.h>
#include <cloudwatch_logs_common/utils/log_file_manager.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
Include dependency graph for log_batch_test.cpp:

Go to the source code of this file.

Classes

class  LogBatchTest
 
class  TestStrategy
 

Functions

int main (int argc, char **argv)
 
 TEST (DeleteOptionTest, file_manager_delete_true)
 
 TEST (DeleteOptionTest, file_manager_delete_false)
 
 TEST_F (LogBatchTest, test_readBatch_1_batch)
 
 TEST_F (LogBatchTest, test_readBatch_2_batches)
 
 TEST_F (LogBatchTest, test_readBatch_3_batches)
 
 TEST_F (LogBatchTest, test_2_week_delete_1_of_6)
 
 TEST_F (LogBatchTest, test_2_week_delete_4_of_6)
 
 TEST_F (LogBatchTest, test_2_week_delete_5_of_6)
 
 TEST_F (LogBatchTest, test_2_week_no_delete)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 255 of file log_batch_test.cpp.

TEST ( DeleteOptionTest  ,
file_manager_delete_true   
)

FileManagerStrategyOptions defined with delete_stale_data set to true. We expect isDeleteStaleData to return true.

Definition at line 238 of file log_batch_test.cpp.

TEST ( DeleteOptionTest  ,
file_manager_delete_false   
)

FileManagerStrategyOptions defined with delete_stale_data set to false. We expect isDeleteStaleData to return false.

Definition at line 248 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_readBatch_1_batch   
)

This test will group all logs into one batch since they are all within 24 hours of each other

Definition at line 152 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_readBatch_2_batches   
)

This test will group half the logs into one batch and half into another since there is > 24 hour difference from ONE_DAY_IN_MILLISEC+2 and 2

Definition at line 163 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_readBatch_3_batches   
)

This test will group three different batches since ONE_DAY_IN_MILLISEC*2+10, ONE_DAY_IN_MILLISEC+5, and 4 are all > 24 hours apart

Definition at line 174 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_2_week_delete_1_of_6   
)

We defined delete_stale_data as true in our FileManagerStrategyOptions In this test we expect that there will be two separate batches separated by > 24 hours and we expect that timestamp 0 will be deleted since it is > 14 days old.

Definition at line 187 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_2_week_delete_4_of_6   
)

We defined delete_stale_data as true in our FileManagerStrategyOptions In this test we expect that there will be two separate batches separated by > 24 hours and we expect that timestamp 0, 1, 3, 4 will be deleted since it is > 14 days old.

Definition at line 200 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_2_week_delete_5_of_6   
)

We defined delete_stale_data as true in our FileManagerStrategyOptions In this test we expect that there will be two separate batches separated by > 24 hours and we expect that timestamp 0, 1, 3, 4, and ONE_DAY_IN_MILLISEC will be deleted since it is > 14 days old.

Definition at line 213 of file log_batch_test.cpp.

TEST_F ( LogBatchTest  ,
test_2_week_no_delete   
)

We defined delete_stale_data as true in our FileManagerStrategyOptions In this test, we set the option delete_stale_data to false and expect that none of the logs will be deleted. We expect three batches separated by > 24 hours

Definition at line 226 of file log_batch_test.cpp.



cloudwatch_logs_common
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:24