Search in sources :

Example 1 with LogLevel

use of org.finra.herd.core.helper.LogLevel in project herd by FINRAOS.

the class BusinessObjectDataInitiateDestroyHelperServiceImplTest method testExecuteS3SpecificStepsWithLoggerLevelSetToInfo.

@Test
public void testExecuteS3SpecificStepsWithLoggerLevelSetToInfo() {
    String loggerName = BusinessObjectDataInitiateDestroyHelperServiceImpl.class.getName();
    LogLevel origLoggerLevel = getLogLevel(loggerName);
    setLogLevel(loggerName, LogLevel.INFO);
    try {
        runExecuteS3SpecificStepsTest();
    } finally {
        setLogLevel(loggerName, origLoggerLevel);
    }
}
Also used : LogLevel(org.finra.herd.core.helper.LogLevel) AbstractServiceTest(org.finra.herd.service.AbstractServiceTest) Test(org.junit.Test)

Example 2 with LogLevel

use of org.finra.herd.core.helper.LogLevel in project herd by FINRAOS.

the class DownloaderControllerTest method testPerformDownloadWithLoggerLevelSetToWarn.

@Test
public void testPerformDownloadWithLoggerLevelSetToWarn() throws Exception {
    LogLevel origLoggerLevel = getLogLevel(DownloaderController.class);
    setLogLevel(DownloaderController.class, LogLevel.WARN);
    try {
        runDownload();
    } finally {
        setLogLevel(DownloaderController.class, origLoggerLevel);
    }
}
Also used : LogLevel(org.finra.herd.core.helper.LogLevel) Test(org.junit.Test)

Example 3 with LogLevel

use of org.finra.herd.core.helper.LogLevel in project herd by FINRAOS.

the class UploaderControllerTest method testPerformUploadWithLoggerLevelSetToWarn.

@Test
public void testPerformUploadWithLoggerLevelSetToWarn() throws Exception {
    LogLevel origLoggerLevel = getLogLevel(UploaderController.class);
    setLogLevel(UploaderController.class, LogLevel.WARN);
    try {
        // Upload and register business object data parents.
        uploadAndRegisterTestDataParents(uploaderWebClient);
        runUpload(UploaderController.MIN_THREADS);
    } finally {
        setLogLevel(UploaderController.class, origLoggerLevel);
    }
}
Also used : LogLevel(org.finra.herd.core.helper.LogLevel) Test(org.junit.Test)

Example 4 with LogLevel

use of org.finra.herd.core.helper.LogLevel in project herd by FINRAOS.

the class UploaderControllerTest method testPerformUploadWithIoExceptionDuringUpdateBusinessObjectDataStatus.

@Test(expected = IOException.class)
public void testPerformUploadWithIoExceptionDuringUpdateBusinessObjectDataStatus() throws Exception {
    // Turn off logging since this test will log a stack trace as a warning.
    LogLevel originalLogLevel = getLogLevel(UploaderWebClient.class);
    setLogLevel(UploaderWebClient.class, LogLevel.OFF);
    try {
        runUpload(UploaderController.MIN_THREADS, null, false, false, MockHttpClientOperationsImpl.HOSTNAME_THROW_IO_EXCEPTION_DURING_UPDATE_BDATA_STATUS, null);
    } finally {
        setLogLevel(UploaderWebClient.class, originalLogLevel);
    }
}
Also used : LogLevel(org.finra.herd.core.helper.LogLevel) Test(org.junit.Test)

Example 5 with LogLevel

use of org.finra.herd.core.helper.LogLevel in project herd by FINRAOS.

the class UploaderControllerTest method testPerformUploadWithInfoLoggingEnabled.

@Test
public void testPerformUploadWithInfoLoggingEnabled() throws Exception {
    // Upload and register business object data parents.
    uploadAndRegisterTestDataParents(uploaderWebClient);
    // Get the logger and the current logger level.
    LogLevel origLogLevel = getLogLevel(UploaderController.class);
    // Set logging level to INFO.
    setLogLevel(UploaderController.class, LogLevel.INFO);
    // Run the upload and reset the logging level back to the original value.
    try {
        runUpload(UploaderController.MIN_THREADS);
    } finally {
        setLogLevel(UploaderController.class, origLogLevel);
    }
}
Also used : LogLevel(org.finra.herd.core.helper.LogLevel) Test(org.junit.Test)

Aggregations

LogLevel (org.finra.herd.core.helper.LogLevel)15 Test (org.junit.Test)15 AbstractServiceTest (org.finra.herd.service.AbstractServiceTest)4 ProceedingJoinPoint (org.aspectj.lang.ProceedingJoinPoint)3 StringWriter (java.io.StringWriter)2 MockProceedingJoinPoint (org.finra.herd.core.MockProceedingJoinPoint)2 S3FileTransferRequestParamsDto (org.finra.herd.model.dto.S3FileTransferRequestParamsDto)2 AmazonClientException (com.amazonaws.AmazonClientException)1 AmazonServiceException (com.amazonaws.AmazonServiceException)1 AmazonS3Exception (com.amazonaws.services.s3.model.AmazonS3Exception)1 DeletedObject (com.amazonaws.services.s3.model.DeleteObjectsResult.DeletedObject)1 MultiObjectDeleteException (com.amazonaws.services.s3.model.MultiObjectDeleteException)1 DeleteError (com.amazonaws.services.s3.model.MultiObjectDeleteException.DeleteError)1 S3VersionSummary (com.amazonaws.services.s3.model.S3VersionSummary)1 VersionListing (com.amazonaws.services.s3.model.VersionListing)1 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)1