Skip to content

Commit

Permalink
Migrate Additional V11 Test Classes (#4491)
Browse files Browse the repository at this point in the history
* Removed raw clients

* Fixed PageBlob getRange and getRangeDiff, turned on all unit tests

* Turned on more tests

* Partial work for implementing and testing reliable download options

* Storage SAS implementation (#4404)

* SAS implementation

* Fixed some minor formatting issues

* Fixed checkstyle problems and test issue

* Turned on download retry test

* RetryTests migrated

* Passing most of HelperTest

* Fixing tests after merge

* Remove RawClients from Blobs (#4375)

Removes RawClients from Storage Blobs

* DownloadResponseTest working

* Fixed scoping for some classes, Checkstyle fixes

* Fixing more unit tests

* Fix Checkstyle issue

* Move adding acount name into String.format

* Additional move of adding account name into String.format

* Fixed assertGenerateOK logic for SAS generation

* Removed invalid import

* Fixed method parameter ordering
  • Loading branch information
alzimmermsft authored Aug 2, 2019
1 parent 614ae78 commit d85185f
Show file tree
Hide file tree
Showing 47 changed files with 2,662 additions and 792 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but
* the order of the permissions is particular and this class guarantees correctness.
*/
final class AccountSASPermission {
public final class AccountSASPermission {

private boolean read;

Expand All @@ -33,7 +33,7 @@ final class AccountSASPermission {
/**
* Initializes an {@code AccountSASPermission} object with all fields set to false.
*/
private AccountSASPermission() {
public AccountSASPermission() {
}

/**
Expand Down Expand Up @@ -85,119 +85,148 @@ public static AccountSASPermission parse(String permString) {
}

/**
* Permission to read resources and list queues and tables granted.
* @return the read permission status
*/
public boolean read() {
return read;
}

/**
* Permission to read resources and list queues and tables granted.
* Sets the read permission status.
*
* @param read Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission read(boolean read) {
this.read = read;
return this;
}

/**
* Permission to add messages, table entities, and append to blobs granted.
* @return the add permission status
*/
public boolean add() {
return add;
}

/**
* Permission to add messages, table entities, and append to blobs granted.
* Sets the add permission status.
*
* @param add Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission add(boolean add) {
this.add = add;
return this;
}

/**
* Permission to create blobs and files granted.
* @return the create permission status
*/
public boolean create() {
return create;
}

/**
* Permission to create blobs and files granted.
* Sets the create permission status.
*
* @param create Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission create(boolean create) {
this.create = create;
return this;
}

/**
* Permission to write resources granted.
* @return the write permission status
*/
public boolean write() {
return write;
}

/**
* Permission to write resources granted.
* Sets the write permission status.
*
* @param write Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission write(boolean write) {
this.write = write;
return this;
}

/**
* Permission to delete resources granted.
* @return the delete permission status
*/
public boolean delete() {
return delete;
}

/**
* Permission to delete resources granted.
* Sets the delete permission status.
*
* @param delete Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission delete(boolean delete) {
this.delete = delete;
return this;
}

/**
* Permission to list blob containers, blobs, shares, directories, and files granted.
* @return the list permission status
*/
public boolean list() {
return list;
}

/**
* Permission to list blob containers, blobs, shares, directories, and files granted.
* Sets the list permission status. This permission grants the ability to list blob containers, blobs, shares,
* directories, and files.
*
* @param list Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission list(boolean list) {
this.list = list;
return this;
}

/**
* Permissions to update messages and table entities granted.
* Returns the update permission status, it allows the update of queue message and tables.
*
* @return the update permission status
*/
public boolean update() {
return update;
}

/**
* Permissions to update messages and table entities granted.
* Sets the update permission status, it allows the update of queue messages and tables.
*
* @param update Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission update(boolean update) {
this.update = update;
return this;
}

/**
* Permission to get and delete messages granted.
* Returns the process messages permission, this allows the retrieval and deletion of queue messages.
*
* @return the process messages permission status.
*/
public boolean processMessages() {
return processMessages;
}

/**
* Permission to get and delete messages granted.
* Sets the process messages permission, this allows the retrieval and deletion of queue messages.
*
* @param processMessages Permission status to set
* @return the updated AccountSASPermission object
*/
public AccountSASPermission processMessages(boolean processMessages) {
this.processMessages = processMessages;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but
* the order of the resources is particular and this class guarantees correctness.
*/
final class AccountSASResourceType {
public final class AccountSASResourceType {

private boolean service;

Expand All @@ -23,7 +23,7 @@ final class AccountSASResourceType {
/**
* Initializes an {@code AccountSASResourceType} object with all fields set to false.
*/
private AccountSASResourceType() {
public AccountSASResourceType() {
}

/**
Expand Down Expand Up @@ -61,44 +61,55 @@ public static AccountSASResourceType parse(String resourceTypesString) {
}

/**
* Permission to access service level APIs granted.
* @return the access status for service level APIs.
*/
public boolean service() {
return service;
}

/**
* Permission to access service level APIs granted.
* Sets the access status for service level APIs.
*
* @param service Access status to set
* @return the updated AccountSASResourceType object.
*/
public AccountSASResourceType service(boolean service) {
this.service = service;
return this;
}

/**
* Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.
* @return the access status for container level APIs, this grants access to Blob Containers, Tables, Queues,
* and File Shares.
*/
public boolean container() {
return container;
}

/**
* Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.
* Sets the access status for container level APIs, this grants access to Blob Containers, Tables, Queues, and File Shares.
*
* @param container Access status to set
* @return the updated AccountSASResourceType object.
*/
public AccountSASResourceType container(boolean container) {
this.container = container;
return this;
}

/**
* Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.
* @return the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages,
* Files.
*/
public boolean object() {
return object;
}

/**
* Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.
* Sets the access status for object level APIs, this grants access to Blobs, Table Entities, Queue Messages, Files.
*
* @param object Access status to set
* @return the updated AccountSASResourceType object.
*/
public AccountSASResourceType object(boolean object) {
this.object = object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but
* the order of the services is particular and this class guarantees correctness.
*/
final class AccountSASService {
public final class AccountSASService {

private boolean blob;

Expand All @@ -25,7 +25,7 @@ final class AccountSASService {
/**
* Initializes an {@code AccountSASService} object with all fields set to false.
*/
private AccountSASService() {
public AccountSASService() {
}

/**
Expand Down Expand Up @@ -66,59 +66,71 @@ public static AccountSASService parse(String servicesString) {
}

/**
* Permission to access blob resources granted.
* @return the access status for blob resources.
*/
public boolean blob() {
return blob;
}

/**
* Permission to access blob resources granted.
* Sets the access status for blob resources.
*
* @param blob Access status to set
* @return the updated AccountSASService object.
*/
public AccountSASService blob(boolean blob) {
this.blob = blob;
return this;
}

/**
* Permission to access file resources granted.
* @return the access status for file resources.
*/
public boolean file() {
return file;
}

/**
* Permission to access file resources granted.
* Sets the access status for file resources.
*
* @param file Access status to set
* @return the updated AccountSASService object.
*/
public AccountSASService file(boolean file) {
this.file = file;
return this;
}

/**
* Permission to access queue resources granted.
* @return the access status for queue resources.
*/
public boolean queue() {
return queue;
}

/**
* Permission to access queue resources granted.
* Sets the access status for queue resources.
*
* @param queue Access status to set
* @return the updated AccountSASService object.
*/
public AccountSASService queue(boolean queue) {
this.queue = queue;
return this;
}

/**
* Permission to access table resources granted.
* @return the access status for table resources.
*/
public boolean table() {
return table;
}

/**
* Permission to access table resources granted.
* Sets the access status for table resources.
*
* @param table Access status to set
* @return the updated AccountSASService object.
*/
public AccountSASService table(boolean table) {
this.table = table;
Expand Down
Loading

0 comments on commit d85185f

Please sign in to comment.