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

Commit 642f17b

Browse files
author
Josh Friedman
committed
Commenting out additional share snapshot changes to be safe
1 parent 95dbe09 commit 642f17b

File tree

7 files changed

+583
-583
lines changed

7 files changed

+583
-583
lines changed

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 & 64 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]

0 commit comments

Comments
 (0)