Commit Graph

35 Commits

Author SHA1 Message Date
Roman Coedo 73d9fa5340 JCLOUDS-457: Test groups and improvements
Test groups have been added. Also, the live tests were
refactored to reduce the number of RPCs.
2014-07-15 03:01:42 -07:00
Roman C. Coedo ff83778fb7 JCLOUDS-457: uploadPart return type fix
The uploadPart method now returns HashCode instead
of String.
2014-07-04 13:29:21 -07:00
Roman C. Coedo 327a7b0a6b Use assertj extraction feature to shorten test 2014-07-03 16:04:39 -07:00
Roman C. Coedo fbcf7eac80 Using assertj assertions
testng assertions have been replaced with assertj
assertions.
2014-07-03 16:04:34 -07:00
Roman C. Coedo 625aa6a42c Default value for aws identity/credential property
Every project was using undefined properties in their pom.xml.
A default value for test.aws.identity and test.aws.credential was
added.
2014-07-02 15:25:43 -07:00
Andrew Gaul c2cf837e46 Improve use of assertj 2014-07-01 22:00:14 -07:00
Andrew Gaul e104ef0a4c Use assertj fluent assertions where appropriate
This commit demonstrates a few instances where assertj yields more
informative error messages than testng assertEquals and assertTrue.
Note that we could replace all testng asserts with assertj.
2014-06-30 19:07:50 -07:00
Roman C. Coedo 70fb8cdea0 JCLOUDS-457: Added the retrieve output operations
Now the Glacier client can retrieve data.
2014-06-29 17:26:08 -07:00
Roman C. Coedo 9d871fde00 JCLOUDS-457: Added listJobs operation
Now the Glacier client supports the listJobs operation.
2014-06-27 16:57:15 -07:00
Roman C. Coedo 7156947a18 JCLOUDS-457: Added describeJob operation
Now Glacier client supports the describeJob operation.
2014-06-27 16:03:24 -07:00
Roman C. Coedo 59a43f8c2e JCLOUDS-457: Multiple fixes
This commit addresses some problems found in the code:

- Now VaultMetadata returns a copy of the creation date instead
of their own instance.

- Added a checkNotNull for PaginatedVaultCollection iterable.

- Added a test for listVaults with an empty list of vaults.
2014-06-27 15:49:08 -07:00
Roman C. Coedo 2c713d2b35 JCLOUDS-457: Cleanup for binder classes
The binder classes were making unnecessary checks. They have
been cleaned up.
2014-06-27 15:45:22 -07:00
Roman C. Coedo c55a9f4522 JCLOUDS-457: Added initiateJob
Now the Glacier client supports the initiateJob operation.
2014-06-26 14:09:14 -07:00
Roman C. Coedo f1a397359a JCLOUDS-457: limit body size for specific test
For each test, we were forcing the server to discard the content of
the request body on @BeforeMethod. We need to do this on tests with a
huge body, but it may interfere with other tests which actually use
the body data.  To fix this problem, we moved the body limit
restriction to the tests that require it.
2014-06-26 14:07:35 -07:00
Roman C. Coedo 0c36b36d35 Bug fix for ContentRange equals 2014-06-24 18:58:47 -07:00
Roman C. Coedo 3f68c3f0c7 JCLOUDS-457: Added list Multipart operations
Added listParts and listMultipartUploads operations to the Glacier
client.
2014-06-22 17:32:43 -07:00
Andrew Gaul 50df899c53 JCLOUDS-457: Call BeforeMethod and AfterMethod
Use these annotations to initialize before every test.  BeforeTest and
AfterTest initialize once before a single test in this suite.
2014-06-22 16:15:22 -07:00
Roman C. Coedo b0dddca449 JCLOUDS-457: Added completeMultipartUpload and abortMultipartUplod.
Now the Glacier client supports completeMultipartUpload and i
abortMultipartUpload operations.
2014-06-20 15:00:37 -07:00
Roman C. Coedo 76ea768cb8 JCLOUDS-457: Clean up for the validators and the TreeHash class.
Now the validators use checkArgument instead of throwing an
exception by calling an static method.

There were some missing validators on the Async client, these
were fixed too.

