From a724c23e84e8eed2a29019540c4307c0e24297ea Mon Sep 17 00:00:00 2001 From: Chris Tavares Date: Tue, 11 Dec 2012 15:11:47 -0800 Subject: [PATCH] Removed setters from public Info classes - they are now immutable. --- .../implementation/content/AssetType.java | 21 +- .../content/MediaProcessorType.java | 18 +- .../media/models/AccessPolicyInfo.java | 77 +++--- .../services/media/models/AssetInfo.java | 92 -------- .../services/media/models/ContentKeyInfo.java | 120 ---------- .../services/media/models/JobInfo.java | 163 ------------- .../services/media/models/LocatorInfo.java | 116 --------- .../media/models/MediaProcessorInfo.java | 79 ------- .../services/media/models/TaskInfo.java | 223 ------------------ .../services/media/JobIntegrationTest.java | 16 +- .../media/models/AccessPolicyInfoTest.java | 28 ++- .../services/media/models/AssetInfoTest.java | 30 +-- .../media/models/ContentKeyInfoTest.java | 46 ++-- .../media/models/LocatorInfoTest.java | 43 ++-- .../media/models/MediaProcessorInfoTest.java | 31 ++- 15 files changed, 173 insertions(+), 930 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java index c341ab099a63..6563c1e08ffd 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/AssetType.java @@ -61,8 +61,9 @@ public String getId() { * @param id * the id to set */ - public void setId(String id) { + public AssetType setId(String id) { this.id = id; + return this; } /** @@ -76,8 +77,9 @@ public Integer getState() { * @param state * the state to set */ - public void setState(Integer state) { + public AssetType setState(Integer state) { this.state = state; + return this; } /** @@ -91,8 +93,9 @@ public Date getCreated() { * @param created * the created to set */ - public void setCreated(Date created) { + public AssetType setCreated(Date created) { this.created = created; + return this; } /** @@ -106,8 +109,9 @@ public Date getLastModified() { * @param lastModified * the lastModified to set */ - public void setLastModified(Date lastModified) { + public AssetType setLastModified(Date lastModified) { this.lastModified = lastModified; + return this; } /** @@ -121,8 +125,9 @@ public String getAlternateId() { * @param alternateId * the alternateId to set */ - public void setAlternateId(String alternateId) { + public AssetType setAlternateId(String alternateId) { this.alternateId = alternateId; + return this; } /** @@ -136,8 +141,9 @@ public String getName() { * @param name * the name to set */ - public void setName(String name) { + public AssetType setName(String name) { this.name = name; + return this; } /** @@ -151,7 +157,8 @@ public Integer getOptions() { * @param options * the options to set */ - public void setOptions(Integer options) { + public AssetType setOptions(Integer options) { this.options = options; + return this; } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaProcessorType.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaProcessorType.java index de8338173a9b..ec1966c20411 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaProcessorType.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/implementation/content/MediaProcessorType.java @@ -56,8 +56,9 @@ public String getId() { * @param id * the id to set */ - public void setId(String id) { + public MediaProcessorType setId(String id) { this.id = id; + return this; } /** @@ -71,39 +72,44 @@ public String getName() { * @param name * the name to set */ - public void setName(String name) { + public MediaProcessorType setName(String name) { this.name = name; + return this; } public String getDescription() { return this.description; } - public void setDescription(String description) { + public MediaProcessorType setDescription(String description) { this.description = description; + return this; } public String getSku() { return this.sku; } - public void setSku(String sku) { + public MediaProcessorType setSku(String sku) { this.sku = sku; + return this; } public String getVendor() { return vendor; } - public void setVendor(String vendor) { + public MediaProcessorType setVendor(String vendor) { this.vendor = vendor; + return this; } public String getVersion() { return this.version; } - public void setVersion(String version) { + public MediaProcessorType setVersion(String version) { this.version = version; + return this; } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfo.java index f4d608dd712a..09647b8a9711 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfo.java @@ -22,67 +22,76 @@ import com.microsoft.windowsazure.services.media.implementation.atom.EntryType; import com.microsoft.windowsazure.services.media.implementation.content.AccessPolicyType; +/** + * Type containing data about access policies. + * + */ public class AccessPolicyInfo extends ODataEntity { + /** + * Creates a new {@link AccessPolicyInfo} wrapping the given ATOM + * entry and content objects. + * + * @param entry + * Entry containing this AccessPolicy data + * @param content + * Content with the AccessPolicy data + */ public AccessPolicyInfo(EntryType entry, AccessPolicyType content) { super(entry, content); } - public AccessPolicyInfo() { - super(new AccessPolicyType()); - } - + /** + * Get the access policy id. + * + * @return the id. + */ public String getId() { return getContent().getId(); } - public AccessPolicyInfo setId(String id) { - getContent().setId(id); - return this; - } - + /** + * Get the creation date. + * + * @return the date. + */ public Date getCreated() { return getContent().getCreated(); } - public AccessPolicyInfo setCreated(Date created) { - getContent().setCreated(created); - return this; - } - + /** + * Get the last modified date. + * + * @return the date. + */ public Date getLastModified() { return getContent().getLastModified(); } - public AccessPolicyInfo setLastModified(Date lastModified) { - getContent().setLastModified(lastModified); - return this; - } - + /** + * Get the name. + * + * @return the name. + */ public String getName() { return getContent().getName(); } - public AccessPolicyInfo setName(String name) { - getContent().setName(name); - return this; - } - + /** + * Get the duration. + * + * @return the duration. + */ public double getDurationInMinutes() { return getContent().getDurationInMinutes(); } - public AccessPolicyInfo setDurationInMinutes(double durationInMinutes) { - getContent().setDurationInMinutes(durationInMinutes); - return this; - } - + /** + * Get the permissions. + * + * @return the permissions. + */ public EnumSet getPermissions() { return AccessPolicyPermission.permissionsFromBits(getContent().getPermissions()); } - - public AccessPolicyInfo setPermissions(EnumSet permissions) { - getContent().setPermissions(AccessPolicyPermission.bitsFromPermissions(permissions)); - return this; - } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java index e187f252f9b2..f403eb492d91 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/AssetInfo.java @@ -39,13 +39,6 @@ public AssetInfo(EntryType entry, AssetType content) { super(entry, content); } - /** - * Instantiates a new asset info. - */ - public AssetInfo() { - super(new AssetType()); - } - /** * Get the asset id. * @@ -55,18 +48,6 @@ public String getId() { return getContent().getId(); } - /** - * Set the id. - * - * @param id - * the id - * @return the asset info - */ - public AssetInfo setId(String id) { - getContent().setId(id); - return this; - } - /** * Get the asset name. * @@ -76,18 +57,6 @@ public String getName() { return this.getContent().getName(); } - /** - * set the name. - * - * @param name - * the name - * @return the asset info - */ - public AssetInfo setName(String name) { - this.getContent().setName(name); - return this; - } - /** * Get the asset state. * @@ -97,18 +66,6 @@ public AssetState getState() { return AssetState.fromCode(getContent().getState()); } - /** - * Set the state. - * - * @param state - * the state - * @return the asset info - */ - public AssetInfo setState(AssetState state) { - getContent().setState(state.getCode()); - return this; - } - /** * Get the creation date. * @@ -118,18 +75,6 @@ public Date getCreated() { return this.getContent().getCreated(); } - /** - * Set creation date. - * - * @param created - * the date - * @return the asset info - */ - public AssetInfo setCreated(Date created) { - getContent().setCreated(created); - return this; - } - /** * Get last modified date. * @@ -139,18 +84,6 @@ public Date getLastModified() { return getContent().getLastModified(); } - /** - * Set last modified date. - * - * @param lastModified - * the date - * @return the asset info - */ - public AssetInfo setLastModified(Date lastModified) { - getContent().setLastModified(lastModified); - return this; - } - /** * Get the alternate id. * @@ -160,18 +93,6 @@ public String getAlternateId() { return getContent().getAlternateId(); } - /** - * Set the alternate id. - * - * @param alternateId - * the id - * @return the asset info - */ - public AssetInfo setAlternateId(String alternateId) { - getContent().setAlternateId(alternateId); - return this; - } - /** * Get the options. * @@ -180,17 +101,4 @@ public AssetInfo setAlternateId(String alternateId) { public EncryptionOption getOptions() { return EncryptionOption.fromCode(getContent().getOptions()); } - - /** - * Set the options. - * - * @param encryptionOption - * the encryption option - * @return the asset info - */ - public AssetInfo setOptions(EncryptionOption encryptionOption) { - getContent().setOptions(encryptionOption.getCode()); - return this; - } - } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java index 85b4eca7176f..b03dd95a53c1 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfo.java @@ -39,13 +39,6 @@ public ContentKeyInfo(EntryType entry, ContentKeyRestType content) { super(entry, content); } - /** - * Instantiates a new content key info. - */ - public ContentKeyInfo() { - super(new ContentKeyRestType()); - } - /** * Gets the id. * @@ -55,30 +48,6 @@ public String getId() { return getContent().getId(); } - /** - * Sets the id. - * - * @param id - * the id - * @return the content key info - */ - public ContentKeyInfo setId(String id) { - getContent().setId(id); - return this; - } - - /** - * Sets the create. - * - * @param created - * the created - * @return the content key info - */ - public ContentKeyInfo setCreated(Date created) { - getContent().setCreated(created); - return this; - } - /** * Gets the created. * @@ -97,18 +66,6 @@ public Date getLastModified() { return getContent().getLastModified(); } - /** - * Sets the last modified. - * - * @param lastModified - * the last modified - * @return the content key info - */ - public ContentKeyInfo setLastModified(Date lastModified) { - getContent().setLastModified(lastModified); - return this; - } - /** * Gets the name. * @@ -118,30 +75,6 @@ public String getName() { return getContent().getName(); } - /** - * Sets the name. - * - * @param name - * the name - * @return the content key info - */ - public ContentKeyInfo setName(String name) { - getContent().setName(name); - return this; - } - - /** - * Sets the check sum. - * - * @param checksum - * the check sum - * @return the content key info - */ - public ContentKeyInfo setChecksum(String checksum) { - getContent().setChecksum(checksum); - return this; - } - /** * Gets the check sum. * @@ -151,18 +84,6 @@ public String getChecksum() { return getContent().getChecksum(); } - /** - * Sets the protection key type. - * - * @param protectionKeyType - * the protection key type - * @return the content key info - */ - public ContentKeyInfo setProtectionKeyType(ProtectionKeyType protectionKeyType) { - getContent().setProtectionKeyType(protectionKeyType.getCode()); - return this; - } - /** * Gets the protection key type. * @@ -172,18 +93,6 @@ public ProtectionKeyType getProtectionKeyType() { return ProtectionKeyType.fromCode(getContent().getProtectionKeyType()); } - /** - * Sets the protection key id. - * - * @param protectionKeyId - * the protection key id - * @return the content key info - */ - public ContentKeyInfo setProtectionKeyId(String protectionKeyId) { - getContent().setProtectionKeyId(protectionKeyId); - return this; - } - /** * Gets the protection key id. * @@ -193,18 +102,6 @@ public String getProtectionKeyId() { return getContent().getProtectionKeyId(); } - /** - * Sets the encrypted content key. - * - * @param encryptedContentKey - * the encrypted content key - * @return the content key info - */ - public ContentKeyInfo setEncryptedContentKey(String encryptedContentKey) { - getContent().setEncryptedContentKey(encryptedContentKey); - return this; - } - /** * Gets the encrypted content key. * @@ -214,23 +111,6 @@ public String getEncryptedContentKey() { return getContent().getEncryptedContentKey(); } - /** - * Sets the content key type. - * - * @param contentKeyType - * the content key type - * @return the content key info - */ - public ContentKeyInfo setContentKeyType(ContentKeyType contentKeyType) { - if (contentKeyType == null) { - getContent().setContentKeyType(null); - } - else { - getContent().setContentKeyType(contentKeyType.getCode()); - } - return this; - } - /** * Gets the content key type. * diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/JobInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/JobInfo.java index 627081d001de..23f9c36de43e 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/JobInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/JobInfo.java @@ -39,13 +39,6 @@ public JobInfo(EntryType entry, JobType content) { super(entry, content); } - /** - * Instantiates a new job info. - */ - public JobInfo() { - super(new EntryType(), new JobType()); - } - /** * Gets the id. * @@ -55,18 +48,6 @@ public String getId() { return getContent().getId(); } - /** - * Sets the id. - * - * @param id - * the id - * @return the job info - */ - public JobInfo setId(String id) { - getContent().setId(id); - return this; - } - /** * Gets the name. * @@ -76,18 +57,6 @@ public String getName() { return getContent().getName(); } - /** - * Sets the name. - * - * @param name - * the name - * @return the job info - */ - public JobInfo setName(String name) { - getContent().setName(name); - return this; - } - /** * Gets the created. * @@ -97,18 +66,6 @@ public Date getCreated() { return getContent().getCreated(); } - /** - * Sets the created. - * - * @param created - * the created - * @return the job info - */ - public JobInfo setCreated(Date created) { - getContent().setCreated(created); - return this; - } - /** * Gets the last modified. * @@ -118,18 +75,6 @@ public Date getLastModified() { return getContent().getLastModified(); } - /** - * Sets the last modified. - * - * @param lastModified - * the last modified - * @return the job info - */ - public JobInfo setLastModified(Date lastModified) { - getContent().setLastModified(lastModified); - return this; - } - /** * Gets the end time. * @@ -139,18 +84,6 @@ public Date getEndTime() { return getContent().getEndTime(); } - /** - * Sets the end time. - * - * @param endTime - * the end time - * @return the job info - */ - public JobInfo setEndTime(Date endTime) { - getContent().setEndTime(endTime); - return this; - } - /** * Gets the priority. * @@ -160,18 +93,6 @@ public Integer getPriority() { return getContent().getPriority(); } - /** - * Sets the priority. - * - * @param priority - * the priority - * @return the job info - */ - public JobInfo setPriority(Integer priority) { - getContent().setPriority(priority); - return this; - } - /** * Gets the running duration. * @@ -181,18 +102,6 @@ public Double getRunningDuration() { return getContent().getRunningDuration(); } - /** - * Sets the running duration. - * - * @param runningDuration - * the running duration - * @return the job info - */ - public JobInfo setRunningDuration(Double runningDuration) { - getContent().setRunningDuration(runningDuration); - return this; - } - /** * Gets the start time. * @@ -202,18 +111,6 @@ public Date getStartTime() { return getContent().getStartTime(); } - /** - * Sets the start time. - * - * @param startTime - * the start time - * @return the job info - */ - public JobInfo setStartTime(Date startTime) { - getContent().setStartTime(startTime); - return this; - } - /** * Gets the state. * @@ -223,18 +120,6 @@ public JobState getState() { return JobState.fromCode(getContent().getState()); } - /** - * Sets the state. - * - * @param state - * the state - * @return the job info - */ - public JobInfo setState(JobState state) { - getContent().setState(state.getCode()); - return this; - } - /** * Gets the template id. * @@ -244,18 +129,6 @@ public String getTemplateId() { return getContent().getTemplateId(); } - /** - * Sets the template id. - * - * @param templateId - * the template id - * @return the job info - */ - public JobInfo setTemplateId(String templateId) { - getContent().setTemplateId(templateId); - return this; - } - /** * Gets the input media assets. * @@ -265,18 +138,6 @@ public List getInputMediaAssets() { return getContent().getInputMediaAssets(); } - /** - * Sets the input media assets. - * - * @param inputMediaAssets - * the input media assets - * @return the job info - */ - public JobInfo setInputMediaAssets(List inputMediaAssets) { - getContent().setInputMediaAssets(inputMediaAssets); - return this; - } - /** * Gets the output media assets. * @@ -286,18 +147,6 @@ public List getOutputMediaAssets() { return getContent().getOutputMediaAssets(); } - /** - * Sets the output media assets. - * - * @param outputMediaAssets - * the output media assets - * @return the job info - */ - public JobInfo setOutputMediaAssets(List outputMediaAssets) { - getContent().setOutputMediaAssets(outputMediaAssets); - return this; - } - /** * Gets the task body. * @@ -306,16 +155,4 @@ public JobInfo setOutputMediaAssets(List outputMediaAssets) { public String getTaskBody() { return getContent().getTaskBody(); } - - /** - * Sets the tasks. - * - * @param tasks - * the tasks - * @return the job info - */ - public JobInfo setTaskBody(String taskBody) { - getContent().setTaskBody(taskBody); - return this; - } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java index 7c164b6385e6..b5ed565f8033 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/LocatorInfo.java @@ -38,13 +38,6 @@ public LocatorInfo(EntryType entry, LocatorRestType content) { super(entry, content); } - /** - * Instantiates a new locator info. - */ - public LocatorInfo() { - super(new LocatorRestType()); - } - /** * Gets the id. * @@ -54,18 +47,6 @@ public String getId() { return getContent().getId(); } - /** - * Sets the id. - * - * @param id - * the id - * @return the locator info - */ - public LocatorInfo setId(String id) { - getContent().setId(id); - return this; - } - /** * Gets the expiration date time. * @@ -75,30 +56,6 @@ public Date getExpirationDateTime() { return getContent().getExpirationDateTime(); } - /** - * Sets the expiration date time. - * - * @param expirationDateTime - * the expiration date time - * @return the locator info - */ - public LocatorInfo setExpirationDateTime(Date expirationDateTime) { - getContent().setExpirationDateTime(expirationDateTime); - return this; - } - - /** - * Sets the locator type. - * - * @param locatorType - * the locator type - * @return the locator info - */ - public LocatorInfo setLocatorType(LocatorType locatorType) { - getContent().setType(locatorType.getCode()); - return this; - } - /** * Gets the locator type. * @@ -108,18 +65,6 @@ public LocatorType getLocatorType() { return LocatorType.fromCode(getContent().getType()); } - /** - * Sets the path. - * - * @param path - * the path - * @return the locator info - */ - public LocatorInfo setPath(String path) { - getContent().setPath(path); - return this; - } - /** * Gets the path. * @@ -129,18 +74,6 @@ public String getPath() { return getContent().getPath(); } - /** - * Sets the access policy id. - * - * @param accessPolicyId - * the access policy id - * @return the locator info - */ - public LocatorInfo setAccessPolicyId(String accessPolicyId) { - getContent().setAccessPolicyId(accessPolicyId); - return this; - } - /** * Gets the access policy id. * @@ -150,18 +83,6 @@ public String getAccessPolicyId() { return getContent().getAccessPolicyId(); } - /** - * Sets the asset id. - * - * @param assetId - * the asset id - * @return the locator info - */ - public LocatorInfo setAssetId(String assetId) { - getContent().setAssetId(assetId); - return this; - } - /** * Gets the asset id. * @@ -171,18 +92,6 @@ public String getAssetId() { return getContent().getAssetId(); } - /** - * Sets the start time. - * - * @param startTime - * the start time - * @return the locator info - */ - public LocatorInfo setStartTime(Date startTime) { - getContent().setStartTime(startTime); - return this; - } - /** * Gets the start time. * @@ -201,30 +110,6 @@ public String getBaseUri() { return getContent().getBaseUri(); } - /** - * Sets the base uri. - * - * @param baseUri - * the base uri - * @return the locator info - */ - public LocatorInfo setBaseUri(String baseUri) { - this.getContent().setBaseUri(baseUri); - return this; - } - - /** - * Sets the content access component. - * - * @param contentAccessComponent - * the content access component - * @return the locator info - */ - public LocatorInfo setContentAccessComponent(String contentAccessComponent) { - this.getContent().setContentAccessComponent(contentAccessComponent); - return this; - } - /** * Gets the content access token. * @@ -233,5 +118,4 @@ public LocatorInfo setContentAccessComponent(String contentAccessComponent) { public String getContentAccessToken() { return this.getContent().getContentAccessComponent(); } - } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfo.java index 3fedc21bca39..8d6ec26235a9 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfo.java @@ -38,13 +38,6 @@ public MediaProcessorInfo(EntryType entry, MediaProcessorType content) { super(entry, content); } - /** - * Instantiates a new media processor info. - */ - public MediaProcessorInfo() { - super(new MediaProcessorType()); - } - /** * Get the asset id. * @@ -54,18 +47,6 @@ public String getId() { return getContent().getId(); } - /** - * Set the id. - * - * @param id - * the id - * @return the asset info - */ - public MediaProcessorInfo setId(String id) { - getContent().setId(id); - return this; - } - /** * Get the asset name. * @@ -75,18 +56,6 @@ public String getName() { return this.getContent().getName(); } - /** - * set the name. - * - * @param name - * the name - * @return the asset info - */ - public MediaProcessorInfo setName(String name) { - this.getContent().setName(name); - return this; - } - /** * Gets the description. * @@ -96,18 +65,6 @@ public String getDescription() { return this.getContent().getDescription(); } - /** - * Sets the description. - * - * @param description - * the description - * @return the media processor info - */ - public MediaProcessorInfo setDescription(String description) { - this.getContent().setDescription(description); - return this; - } - /** * Gets the sku. * @@ -117,18 +74,6 @@ public String getSku() { return this.getContent().getSku(); } - /** - * Sets the sku. - * - * @param sku - * the sku - * @return the media processor info - */ - public MediaProcessorInfo setSku(String sku) { - this.getContent().setSku(sku); - return this; - } - /** * Gets the vendor. * @@ -138,18 +83,6 @@ public String getVendor() { return this.getContent().getVendor(); } - /** - * Sets the vendor. - * - * @param vendor - * the vendor - * @return the media processor info - */ - public MediaProcessorInfo setVendor(String vendor) { - this.getContent().setVendor(vendor); - return this; - } - /** * Gets the version. * @@ -158,16 +91,4 @@ public MediaProcessorInfo setVendor(String vendor) { public String getVersion() { return this.getContent().getVersion(); } - - /** - * Sets the version. - * - * @param version - * the version - * @return the media processor info - */ - public MediaProcessorInfo setVersion(String version) { - this.getContent().setVersion(version); - return this; - } } diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/TaskInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/TaskInfo.java index dda71ca5e6ea..3ed2fc51d31d 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/TaskInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/media/models/TaskInfo.java @@ -38,13 +38,6 @@ public TaskInfo(EntryType entry, TaskType content) { super(entry, content); } - /** - * Instantiates a new task info. - */ - public TaskInfo() { - super(new TaskType()); - } - /** * Gets the id. * @@ -54,18 +47,6 @@ public String getId() { return getContent().getId(); } - /** - * Sets the id. - * - * @param id - * the id - * @return the task info - */ - public TaskInfo setId(String id) { - getContent().setId(id); - return this; - } - /** * Gets the configuration. * @@ -75,18 +56,6 @@ public String getConfiguration() { return getContent().getConfiguration(); } - /** - * Sets the configuration. - * - * @param configuration - * the configuration - * @return the task info - */ - public TaskInfo setConfiguration(String configuration) { - getContent().setConfiguration(configuration); - return this; - } - /** * Gets the end time. * @@ -96,18 +65,6 @@ public Date getEndTime() { return getContent().getEndTime(); } - /** - * Sets the end time. - * - * @param endTime - * the end time - * @return the task info - */ - public TaskInfo setEndTime(Date endTime) { - getContent().setEndTime(endTime); - return this; - } - /** * Gets the error details. * @@ -117,18 +74,6 @@ public String getErrorDetails() { return getContent().getErrorDetails(); } - /** - * Sets the error details. - * - * @param errorDetails - * the error details - * @return the task info - */ - public TaskInfo setErrorDetails(String errorDetails) { - getContent().setErrorDetails(errorDetails); - return this; - } - /** * Gets the media processor id. * @@ -138,18 +83,6 @@ public String getMediaProcessorId() { return getContent().getMediaProcessorId(); } - /** - * Sets the media processor id. - * - * @param mediaProcessorId - * the media processor id - * @return the task info - */ - public TaskInfo setMediaProcessorId(String mediaProcessorId) { - getContent().setMediaProcessorId(mediaProcessorId); - return this; - } - /** * Gets the name. * @@ -159,18 +92,6 @@ public String getName() { return getContent().getName(); } - /** - * Sets the name. - * - * @param name - * the name - * @return the task info - */ - public TaskInfo setName(String name) { - getContent().setName(name); - return this; - } - /** * Gets the perf message. * @@ -180,18 +101,6 @@ public String getPerfMessage() { return getContent().getPerfMessage(); } - /** - * Sets the perf message. - * - * @param perfMessage - * the perf message - * @return the task info - */ - public TaskInfo setPerfMessage(String perfMessage) { - getContent().setPerfMessage(perfMessage); - return this; - } - /** * Gets the priority. * @@ -201,18 +110,6 @@ public Integer getPriority() { return getContent().getPriority(); } - /** - * Sets the priority. - * - * @param priority - * the priority - * @return the task info - */ - public TaskInfo setPriority(Integer priority) { - getContent().setPriority(priority); - return this; - } - /** * Gets the progress. * @@ -222,17 +119,6 @@ public Double getProgress() { return getContent().getProgress(); } - /** - * - * @param progress - * the progress - * @return the task info - */ - public TaskInfo setProgress(Double progress) { - getContent().setProgress(progress); - return this; - } - /** * Gets the running duration. * @@ -242,18 +128,6 @@ public double getRunningDuration() { return getContent().getRunningDuration(); } - /** - * Sets the running duration. - * - * @param runningDuration - * the running duration - * @return the task info - */ - public TaskInfo setRunningDuration(double runningDuration) { - getContent().setRunningDuration(runningDuration); - return this; - } - /** * Gets the start time. * @@ -263,18 +137,6 @@ public Date getStartTime() { return getContent().getStartTime(); } - /** - * Sets the start time. - * - * @param startTime - * the start time - * @return the task info - */ - public TaskInfo setStartTime(Date startTime) { - getContent().setStartTime(startTime); - return this; - } - /** * Gets the state. * @@ -284,18 +146,6 @@ public Integer getState() { return getContent().getState(); } - /** - * Sets the state. - * - * @param state - * the state - * @return the task info - */ - public TaskInfo setState(Integer state) { - getContent().setState(state); - return this; - } - /** * Gets the task body. * @@ -305,18 +155,6 @@ public String getTaskBody() { return getContent().getTaskBody(); } - /** - * Sets the task body. - * - * @param taskBody - * the task body - * @return the task info - */ - public TaskInfo setTaskBody(String taskBody) { - getContent().setTaskBody(taskBody); - return this; - } - /** * Gets the options. * @@ -326,18 +164,6 @@ public Integer getOptions() { return getContent().getOptions(); } - /** - * Sets the options. - * - * @param options - * the options - * @return the task info - */ - public TaskInfo setOptions(Integer options) { - getContent().setOptions(options); - return this; - } - /** * Gets the encryption key id. * @@ -347,18 +173,6 @@ public String getEncryptionKeyId() { return getContent().getEncryptionKeyId(); } - /** - * Sets the encryption key id. - * - * @param encryptionKeyId - * the encryption key id - * @return the task info - */ - public TaskInfo setEncryptionKeyId(String encryptionKeyId) { - getContent().setEncryptionKeyId(encryptionKeyId); - return this; - } - /** * Gets the encryption scheme. * @@ -368,18 +182,6 @@ public String getEncryptionScheme() { return getContent().getEncryptionScheme(); } - /** - * Sets the encryption scheme. - * - * @param encryptionScheme - * the encryption scheme - * @return the task info - */ - public TaskInfo setEncryptionScheme(String encryptionScheme) { - getContent().setEncryptionScheme(encryptionScheme); - return this; - } - /** * Gets the encryption version. * @@ -389,18 +191,6 @@ public String getEncryptionVersion() { return getContent().getEncryptionVersion(); } - /** - * Sets the encryption version. - * - * @param encryptionVersion - * the encryption version - * @return the task info - */ - public TaskInfo setEncryptionVersion(String encryptionVersion) { - getContent().setEncryptionVersion(encryptionVersion); - return this; - } - /** * Gets the initialization vector. * @@ -409,17 +199,4 @@ public TaskInfo setEncryptionVersion(String encryptionVersion) { public String getInitializationVector() { return getContent().getInitializationVector(); } - - /** - * Sets the initialization vector. - * - * @param initializationVector - * the initialization vector - * @return the task info - */ - public TaskInfo setInitializationVector(String initializationVector) { - getContent().setInitializationVector(initializationVector); - return this; - } - } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java index cfcc0a909d6c..90d4992ba4a4 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/JobIntegrationTest.java @@ -29,6 +29,7 @@ import org.junit.Test; import com.microsoft.windowsazure.services.core.ServiceException; +import com.microsoft.windowsazure.services.media.implementation.content.JobType; import com.microsoft.windowsazure.services.media.models.AccessPolicy; import com.microsoft.windowsazure.services.media.models.AccessPolicyInfo; import com.microsoft.windowsazure.services.media.models.AccessPolicyPermission; @@ -116,11 +117,8 @@ public void createJobSuccess() throws Exception { // Arrange AssetInfo assetInfo = service.create(Asset.create()); - JobInfo expectedJob = new JobInfo(); - expectedJob.setName("My Encoding Job"); - expectedJob.setPriority(3); - expectedJob.setRunningDuration(0.0); - expectedJob.setState(JobState.Queued); + JobInfo expectedJob = new JobInfo(null, new JobType().setName("My Encoding Job").setPriority(3) + .setRunningDuration(0.0).setState(JobState.Queued.getCode())); AccessPolicyInfo accessPolicyInfo = createWritableAccessPolicy("createJobSuccess", 10); LocatorInfo locator = createLocator(accessPolicyInfo, assetInfo, 5, 10); @@ -152,11 +150,9 @@ public void createJobSuccess() throws Exception { @Test public void getJobSuccess() throws Exception { // Arrange - JobInfo expectedJob = new JobInfo(); - expectedJob.setName("My Encoding Job"); - expectedJob.setPriority(3); - expectedJob.setRunningDuration(0.0); - expectedJob.setState(JobState.Queued); + JobInfo expectedJob = new JobInfo(null, new JobType().setName("My Encoding Job").setPriority(3) + .setRunningDuration(0.0).setState(JobState.Queued.getCode())); + String jobId = createJob("getJobSuccess").getId(); // Act diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfoTest.java index c18e9a5297c5..6a1764eee282 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AccessPolicyInfoTest.java @@ -21,65 +21,69 @@ import org.junit.Assert; import org.junit.Test; +import com.microsoft.windowsazure.services.media.implementation.content.AccessPolicyType; + public class AccessPolicyInfoTest { @Test public void getSetId() { - AccessPolicyInfo policy = new AccessPolicyInfo(); String expected = "expectedId"; - String actual = policy.setId(expected).getId(); + AccessPolicyInfo policy = new AccessPolicyInfo(null, new AccessPolicyType().setId(expected)); + + String actual = policy.getId(); Assert.assertEquals(expected, actual); } @Test public void getSetCreated() { - AccessPolicyInfo policy = new AccessPolicyInfo(); Date expected = new Date(); + AccessPolicyInfo policy = new AccessPolicyInfo(null, new AccessPolicyType().setCreated(expected)); - Date actual = policy.setCreated(expected).getCreated(); + Date actual = policy.getCreated(); Assert.assertEquals(expected, actual); } @Test public void getSetLastModified() { - AccessPolicyInfo policy = new AccessPolicyInfo(); Date expected = new Date(); + AccessPolicyInfo policy = new AccessPolicyInfo(null, new AccessPolicyType().setLastModified(expected)); - Date actual = policy.setLastModified(expected).getLastModified(); + Date actual = policy.getLastModified(); Assert.assertEquals(expected, actual); } @Test public void getSetName() { - AccessPolicyInfo policy = new AccessPolicyInfo(); String expected = "policy name goes here"; + AccessPolicyInfo policy = new AccessPolicyInfo(null, new AccessPolicyType().setName(expected)); - String actual = policy.setName(expected).getName(); + String actual = policy.getName(); Assert.assertEquals(expected, actual); } @Test public void getSetDurationInMinutes() { - AccessPolicyInfo policy = new AccessPolicyInfo(); double expected = 60; // arbitrary value + AccessPolicyInfo policy = new AccessPolicyInfo(null, new AccessPolicyType().setDurationInMinutes(expected)); - double actual = policy.setDurationInMinutes(expected).getDurationInMinutes(); + double actual = policy.getDurationInMinutes(); Assert.assertEquals(expected, actual, 0.0); } @Test public void getSetPermissions() { - AccessPolicyInfo policy = new AccessPolicyInfo(); EnumSet expected = EnumSet .of(AccessPolicyPermission.LIST, AccessPolicyPermission.WRITE); + AccessPolicyInfo policy = new AccessPolicyInfo(null, + new AccessPolicyType().setPermissions(AccessPolicyPermission.bitsFromPermissions(expected))); - EnumSet actual = policy.setPermissions(expected).getPermissions(); + EnumSet actual = policy.getPermissions(); Assert.assertEquals(expected, actual); } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java index 2e974c81773c..3f794f40d612 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/AssetInfoTest.java @@ -20,16 +20,18 @@ import org.junit.Test; +import com.microsoft.windowsazure.services.media.implementation.content.AssetType; + public class AssetInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "expectedId"; - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setId(expectedId)); // Act - String actualId = assetInfo.setId(expectedId).getId(); + String actualId = assetInfo.getId(); // Assert assertEquals(expectedId, actualId); @@ -40,10 +42,10 @@ public void testGetSetId() { public void testGetSetState() { // Arrange AssetState expectedState = AssetState.Published; - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setState(expectedState.getCode())); // Act - AssetState actualState = assetInfo.setState(expectedState).getState(); + AssetState actualState = assetInfo.getState(); // Assert assertEquals(expectedState, actualState); @@ -54,10 +56,10 @@ public void testGetSetCreated() throws Exception { // Arrange Date expectedCreated = new Date(); - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setCreated(expectedCreated)); // Act - Date actualCreated = assetInfo.setCreated(expectedCreated).getCreated(); + Date actualCreated = assetInfo.getCreated(); // Assert assertEquals(expectedCreated, actualCreated); @@ -68,10 +70,10 @@ public void testGetSetCreated() throws Exception { public void testGetSetLastModified() throws Exception { // Arrange Date expectedLastModified = new Date(); - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setLastModified(expectedLastModified)); // Act - Date actualLastModified = assetInfo.setLastModified(expectedLastModified).getLastModified(); + Date actualLastModified = assetInfo.getLastModified(); // Assert assertEquals(expectedLastModified, actualLastModified); @@ -81,10 +83,10 @@ public void testGetSetLastModified() throws Exception { public void testGetSetAlternateId() { // Arrange String expectedAlternateId = "testAlternateId"; - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setAlternateId(expectedAlternateId)); // Act - String actualAlternateId = assetInfo.setAlternateId(expectedAlternateId).getAlternateId(); + String actualAlternateId = assetInfo.getAlternateId(); // Assert assertEquals(expectedAlternateId, actualAlternateId); @@ -94,10 +96,10 @@ public void testGetSetAlternateId() { public void testGetSetName() { // Arrange String expectedName = "testName"; - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setName(expectedName)); // Act - String actualName = assetInfo.setName(expectedName).getName(); + String actualName = assetInfo.getName(); // Assert assertEquals(expectedName, actualName); @@ -107,10 +109,10 @@ public void testGetSetName() { public void testGetSetOptions() { // Arrange EncryptionOption expectedOptions = EncryptionOption.None; - AssetInfo assetInfo = new AssetInfo(); + AssetInfo assetInfo = new AssetInfo(null, new AssetType().setOptions(expectedOptions.getCode())); // Act - EncryptionOption actualOptions = assetInfo.setOptions(expectedOptions).getOptions(); + EncryptionOption actualOptions = assetInfo.getOptions(); // Assert assertEquals(expectedOptions, actualOptions); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java index 0e9a21e3cdc8..675b3dc090b0 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/ContentKeyInfoTest.java @@ -20,16 +20,18 @@ import org.junit.Test; +import com.microsoft.windowsazure.services.media.implementation.content.ContentKeyRestType; + public class ContentKeyInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "expectedId"; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, new ContentKeyRestType().setId(expectedId)); // Act - String actualId = contentKeyInfo.setId(expectedId).getId(); + String actualId = contentKeyInfo.getId(); // Assert assertEquals(expectedId, actualId); @@ -39,10 +41,10 @@ public void testGetSetId() { public void testGetSetCreated() { // Arrange Date expectedCreated = new Date(); - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, new ContentKeyRestType().setCreated(expectedCreated)); // Act - Date actualCreated = contentKeyInfo.setCreated(expectedCreated).getCreated(); + Date actualCreated = contentKeyInfo.getCreated(); // Assert assertEquals(expectedCreated, actualCreated); @@ -52,10 +54,11 @@ public void testGetSetCreated() { public void testGetSetLastModified() { // Arrange Date expectedLastModified = new Date(); - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, + new ContentKeyRestType().setLastModified(expectedLastModified)); // Act - Date actualLastModified = contentKeyInfo.setLastModified(expectedLastModified).getLastModified(); + Date actualLastModified = contentKeyInfo.getLastModified(); // Assert assertEquals(expectedLastModified, actualLastModified); @@ -65,11 +68,11 @@ public void testGetSetLastModified() { public void testGetSetContentKeyType() { // Arrange ContentKeyType expectedContentKeyType = ContentKeyType.ConfigurationEncryption; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, + new ContentKeyRestType().setContentKeyType(expectedContentKeyType.getCode())); // Act - ContentKeyType actualContentKeyType = contentKeyInfo.setContentKeyType(expectedContentKeyType) - .getContentKeyType(); + ContentKeyType actualContentKeyType = contentKeyInfo.getContentKeyType(); // Assert assertEquals(expectedContentKeyType, actualContentKeyType); @@ -80,11 +83,11 @@ public void testGetSetContentKeyType() { public void testGetSetEncryptedContentKey() { // Arrange String expectedEncryptedContentKey = "testX509Certificate"; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, + new ContentKeyRestType().setEncryptedContentKey(expectedEncryptedContentKey)); // Act - String actualEncryptedContentKey = contentKeyInfo.setEncryptedContentKey(expectedEncryptedContentKey) - .getEncryptedContentKey(); + String actualEncryptedContentKey = contentKeyInfo.getEncryptedContentKey(); // Assert assertEquals(expectedEncryptedContentKey, actualEncryptedContentKey); @@ -94,10 +97,10 @@ public void testGetSetEncryptedContentKey() { public void testGetSetName() { // Arrange String expectedName = "expectedName"; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, new ContentKeyRestType().setName(expectedName)); // Act - String actualName = contentKeyInfo.setName(expectedName).getName(); + String actualName = contentKeyInfo.getName(); // Assert assertEquals(expectedName, actualName); @@ -107,10 +110,11 @@ public void testGetSetName() { public void testGetSetProtectionKeyId() { // Arrange String expectedProtectionKeyId = "expectedProtectionKeyId"; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, + new ContentKeyRestType().setProtectionKeyId(expectedProtectionKeyId)); // Act - String actualProtectionKeyId = contentKeyInfo.setProtectionKeyId(expectedProtectionKeyId).getProtectionKeyId(); + String actualProtectionKeyId = contentKeyInfo.getProtectionKeyId(); // Assert assertEquals(expectedProtectionKeyId, actualProtectionKeyId); @@ -121,11 +125,11 @@ public void testGetSetProtectionKeyId() { public void testGetSetProtectionKeyType() { // Arrange ProtectionKeyType expectedProtectionKeyType = ProtectionKeyType.X509CertificateThumbprint; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, + new ContentKeyRestType().setProtectionKeyType(expectedProtectionKeyType.getCode())); // Act - ProtectionKeyType actualProtectionKeyType = contentKeyInfo.setProtectionKeyType(expectedProtectionKeyType) - .getProtectionKeyType(); + ProtectionKeyType actualProtectionKeyType = contentKeyInfo.getProtectionKeyType(); // Assert assertEquals(expectedProtectionKeyType, actualProtectionKeyType); @@ -135,10 +139,10 @@ public void testGetSetProtectionKeyType() { public void testGetSetCheckSum() { // Arrange String expectedCheckSum = "testCheckSum"; - ContentKeyInfo contentKeyInfo = new ContentKeyInfo(); + ContentKeyInfo contentKeyInfo = new ContentKeyInfo(null, new ContentKeyRestType().setChecksum(expectedCheckSum)); // Act - String actualCheckSum = contentKeyInfo.setChecksum(expectedCheckSum).getChecksum(); + String actualCheckSum = contentKeyInfo.getChecksum(); // Assert assertEquals(expectedCheckSum, actualCheckSum); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java index 5b5c4ab54769..ab5ef0cf2720 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/LocatorInfoTest.java @@ -20,16 +20,18 @@ import org.junit.Test; +import com.microsoft.windowsazure.services.media.implementation.content.LocatorRestType; + public class LocatorInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "testId"; - LocatorInfo locator = new LocatorInfo(); + LocatorInfo locator = new LocatorInfo(null, new LocatorRestType().setId(expectedId)); // Act - String actualId = locator.setId(expectedId).getId(); + String actualId = locator.getId(); // Assert assertEquals(expectedId, actualId); @@ -39,11 +41,11 @@ public void testGetSetId() { public void testGetSetExpirationDateTime() { // Arrange Date expectedExpirationDateTime = new Date(); - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, + new LocatorRestType().setExpirationDateTime(expectedExpirationDateTime)); // Act - Date actualExpirationDateTime = locatorInfo.setExpirationDateTime(expectedExpirationDateTime) - .getExpirationDateTime(); + Date actualExpirationDateTime = locatorInfo.getExpirationDateTime(); // Assert assertEquals(expectedExpirationDateTime, actualExpirationDateTime); @@ -53,10 +55,10 @@ public void testGetSetExpirationDateTime() { public void testGetSetType() { // Arrange LocatorType expectedLocatorType = LocatorType.SAS; - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, new LocatorRestType().setType(expectedLocatorType.getCode())); // Act - LocatorType actualLocatorType = locatorInfo.setLocatorType(expectedLocatorType).getLocatorType(); + LocatorType actualLocatorType = locatorInfo.getLocatorType(); // Assert assertEquals(expectedLocatorType, actualLocatorType); @@ -66,10 +68,10 @@ public void testGetSetType() { public void testGetSetPath() { // Arrange String expectedPath = "testPath"; - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, new LocatorRestType().setPath(expectedPath)); // Act - String actualPath = locatorInfo.setPath(expectedPath).getPath(); + String actualPath = locatorInfo.getPath(); // Assert assertEquals(expectedPath, actualPath); @@ -79,10 +81,10 @@ public void testGetSetPath() { public void testGetSetAccessPolicyId() { // Arrange String expectedAccessPolicyId = "testAccessPolicyId"; - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, new LocatorRestType().setAccessPolicyId(expectedAccessPolicyId)); // Act - String actualAccessPolicyId = locatorInfo.setAccessPolicyId(expectedAccessPolicyId).getAccessPolicyId(); + String actualAccessPolicyId = locatorInfo.getAccessPolicyId(); // Assert assertEquals(expectedAccessPolicyId, actualAccessPolicyId); @@ -92,10 +94,10 @@ public void testGetSetAccessPolicyId() { public void testGetSetAssetId() { // Arrange String expectedAssetId = "testAssetId"; - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, new LocatorRestType().setAssetId(expectedAssetId)); // Act - String actualAssetId = locatorInfo.setAssetId(expectedAssetId).getAssetId(); + String actualAssetId = locatorInfo.getAssetId(); // Assert assertEquals(expectedAssetId, actualAssetId); @@ -105,10 +107,10 @@ public void testGetSetAssetId() { public void testGetSetStartTime() { // Arrange Date expectedStartTime = new Date(); - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, new LocatorRestType().setStartTime(expectedStartTime)); // Act - Date actualStartTime = locatorInfo.setStartTime(expectedStartTime).getStartTime(); + Date actualStartTime = locatorInfo.getStartTime(); // Assert assertEquals(expectedStartTime, actualStartTime); @@ -118,10 +120,10 @@ public void testGetSetStartTime() { public void testGetSetBaseUri() { // Arrange String expectedBaseUri = "testBaseUri"; - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, new LocatorRestType().setBaseUri(expectedBaseUri)); // Act - String actualBaseUri = locatorInfo.setBaseUri(expectedBaseUri).getBaseUri(); + String actualBaseUri = locatorInfo.getBaseUri(); // Assert assertEquals(expectedBaseUri, actualBaseUri); @@ -131,14 +133,13 @@ public void testGetSetBaseUri() { public void testGetSetContentAccessComponent() { // Arrange String expectedContentAccessComponent = "testContentAccessToken"; - LocatorInfo locatorInfo = new LocatorInfo(); + LocatorInfo locatorInfo = new LocatorInfo(null, + new LocatorRestType().setContentAccessComponent(expectedContentAccessComponent)); // Act - String actualContentAccessComponent = locatorInfo.setContentAccessComponent(expectedContentAccessComponent) - .getContentAccessToken(); + String actualContentAccessComponent = locatorInfo.getContentAccessToken(); // Assert assertEquals(expectedContentAccessComponent, actualContentAccessComponent); - } } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfoTest.java index c247486b1c48..4e05b0f5e453 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/media/models/MediaProcessorInfoTest.java @@ -18,16 +18,18 @@ import org.junit.Test; +import com.microsoft.windowsazure.services.media.implementation.content.MediaProcessorType; + public class MediaProcessorInfoTest { @Test public void testGetSetId() { // Arrange String expectedId = "expectedId"; - MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(); + MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(null, new MediaProcessorType().setId(expectedId)); // Act - String actualId = mediaProcessorInfo.setId(expectedId).getId(); + String actualId = mediaProcessorInfo.getId(); // Assert assertEquals(expectedId, actualId); @@ -38,10 +40,11 @@ public void testGetSetId() { public void testGetSetName() { // Arrange String expectedName = "testName"; - MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(); + MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(null, + new MediaProcessorType().setName(expectedName)); // Act - String actualName = mediaProcessorInfo.setName(expectedName).getName(); + String actualName = mediaProcessorInfo.getName(); // Assert assertEquals(expectedName, actualName); @@ -52,10 +55,11 @@ public void testGetSetDescription() throws Exception { // Arrange String expectedDescription = "testDescription"; - MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(); + MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(null, + new MediaProcessorType().setDescription(expectedDescription)); // Act - String actualDescription = mediaProcessorInfo.setDescription(expectedDescription).getDescription(); + String actualDescription = mediaProcessorInfo.getDescription(); // Assert assertEquals(expectedDescription, actualDescription); @@ -66,10 +70,11 @@ public void testGetSetDescription() throws Exception { public void testGetSetSku() throws Exception { // Arrange String expectedSku = "testSku"; - MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(); + MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(null, + new MediaProcessorType().setSku(expectedSku)); // Act - String actualSku = mediaProcessorInfo.setSku(expectedSku).getSku(); + String actualSku = mediaProcessorInfo.getSku(); // Assert assertEquals(expectedSku, actualSku); @@ -79,10 +84,11 @@ public void testGetSetSku() throws Exception { public void testGetSetVendor() { // Arrange String expectedVendor = "testVendor"; - MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(); + MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(null, + new MediaProcessorType().setVendor(expectedVendor)); // Act - String actualVendor = mediaProcessorInfo.setVendor(expectedVendor).getVendor(); + String actualVendor = mediaProcessorInfo.getVendor(); // Assert assertEquals(expectedVendor, actualVendor); @@ -92,10 +98,11 @@ public void testGetSetVendor() { public void testGetSetVersion() { // Arrange String expectedVersion = "testVersion"; - MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(); + MediaProcessorInfo mediaProcessorInfo = new MediaProcessorInfo(null, + new MediaProcessorType().setVersion(expectedVersion)); // Act - String actualVersion = mediaProcessorInfo.setVersion(expectedVersion).getVersion(); + String actualVersion = mediaProcessorInfo.getVersion(); // Assert assertEquals(expectedVersion, actualVersion);