Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit 42a2846

Browse files
authored
Merge pull request #66 from jofriedm-msft/dev
Dev
2 parents f31f31d + 25b7fef commit 42a2846

File tree

17 files changed

+739
-797
lines changed

17 files changed

+739
-797
lines changed

ChangeLog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017.05.23 Version 5.2.0
2+
* Fixed Exists() calls on Shares and Directories to now populate metadata. This was already being done for Files.
3+
* Changed blob constants to support up to 256 MB on put blob for block blobs. The default value for put blob threshold has also been updated to half of the maximum, or 128 MB currently.
4+
* Fixed a bug that prevented setting content MD5 to true when creating a new file.
5+
* Fixed a bug where access conditions, options, and operation context were not being passed when calling openWriteExisting() on a page blob or a file.
6+
* Fixed a bug where an exception was being thrown on a range get of a blob or file when the options disableContentMD5Validation is set to false and useTransactionalContentMD5 is set to true and there is no overall MD5.
7+
* Fixed a bug where retries were happening immediately if a socket exception was thrown.
8+
* In CloudFileShareProperties, setShareQuota() no longer asserts in bounds. This check has been moved to create() and uploadProperties() in CloudFileShare.
9+
110
2017.05.14 Version 5.1.1
211
* Reverted version 5.1.0 due to a regression which was caught after publishing. Version 5.2.0 will be released that contains the fixes from 5.1.0 without the regression.
312

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To get the binaries of this library as distributed by Microsoft, ready for use w
3030
<dependency>
3131
<groupId>com.microsoft.azure</groupId>
3232
<artifactId>azure-storage</artifactId>
33-
<version>5.1.1</version>
33+
<version>5.2.0</version>
3434
</dependency>
3535
```
3636

microsoft-azure-storage-samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.microsoft.azure</groupId>
2828
<artifactId>azure-storage</artifactId>
29-
<version>5.1.1</version>
29+
<version>5.2.0</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>com.microsoft.azure</groupId>

microsoft-azure-storage-test/src/com/microsoft/azure/storage/MaximumExecutionTimeTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ public void testMaximumExecutionTimeBlobWrites() throws URISyntaxException, Stor
191191
BlobRequestOptions options = new BlobRequestOptions();
192192
options.setMaximumExecutionTimeInMs(5000);
193193

194+
// set a lower put blob threshold so that we perform multiple put block requests that timeout
195+
options.setSingleBlobPutThresholdInBytes(32 * Constants.MB);
196+
194197
CloudBlobClient blobClient = TestHelper.createCloudBlobClient();
195198
CloudBlobContainer container = blobClient.getContainerReference(generateRandomName("container"));
196199

microsoft-azure-storage-test/src/com/microsoft/azure/storage/file/CloudFileClientTests.java

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -115,46 +115,46 @@ public void testListSharesMaxResultsValidationTest() throws StorageException, UR
115115
assertNotNull(fileClient.listSharesSegmented("thereshouldntbeanyshareswiththisprefix"));
116116
}
117117

118-
//@Test
119-
public void testListSharesWithSnapshot() throws StorageException, URISyntaxException {
120-
CloudFileClient fileClient = FileTestHelper.createCloudFileClient();
121-
CloudFileShare share = fileClient.getShareReference(UUID.randomUUID().toString());
122-
share.create();
123-
124-
HashMap<String, String> shareMeta = new HashMap<String, String>();
125-
shareMeta.put("key1", "value1");
126-
share.setMetadata(shareMeta);
127-
share.uploadMetadata();
128-
129-
CloudFileShare snapshot = share.createSnapshot();
130-
HashMap<String, String> meta2 = new HashMap<String, String>();
131-
meta2.put("key2", "value2");
132-
share.setMetadata(meta2);
133-
share.uploadMetadata();
134-
135-
CloudFileClient client = FileTestHelper.createCloudFileClient();
136-
Iterable<CloudFileShare> listResult = client.listShares(share.name, ShareListingDetails.ALL, null, null);
137-
138-
int count = 0;
139-
boolean originalFound = false;
140-
boolean snapshotFound = false;
141-
for (CloudFileShare listShareItem : listResult) {
142-
if (listShareItem.getName().equals(share.getName()) && !listShareItem.isSnapshot() && !originalFound)
143-
{
144-
count++;
145-
originalFound = true;
146-
assertEquals(share.getMetadata(), listShareItem.getMetadata());
147-
assertEquals(share.getStorageUri(), listShareItem.getStorageUri());
148-
}
149-
else if (listShareItem.getName().equals(share.getName()) &&
150-
listShareItem.isSnapshot() && !snapshotFound) {
151-
count++;
152-
snapshotFound = true;
153-
assertEquals(snapshot.getMetadata(), listShareItem.getMetadata());
154-
assertEquals(snapshot.getStorageUri(), listShareItem.getStorageUri());
155-
}
156-
}
157-
158-
assertEquals(2, count);
159-
}
118+
// @Test
119+
// public void testListSharesWithSnapshot() throws StorageException, URISyntaxException {
120+
// CloudFileClient fileClient = FileTestHelper.createCloudFileClient();
121+
// CloudFileShare share = fileClient.getShareReference(UUID.randomUUID().toString());
122+
// share.create();
123+
//
124+
// HashMap<String, String> shareMeta = new HashMap<String, String>();
125+
// shareMeta.put("key1", "value1");
126+
// share.setMetadata(shareMeta);
127+
// share.uploadMetadata();
128+
//
129+
// CloudFileShare snapshot = share.createSnapshot();
130+
// HashMap<String, String> meta2 = new HashMap<String, String>();
131+
// meta2.put("key2", "value2");
132+
// share.setMetadata(meta2);
133+
// share.uploadMetadata();
134+
//
135+
// CloudFileClient client = FileTestHelper.createCloudFileClient();
136+
// Iterable<CloudFileShare> listResult = client.listShares(share.name, ShareListingDetails.ALL, null, null);
137+
//
138+
// int count = 0;
139+
// boolean originalFound = false;
140+
// boolean snapshotFound = false;
141+
// for (CloudFileShare listShareItem : listResult) {
142+
// if (listShareItem.getName().equals(share.getName()) && !listShareItem.isSnapshot() && !originalFound)
143+
// {
144+
// count++;
145+
// originalFound = true;
146+
// assertEquals(share.getMetadata(), listShareItem.getMetadata());
147+
// assertEquals(share.getStorageUri(), listShareItem.getStorageUri());
148+
// }
149+
// else if (listShareItem.getName().equals(share.getName()) &&
150+
// listShareItem.isSnapshot() && !snapshotFound) {
151+
// count++;
152+
// snapshotFound = true;
153+
// assertEquals(snapshot.getMetadata(), listShareItem.getMetadata());
154+
// assertEquals(snapshot.getStorageUri(), listShareItem.getStorageUri());
155+
// }
156+
// }
157+
//
158+
// assertEquals(2, count);
159+
// }
160160
}

microsoft-azure-storage-test/src/com/microsoft/azure/storage/file/CloudFileDirectoryTests.java

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -480,70 +480,70 @@ private static void testMetadataFailures(CloudFileDirectory directory, String ke
480480
directory.getMetadata().remove(key);
481481
}
482482

483-
//@Test
484-
public void testUnsupportedDirectoryApisWithinShareSnapshot() throws StorageException, URISyntaxException {
485-
CloudFileShare snapshot = this.share.createSnapshot();
486-
CloudFileDirectory rootDir = snapshot.getRootDirectoryReference();
487-
try {
488-
rootDir.create();
489-
fail("Shouldn't get here");
490-
}
491-
catch (IllegalArgumentException e) {
492-
assertEquals(SR.INVALID_OPERATION_FOR_A_SHARE_SNAPSHOT, e.getMessage());
493-
}
494-
try {
495-
rootDir.delete();
496-
fail("Shouldn't get here");
497-
}
498-
catch (IllegalArgumentException e) {
499-
assertEquals(SR.INVALID_OPERATION_FOR_A_SHARE_SNAPSHOT, e.getMessage());
500-
}
501-
try {
502-
rootDir.uploadMetadata();
503-
fail("Shouldn't get here");
504-
}
505-
catch (IllegalArgumentException e) {
506-
assertEquals(SR.INVALID_OPERATION_FOR_A_SHARE_SNAPSHOT, e.getMessage());
507-
}
508-
509-
snapshot.delete();
510-
}
511-
512-
//@Test
513-
public void testSupportedDirectoryApisInShareSnapshot() throws StorageException, URISyntaxException {
514-
CloudFileDirectory dir = this.share.getRootDirectoryReference().getDirectoryReference("dir1");
515-
dir.deleteIfExists();
516-
dir.create();
517-
HashMap<String, String> meta = new HashMap<String, String>();
518-
meta.put("key1", "value1");
519-
dir.setMetadata(meta);
520-
dir.uploadMetadata();
521-
CloudFileShare snapshot = this.share.createSnapshot();
522-
CloudFileDirectory snapshotDir = snapshot.getRootDirectoryReference().getDirectoryReference("dir1");
523-
524-
HashMap<String, String> meta2 = new HashMap<String, String>();
525-
meta2.put("key2", "value2");
526-
dir.setMetadata(meta2);
527-
dir.uploadMetadata();
528-
snapshotDir.downloadAttributes();
529-
530-
assertTrue(snapshotDir.getMetadata().size() == 1 && snapshotDir.getMetadata().get("key1").equals("value1"));
531-
assertNotNull(snapshotDir.getProperties().getEtag());
532-
533-
dir.downloadAttributes();
534-
assertTrue(dir.getMetadata().size() == 1 && dir.getMetadata().get("key2").equals("value2"));
535-
assertNotNull(dir.getProperties().getEtag());
536-
assertNotEquals(dir.getProperties().getEtag(), snapshotDir.getProperties().getEtag());
537-
538-
final UriQueryBuilder uriBuilder = new UriQueryBuilder();
539-
uriBuilder.add("sharesnapshot", snapshot.snapshotID);
540-
uriBuilder.add("restype", "directory");
541-
CloudFileDirectory snapshotDir2 = new CloudFileDirectory(uriBuilder.addToURI(dir.getUri()), this.share.getServiceClient().getCredentials());
542-
assertEquals(snapshot.snapshotID, snapshotDir2.getShare().snapshotID);
543-
assertTrue(snapshotDir2.exists());
544-
545-
snapshot.delete();
546-
}
483+
// @Test
484+
// public void testUnsupportedDirectoryApisWithinShareSnapshot() throws StorageException, URISyntaxException {
485+
// CloudFileShare snapshot = this.share.createSnapshot();
486+
// CloudFileDirectory rootDir = snapshot.getRootDirectoryReference();
487+
// try {
488+
// rootDir.create();
489+
// fail("Shouldn't get here");
490+
// }
491+
// catch (IllegalArgumentException e) {
492+
// assertEquals(SR.INVALID_OPERATION_FOR_A_SHARE_SNAPSHOT, e.getMessage());
493+
// }
494+
// try {
495+
// rootDir.delete();
496+
// fail("Shouldn't get here");
497+
// }
498+
// catch (IllegalArgumentException e) {
499+
// assertEquals(SR.INVALID_OPERATION_FOR_A_SHARE_SNAPSHOT, e.getMessage());
500+
// }
501+
// try {
502+
// rootDir.uploadMetadata();
503+
// fail("Shouldn't get here");
504+
// }
505+
// catch (IllegalArgumentException e) {
506+
// assertEquals(SR.INVALID_OPERATION_FOR_A_SHARE_SNAPSHOT, e.getMessage());
507+
// }
508+
//
509+
// snapshot.delete();
510+
// }
511+
512+
// @Test
513+
// public void testSupportedDirectoryApisInShareSnapshot() throws StorageException, URISyntaxException {
514+
// CloudFileDirectory dir = this.share.getRootDirectoryReference().getDirectoryReference("dir1");
515+
// dir.deleteIfExists();
516+
// dir.create();
517+
// HashMap<String, String> meta = new HashMap<String, String>();
518+
// meta.put("key1", "value1");
519+
// dir.setMetadata(meta);
520+
// dir.uploadMetadata();
521+
// CloudFileShare snapshot = this.share.createSnapshot();
522+
// CloudFileDirectory snapshotDir = snapshot.getRootDirectoryReference().getDirectoryReference("dir1");
523+
//
524+
// HashMap<String, String> meta2 = new HashMap<String, String>();
525+
// meta2.put("key2", "value2");
526+
// dir.setMetadata(meta2);
527+
// dir.uploadMetadata();
528+
// snapshotDir.downloadAttributes();
529+
//
530+
// assertTrue(snapshotDir.getMetadata().size() == 1 && snapshotDir.getMetadata().get("key1").equals("value1"));
531+
// assertNotNull(snapshotDir.getProperties().getEtag());
532+
//
533+
// dir.downloadAttributes();
534+
// assertTrue(dir.getMetadata().size() == 1 && dir.getMetadata().get("key2").equals("value2"));
535+
// assertNotNull(dir.getProperties().getEtag());
536+
// assertNotEquals(dir.getProperties().getEtag(), snapshotDir.getProperties().getEtag());
537+
//
538+
// final UriQueryBuilder uriBuilder = new UriQueryBuilder();
539+
// uriBuilder.add("sharesnapshot", snapshot.snapshotID);
540+
// uriBuilder.add("restype", "directory");
541+
// CloudFileDirectory snapshotDir2 = new CloudFileDirectory(uriBuilder.addToURI(dir.getUri()), this.share.getServiceClient().getCredentials());
542+
// assertEquals(snapshot.snapshotID, snapshotDir2.getShare().snapshotID);
543+
// assertTrue(snapshotDir2.exists());
544+
//
545+
// snapshot.delete();
546+
// }
547547

548548
/*
549549
[TestMethod]
@@ -874,8 +874,6 @@ public void eventOccurred(SendingRequestEvent eventArg) {
874874
}
875875
catch (StorageException e) {
876876
fail("Delete should succeed.");
877-
} catch (URISyntaxException e) {
878-
fail("Delete should succeed.");
879877
}
880878
}
881879
}

0 commit comments

Comments
 (0)