Lastly, TreeHash inner class was removed. Now the factory methods
are in the TreeHash class.
2014-06-19 16:48:32 -07:00
Roman C. Coedo 248c855e48 JCLOUDS-457: Added initiateMultipartUpload and uploadPart operations.
Now the Glacier client supports initiateMultipartUpload and
uploadPart operations.
2014-06-19 14:28:39 -07:00
Roman C. Coedo 2efd8183ce Use Square's mockwebserver 2014-06-19 05:31:15 -07:00
Roman C. Coedo b206d050e6 JCLOUDS-457: Clean up for GlacierClientMockTest.
GlacierClientMockTest was growing uncontrollably. This commit
is an attempt to fix this problem.

The first measure taken moves the duplicated strings to constants
and the JSON response bodies to resource files. In addition, some
repeated code was moved to static classes, where they can be reused.

We also use @BeforeTest and @AfterTest to make instances of the
MockWebServer and shut them down for each test.
2014-06-18 17:14:06 -07:00
Andrew Gaul d2c5149836 Store hashes as HashCode for type-safety 2014-06-17 18:55:32 -07:00
Roman C. Coedo 883425fdfb JCLOUDS-457: Part of the code has been cleaned up
On the last commit we added TestUtils class. On this commit
the VaultNameValidator and the ThreeHashTest tests make use
of it.

GlacierClientMockTest was not using GlacierHeaders references.
This commit fixes this problem too.

In addition, the AWSRequestSignerV4, the TreeHash and the
VaultNameValidator classes are now final.
2014-06-17 16:42:09 -07:00
Roman C. Coedo 2916b636cf JCLOUDS-457: Added deleteArchive and uploadArchive operations.
Now the Glacier client supports upload and delete archive
operations.

An static TestUtils class has been made for the archive operations
tests. This class allows us to build payloads and build ByteSources.
2014-06-17 16:21:39 -07:00
Roman C. Coedo 43ee610625 JCLOUDS-457: Changed the ArrayLists in TreeHash util to ImmutableLists. 2014-06-17 12:06:25 -07:00
Andrew Gaul 2e5a8972f0 Avoid buffering entire input when hashing
Also ensure that we close the InputStream.
2014-06-16 16:09:27 -07:00
Roman C. Coedo 7312486a57 JCLOUDS-457: Added TreeHash util class and its test.
The TreeHash class stores two HashCodes, the linear and the
tree HashCode. The TreeHash class also has an static inner class
named Hasher, which allows us to calculate the hashes.

Both Hashes (tree and linear) are needed for the upload archive
and the multipart upload operations. When completing a multipart
upload operation we also need to calculate the tree hash of the
individual part's hashes.
2014-06-16 16:01:54 -07:00
Roman C. Coedo 0a90be9016 JCLOUDS-457: Use random vault names in live tests
Now the live tests are not conditioned by the current state of the
account used.
2014-06-13 13:14:32 -07:00
Roman C. Coedo 3b5aadc182 Renamed FalseIfVaultNotEmpty to be more generic. deleteVault should return false on any IllegalArgumentException. 2014-06-10 14:37:02 -07:00
Andrew Gaul deec26110c JCLOUDS-546: Remove Javadoc @author annotations
Annotations removed with:

find -name \*.java | xargs sed -i /@author/d

Empty Javadoc removed with multiple iterations of:

find -name \*.java | xargs sed -i -z 's/ \*\n \*\// \*\//'
find -name \*.java | xargs sed -i -z 's/ \* \n \*\// \*\//'
find -name \*.java | xargs sed -i -z 's/\/\*\*\n \*\/\n//'
2014-06-07 21:12:43 -07:00
Roman C. Coedo eb13a0a209 Removed some unused constructors from GlacierResponseException 2014-05-30 16:33:13 -07:00
Roman C. Coedo 7add71bf4c Added some fixes to the live test and a few things on the rest of the code for clarity. 2014-05-30 16:33:11 -07:00
Roman C. Coedo b892afc4d9 JCLOUDS-457: Added Glacier vault operations
The Glacier client can create, delete, read, and list vaults.
2014-05-22 20:36:56 -07:00
Roman C. Coedo d4af465ca8 JCLOUDS-457: Created the skeleton of the Glacier API. 2014-05-15 02:32:27 -07:00