Class S3FileServiceProviderTest
java.lang.Object
org.broadleafcommerce.vendor.amazon.s3.AbstractS3Test
org.broadleafcommerce.vendor.amazon.s3.S3FileServiceProviderTest
This test will connect to S3Client, create a bucket, create a file, delete the file, and delete the bucket.
This test requires an S3 keys and S3 accessId which can be passed in as -D arguments or stored
in a property file in your classpath named.
"/config/bc/override/common.properties."
- Author:
- bpolster
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassNested classes/interfaces inherited from class org.broadleafcommerce.vendor.amazon.s3.AbstractS3Test
AbstractS3Test.TestSystemPropertiesService -
Field Summary
Fields inherited from class org.broadleafcommerce.vendor.amazon.s3.AbstractS3Test
configService, propService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckTestFileExists(String filename) protected booleandeleteTestFile(String filename) static voidvoidvoidvoidvoidvoidvoidvoidprotected booleanuploadTestFileTestOk(String filename) uploadTestFileWithResult(String filename) protected voidverifyFileUploadRaw(String filename, String directoryName) Differs fromcheckTestFileExists(String)in that this uses the S3 client directly and does not go through the Broadleaf file service API.Methods inherited from class org.broadleafcommerce.vendor.amazon.s3.AbstractS3Test
findProperty, reset, resetAllProperties, setup
-
Constructor Details
-
S3FileServiceProviderTest
public S3FileServiceProviderTest()
-
-
Method Details
-
setupProvider
public static void setupProvider() -
testFileProcesses
- Throws:
IOException
-
testSubDirectory
- Throws:
IOException
-
testSubDirectoryWithSlashes
- Throws:
IOException
-
testSiteSpecificFile
- Throws:
IOException
-
testRemoveAddedResourceByName
public void testRemoveAddedResourceByName() -
testNotFoundReturnsNonExistentFile
public void testNotFoundReturnsNonExistentFile() -
testSubDirectoryTree
- Throws:
IOException
-
verifyFileUploadRaw
Differs fromcheckTestFileExists(String)in that this uses the S3 client directly and does not go through the Broadleaf file service API. This will create a test file, upload it to S3 via the Broadleaf file service API, verify that the file exists via the raw S3 client, and then delete the file from the bucket via the file service API again- Parameters:
filename- the name of the file to uploaddirectoryName- directory that the file should be stored in on S3- Throws:
IOException
-
deleteTestFile
-
checkTestFileExists
-
uploadTestFileTestOk
-
uploadTestFileWithResult
-