From b84180e1012c4b2649e8108d40aad6147c727111 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 22 Apr 2013 17:12:50 -0700 Subject: [PATCH 1/7] initial checkin to update QueueDescription --- .../services/serviceBus/models/QueueInfo.java | 140 +++++++++++++++++ ...netservices.2010.10.servicebus.connect.xsd | 141 +++++++++++++++++- 2 files changed, 280 insertions(+), 1 deletion(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java index 676cb1bfd3181..cbbfb62a2cf3f 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java @@ -14,12 +14,17 @@ */ package com.microsoft.windowsazure.services.serviceBus.models; +import java.util.Date; + import javax.ws.rs.core.MediaType; import javax.xml.datatype.Duration; +import com.microsoft.windowsazure.services.serviceBus.implementation.AuthorizationRule; +import com.microsoft.windowsazure.services.serviceBus.implementation.AuthorizationRules; import com.microsoft.windowsazure.services.serviceBus.implementation.Content; import com.microsoft.windowsazure.services.serviceBus.implementation.Entry; import com.microsoft.windowsazure.services.serviceBus.implementation.EntryModel; +import com.microsoft.windowsazure.services.serviceBus.implementation.MessageCountDetails; import com.microsoft.windowsazure.services.serviceBus.implementation.QueueDescription; /** @@ -191,6 +196,16 @@ public QueueInfo setDefaultMessageTimeToLive(Duration value) { return this; } + public Duration getAutoDeleteOnIdle() + { + return getModel().getAutoDeleteOnIdle(); + } + + public QueueInfo setAutoDeleteOnIdle(Duration duration) { + getModel().setAutoDeleteOnIdle(duration); + return this; + } + /** * Indicates whether dead lettering is in effect upon message expiration. * @@ -299,5 +314,130 @@ public Long getSizeInBytes() { public Long getMessageCount() { return getModel().getMessageCount(); } + + public MessageCountDetails getMessageCountDetails() + { + return getModel().getMessageCountDetails(); + } + public AuthorizationRules getAuthorization() + { + return getModel().getAuthorization(); + } + + public QueueInfo setAuthorization(AuthorizationRules authorizationRules) + { + getModel().setAuthorization(authorizationRules); + return this; + } + + public Boolean getIsAnonymousAccessible() + { + return getModel().getIsAnonymousAccessible(); + } + + public QueueInfo setIsAnonymouseAccessible(Boolean isAnonymousAccessible) + { + getModel().setIsAnonymousAccessible(isAnonymousAccessible); + return this; + } + + public Boolean getSupportOrdering() + { + return getModel().getSupportOrdering(); + } + + public QueueInfo setSupportOrdering(Boolean supportOrdering) + { + getModel().setSupportOrdering(supportOrdering); + return this; + } + + public EntityStatus getEntityStatus() + { + return getModel().getEntityStatus(); + } + + public QueueInfo setEntityStatus(EntityStatus entityStatus) + { + getModel().setEntityStatus(entityStatus); + return this; + } + + public EntityAvailabilityStatus getEntityAvailabilityStatus() + { + return getModel().getEntityAvailabilityStatus(); + } + + public QueueInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvailabilityStatus) + { + getModel().setEntityAvailabilityStatus(entityAvailabilityStatus); + return this; + } + + public String getForwardTo() + { + return getModel().getForwardTo(); + } + + public QueueInfo setForwardTo(String forwardTo) + { + getModel().setForwardTo(forwardTo); + return this; + } + + public Date getCreatedAt() + { + return getModel().getCreatedAt(); + } + + public QueueInfo setCreatedAt(Date createdAt) + { + getModel().setCreatedAt(createdAt); + return this; + } + + public Date getUpdatedAt() + { + return getModel().getUpdatedAt(); + } + + public QueueInfo setUpdatedAt(Date updatedAt) + { + getModel().setUpdatedAt(updatedAt); + return this; + } + + public Date getAccessedAt() + { + return getModel().getAccessedAt(); + } + + public QueueInfo setAccessedAt(Date accessedAt) + { + getModel().setAccessedAt(accessedAt); + return this; + } + + public Date PartitioningPolicy getPartitioningPolicy() + { + return getModel().getPartitioningPolicy(); + } + + public QueueInfo setPartitioningPolicy(PartitioningPolicy partitioningPolicy) + { + getModel().setPartitioningPolicy(partitioningPolicy); + return this; + } + + public String setUserMetadata() + { + return getModel().getUserMetadata(); + } + + public QueueInfo setUserMetadata(String userMetadata) + { + getModel().setUserMetadata(userMetadata); + return this; + } } diff --git a/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd b/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd index 31d324b76fbef..e99d9e665bf3e 100644 --- a/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd +++ b/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd @@ -57,6 +57,13 @@ + + + + + + + @@ -99,6 +106,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -220,6 +304,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -300,4 +439,4 @@ - \ No newline at end of file + From 0d77d6489cf59d5f3e21d6efa9001467d92597e5 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 22 Apr 2013 19:29:43 -0700 Subject: [PATCH 2/7] update the product code to make sure that the new QueueInfo is buildable. --- .../services/serviceBus/models/QueueInfo.java | 172 ++++++++---------- ...netservices.2010.10.servicebus.connect.xsd | 51 +++--- 2 files changed, 105 insertions(+), 118 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java index cbbfb62a2cf3f..5ff8b606c03b8 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java @@ -2,29 +2,31 @@ * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.microsoft.windowsazure.services.serviceBus.models; -import java.util.Date; +import java.util.Calendar; import javax.ws.rs.core.MediaType; import javax.xml.datatype.Duration; -import com.microsoft.windowsazure.services.serviceBus.implementation.AuthorizationRule; import com.microsoft.windowsazure.services.serviceBus.implementation.AuthorizationRules; import com.microsoft.windowsazure.services.serviceBus.implementation.Content; +import com.microsoft.windowsazure.services.serviceBus.implementation.EntityAvailabilityStatus; +import com.microsoft.windowsazure.services.serviceBus.implementation.EntityStatus; import com.microsoft.windowsazure.services.serviceBus.implementation.Entry; import com.microsoft.windowsazure.services.serviceBus.implementation.EntryModel; import com.microsoft.windowsazure.services.serviceBus.implementation.MessageCountDetails; +import com.microsoft.windowsazure.services.serviceBus.implementation.PartitioningPolicy; import com.microsoft.windowsazure.services.serviceBus.implementation.QueueDescription; /** @@ -196,16 +198,15 @@ public QueueInfo setDefaultMessageTimeToLive(Duration value) { return this; } - public Duration getAutoDeleteOnIdle() - { + public Duration getAutoDeleteOnIdle() { return getModel().getAutoDeleteOnIdle(); } - + public QueueInfo setAutoDeleteOnIdle(Duration duration) { getModel().setAutoDeleteOnIdle(duration); return this; } - + /** * Indicates whether dead lettering is in effect upon message expiration. * @@ -314,130 +315,107 @@ public Long getSizeInBytes() { public Long getMessageCount() { return getModel().getMessageCount(); } - - public MessageCountDetails getMessageCountDetails() - { - return getModel().getMessageCountDetails(); + + public MessageCountDetails getCountDetails() { + return getModel().getCountDetails(); } - public AuthorizationRules getAuthorization() - { - return getModel().getAuthorization(); + public AuthorizationRules getAuthorizationRules() { + return getModel().getAuthorizationRules(); } - - public QueueInfo setAuthorization(AuthorizationRules authorizationRules) - { - getModel().setAuthorization(authorizationRules); - return this; + + public QueueInfo setAuthorization(AuthorizationRules authorizationRules) { + getModel().setAuthorizationRules(authorizationRules); + return this; } - - public Boolean getIsAnonymousAccessible() - { - return getModel().getIsAnonymousAccessible(); + + public Boolean getIsAnonymousAccessible() { + return getModel().isIsAnonymousAccessible(); } - - public QueueInfo setIsAnonymouseAccessible(Boolean isAnonymousAccessible) - { + + public QueueInfo setIsAnonymouseAccessible(Boolean isAnonymousAccessible) { getModel().setIsAnonymousAccessible(isAnonymousAccessible); return this; } - - public Boolean getSupportOrdering() - { - return getModel().getSupportOrdering(); + + public Boolean getSupportOrdering() { + return getModel().isSupportOrdering(); } - - public QueueInfo setSupportOrdering(Boolean supportOrdering) - { + + public QueueInfo setSupportOrdering(Boolean supportOrdering) { getModel().setSupportOrdering(supportOrdering); - return this; - } - - public EntityStatus getEntityStatus() - { - return getModel().getEntityStatus(); - } - - public QueueInfo setEntityStatus(EntityStatus entityStatus) - { - getModel().setEntityStatus(entityStatus); - return this; - } - - public EntityAvailabilityStatus getEntityAvailabilityStatus() - { + return this; + } + + public EntityStatus getStatus() { + return getModel().getStatus(); + } + + public QueueInfo setStatus(EntityStatus entityStatus) { + getModel().setStatus(entityStatus); + return this; + } + + public EntityAvailabilityStatus getEntityAvailabilityStatus() { return getModel().getEntityAvailabilityStatus(); } - - public QueueInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvailabilityStatus) - { + + public QueueInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvailabilityStatus) { getModel().setEntityAvailabilityStatus(entityAvailabilityStatus); - return this; + return this; } - - public String getForwardTo() - { + + public String getForwardTo() { return getModel().getForwardTo(); } - - public QueueInfo setForwardTo(String forwardTo) - { + + public QueueInfo setForwardTo(String forwardTo) { getModel().setForwardTo(forwardTo); return this; } - - public Date getCreatedAt() - { + + public Calendar getCreatedAt() { return getModel().getCreatedAt(); } - - public QueueInfo setCreatedAt(Date createdAt) - { + + public QueueInfo setCreatedAt(Calendar createdAt) { getModel().setCreatedAt(createdAt); return this; } - - public Date getUpdatedAt() - { + + public Calendar getUpdatedAt() { return getModel().getUpdatedAt(); } - - public QueueInfo setUpdatedAt(Date updatedAt) - { + + public QueueInfo setUpdatedAt(Calendar updatedAt) { getModel().setUpdatedAt(updatedAt); return this; } - - public Date getAccessedAt() - { + + public Calendar getAccessedAt() { return getModel().getAccessedAt(); } - - public QueueInfo setAccessedAt(Date accessedAt) - { + + public QueueInfo setAccessedAt(Calendar accessedAt) { getModel().setAccessedAt(accessedAt); return this; } - - public Date PartitioningPolicy getPartitioningPolicy() - { + + public PartitioningPolicy getPartitioningPolicy() { return getModel().getPartitioningPolicy(); } - - public QueueInfo setPartitioningPolicy(PartitioningPolicy partitioningPolicy) - { + + public QueueInfo setPartitioningPolicy(PartitioningPolicy partitioningPolicy) { getModel().setPartitioningPolicy(partitioningPolicy); return this; } - - public String setUserMetadata() - { + + public String setUserMetadata() { return getModel().getUserMetadata(); } - - public QueueInfo setUserMetadata(String userMetadata) - { + + public QueueInfo setUserMetadata(String userMetadata) { getModel().setUserMetadata(userMetadata); - return this; + return this; } } diff --git a/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd b/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd index e99d9e665bf3e..7e66e27b33eae 100644 --- a/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd +++ b/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd @@ -2,18 +2,20 @@ + @@ -57,13 +59,6 @@ - - - - - - - @@ -106,63 +101,77 @@ - + - + + + + + + + + - + - + - + - + - + - + - + + + + + + + + @@ -176,7 +185,7 @@ - + From ed53fd26dcd1ad3c42e44163d694dab473e408f8 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 23 Apr 2013 14:11:08 -0700 Subject: [PATCH 3/7] initial check in for the scaffold of the QueueInfoTest --- ...netservices.2010.10.servicebus.connect.xsd | 4 +- .../serviceBus/models/QueueInfoTest.java | 151 ++++++++++++++++++ 2 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java diff --git a/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd b/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd index 7e66e27b33eae..6966e340ecb2f 100644 --- a/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd +++ b/microsoft-azure-api/src/main/resources/schemas.microsoft.com.netservices.2010.10.servicebus.connect.xsd @@ -2,8 +2,8 @@ Date: Tue, 23 Apr 2013 16:54:55 -0700 Subject: [PATCH 4/7] update unit test for QueueInfo --- .../services/serviceBus/models/QueueInfo.java | 10 +- .../serviceBus/models/QueueInfoTest.java | 134 +++++++++++++++++- 2 files changed, 139 insertions(+), 5 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java index 5ff8b606c03b8..8e0d572d69ab2 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java @@ -307,6 +307,11 @@ public Long getSizeInBytes() { return getModel().getSizeInBytes(); } + public QueueInfo setSizeInBytes(Long sizeInBytes) { + getModel().setSizeInBytes(sizeInBytes); + return this; + } + /** * Returns the number of messages in the queue. * @@ -320,7 +325,7 @@ public MessageCountDetails getCountDetails() { return getModel().getCountDetails(); } - public AuthorizationRules getAuthorizationRules() { + public AuthorizationRules getAuthorization() { return getModel().getAuthorizationRules(); } @@ -329,7 +334,7 @@ public QueueInfo setAuthorization(AuthorizationRules authorizationRules) { return this; } - public Boolean getIsAnonymousAccessible() { + public Boolean isAnonymousAccessible() { return getModel().isIsAnonymousAccessible(); } @@ -418,4 +423,5 @@ public QueueInfo setUserMetadata(String userMetadata) { getModel().setUserMetadata(userMetadata); return this; } + } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java index 616160c28f0f4..f62623effd9be 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java @@ -16,91 +16,219 @@ import static org.junit.Assert.*; +import javax.xml.datatype.Duration; + import org.junit.Test; +import com.microsoft.windowsazure.services.serviceBus.implementation.AuthorizationRules; +import com.microsoft.windowsazure.services.serviceBus.implementation.EntityStatus; + public class QueueInfoTest { @Test public void testGetSetLockDuration() { // Arrange + Duration expectedLockDuration = Duration.create(); QueueInfo QueueInfo = new QueueInfo(); // Act - String actualId = QueueInfo.getId(); + Duration actualLockDuration = QueueInfo.setLockDuration(expectedLockDuration).getLockDuration(); // Assert - assertEquals(expectedId, actualId); + assertEquals(expectedLockDuration, actualLockDuration); } @Test public void testGetSetMaxSizeInMegabytes() { + // Arrange + Long expectedMaxSizeInMegabytes = 1024L; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Long actualMaxSizeInMegabytes = QueueInfo.setMaxSizeInMegabytes(expectedMaxSizeInMegabytes) + .getMaxSizeInMegabytes(); + + // Assert + assertEquals(expectedMaxSizeInMegabytes, actualMaxSizeInMegabytes); } @Test public void testGetSetRequiresDuplicateDetection() { + // Arrange + Boolean expectedRequiresDuplicateDetection = true; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Boolean actualRequiresDuplicateDetection = QueueInfo.setRequiresDuplicateDetection( + expectedRequiresDuplicateDetection).isRequiresDuplicateDetection(); + + // Assert + assertEquals(expectedRequiresDuplicateDetection, actualRequiresDuplicateDetection); } @Test public void testGetSetRequiresSession() { + // Arrange + Boolean expectedRequiresSession = true; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Boolean actualRequiresSession = QueueInfo.setRequiresSession(expectedRequiresSession).isRequiresSession(); + // Assert + assertEquals(expectedRequiresSession, actualRequiresSession); } @Test public void testGetSetDefaultMessageTimeToLive() { + // Arrange + Duration expectedDefaultMessageTimeToLive = Duration.create(); + QueueInfo QueueInfo = new QueueInfo(); + // Act + Duration actualDefaultMessageTimeToLive = QueueInfo.setDefaultMessageTimeToLive( + expectedDefaultMessageTimeToLive).getDefaultMessageTimeToLive(); + + // Assert + assertEquals(expectedDefaultMessageTimeToLive, actualDefaultMessageTimeToLive); } @Test public void testGetSetDeadLetteringOnMessageExpiration() { + // Arrange + Boolean expectedDeadLetteringOnMessageExpiration = true; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Boolean actualDeadLetteringOnMessageExpiration = QueueInfo.setDeadLetteringOnMessageExpiration( + expectedDeadLetteringOnMessageExpiration).isDeadLetteringOnMessageExpiration(); + // Assert + assertEquals(expectedDeadLetteringOnMessageExpiration, actualDeadLetteringOnMessageExpiration); } @Test public void testGetSetDuplicateDetectionHistoryTimeWindow() { + // Arrange + Duration expectedDefaultMessageTimeToLive = Duration.create(); + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Duration actualDefaultMessageTimeToLive = QueueInfo.setDefaultMessageTimeToLive( + expectedDefaultMessageTimeToLive).getDefaultMessageTimeToLive(); + // Assert + assertEquals(expectedDefaultMessageTimeToLive, actualDefaultMessageTimeToLive); } @Test public void testGetSetMaxDeliveryCount() { + // Arrange + Integer expectedMaxDeliveryCount = 1024; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Integer actualMaxDeliveryCount = QueueInfo.setMaxDeliveryCount(expectedMaxDeliveryCount).getMaxDeliveryCount(); + // Assert + assertEquals(expectedMaxDeliveryCount, actualMaxDeliveryCount); } @Test public void testGetSetEnableBatchedOperations() { + // Arrange + Boolean expectedEnableBatchedOperations = true; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Boolean actualEnableBatchedOperations = QueueInfo.setEnableBatchedOperations(expectedEnableBatchedOperations) + .isEnableBatchedOperations(); + // Assert + assertEquals(expectedEnableBatchedOperations, actualEnableBatchedOperations); } @Test public void testGetSetSizeInBytes() { + // Arrange + Long expectedSizeInBytes = 1024L; + QueueInfo QueueInfo = new QueueInfo(); + // Act + Long actualSizeInBytes = QueueInfo.setSizeInBytes(expectedSizeInBytes).getSizeInBytes(); + + // Assert + assertEquals(expectedSizeInBytes, actualSizeInBytes); } @Test public void testGetSetMessageCount() { + // Arrange + Long expectedMessageCount = 1024L; + QueueInfo QueueInfo = new QueueInfo(); + // Act + Long actualMessageCount = QueueInfo.setSizeInBytes(expectedMessageCount).getMessageCount(); + + // Assert + assertEquals(expectedMessageCount, actualMessageCount); } @Test public void testGetSetIsAnonymousAccessible() { + // Arrange + Boolean expectedIsAnonymousAccessible = true; + QueueInfo QueueInfo = new QueueInfo(); + // Act + Boolean actualIsAnonymousAccessible = QueueInfo.setEnableBatchedOperations(expectedIsAnonymousAccessible) + .isAnonymousAccessible(); + + // Assert + assertEquals(expectedIsAnonymousAccessible, actualIsAnonymousAccessible); } @Test - public void testGetSetAuthorizationRules() { + public void testGetSetAuthorization() { + // Arrange + AuthorizationRules expectedAuthorizationRules = new AuthorizationRules(); + QueueInfo QueueInfo = new QueueInfo(); + // Act + AuthorizationRules actualAuthorizationRules = QueueInfo.setAuthorization(expectedAuthorizationRules) + .getAuthorization(); + + // Assert + assertEquals(expectedAuthorizationRules, actualAuthorizationRules); } @Test public void testGetSetStatus() { + // Arrange + EntityStatus expectedEntityStatus = EntityStatus.ACTIVE; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + EntityStatus actualEntityStatus = QueueInfo.setStatus(expectedEntityStatus).getStatus(); + // Assert + assertEquals(expectedEntityStatus, actualEntityStatus); } @Test public void testGetSetForwardTo() { + // Arrange + String expectedForwardTo = "forwardTo"; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + String actualForwardTo = QueueInfo.setForwardTo(expectedForwardTo).getForwardTo(); + // Assert + assertEquals(expectedForwardTo, actualForwardTo); } @Test From da53615f397b9c32fb1cf84867e2c2c4ce6669f6 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 23 Apr 2013 17:41:03 -0700 Subject: [PATCH 5/7] all the queue info unit tests passes. --- .../services/serviceBus/models/QueueInfo.java | 15 ++- .../serviceBus/models/QueueInfoTest.java | 103 +++++++++++++++++- 2 files changed, 110 insertions(+), 8 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java index 8e0d572d69ab2..961c8340bd27f 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java @@ -321,6 +321,16 @@ public Long getMessageCount() { return getModel().getMessageCount(); } + public QueueInfo setMessageCount(Long messageCount) { + getModel().setMessageCount(messageCount); + return this; + } + + public QueueInfo setCountDetails(MessageCountDetails countDetails) { + getModel().setCountDetails(countDetails); + return this; + } + public MessageCountDetails getCountDetails() { return getModel().getCountDetails(); } @@ -338,12 +348,12 @@ public Boolean isAnonymousAccessible() { return getModel().isIsAnonymousAccessible(); } - public QueueInfo setIsAnonymouseAccessible(Boolean isAnonymousAccessible) { + public QueueInfo setIsAnonymousAccessible(Boolean isAnonymousAccessible) { getModel().setIsAnonymousAccessible(isAnonymousAccessible); return this; } - public Boolean getSupportOrdering() { + public Boolean isSupportOrdering() { return getModel().isSupportOrdering(); } @@ -423,5 +433,4 @@ public QueueInfo setUserMetadata(String userMetadata) { getModel().setUserMetadata(userMetadata); return this; } - } diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java index f62623effd9be..6303db54332e4 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java @@ -16,19 +16,37 @@ import static org.junit.Assert.*; +import java.util.Calendar; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; import org.junit.Test; import com.microsoft.windowsazure.services.serviceBus.implementation.AuthorizationRules; +import com.microsoft.windowsazure.services.serviceBus.implementation.EntityAvailabilityStatus; import com.microsoft.windowsazure.services.serviceBus.implementation.EntityStatus; +import com.microsoft.windowsazure.services.serviceBus.implementation.MessageCountDetails; +import com.microsoft.windowsazure.services.serviceBus.implementation.PartitioningPolicy; public class QueueInfoTest { + private Duration createDuration(int milliSeconds) { + DatatypeFactory datatypeFactory; + try { + datatypeFactory = DatatypeFactory.newInstance(); + } + catch (DatatypeConfigurationException e) { + throw new RuntimeException(e); + } + return datatypeFactory.newDuration(milliSeconds); + } + @Test public void testGetSetLockDuration() { // Arrange - Duration expectedLockDuration = Duration.create(); + Duration expectedLockDuration = createDuration(100); QueueInfo QueueInfo = new QueueInfo(); // Act @@ -85,7 +103,7 @@ public void testGetSetRequiresSession() { @Test public void testGetSetDefaultMessageTimeToLive() { // Arrange - Duration expectedDefaultMessageTimeToLive = Duration.create(); + Duration expectedDefaultMessageTimeToLive = createDuration(100); QueueInfo QueueInfo = new QueueInfo(); // Act @@ -113,7 +131,7 @@ public void testGetSetDeadLetteringOnMessageExpiration() { @Test public void testGetSetDuplicateDetectionHistoryTimeWindow() { // Arrange - Duration expectedDefaultMessageTimeToLive = Duration.create(); + Duration expectedDefaultMessageTimeToLive = createDuration(100); QueueInfo QueueInfo = new QueueInfo(); // Act @@ -171,7 +189,7 @@ public void testGetSetMessageCount() { QueueInfo QueueInfo = new QueueInfo(); // Act - Long actualMessageCount = QueueInfo.setSizeInBytes(expectedMessageCount).getMessageCount(); + Long actualMessageCount = QueueInfo.setMessageCount(expectedMessageCount).getMessageCount(); // Assert assertEquals(expectedMessageCount, actualMessageCount); @@ -184,7 +202,7 @@ public void testGetSetIsAnonymousAccessible() { QueueInfo QueueInfo = new QueueInfo(); // Act - Boolean actualIsAnonymousAccessible = QueueInfo.setEnableBatchedOperations(expectedIsAnonymousAccessible) + Boolean actualIsAnonymousAccessible = QueueInfo.setIsAnonymousAccessible(expectedIsAnonymousAccessible) .isAnonymousAccessible(); // Assert @@ -233,47 +251,122 @@ public void testGetSetForwardTo() { @Test public void testGetSetCreatedAt() { + // Arrange + Calendar expectedCreatedAt = Calendar.getInstance(); + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Calendar actualCreatedAt = QueueInfo.setCreatedAt(expectedCreatedAt).getCreatedAt(); + // Assert + assertEquals(expectedCreatedAt, actualCreatedAt); } @Test public void testGetSetUpdatedAt() { + // Arrange + Calendar expectedUpdatedAt = Calendar.getInstance(); + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Calendar actualUpdatedAt = QueueInfo.setUpdatedAt(expectedUpdatedAt).getUpdatedAt(); + // Assert + assertEquals(expectedUpdatedAt, actualUpdatedAt); } @Test public void testGetSetAccessedAt() { + // Arrange + Calendar expectedAccessedAt = Calendar.getInstance(); + QueueInfo QueueInfo = new QueueInfo(); + // Act + Calendar actualAccessedAt = QueueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); + + // Assert + assertEquals(expectedAccessedAt, actualAccessedAt); } @Test public void testGetSetUserMetadata() { + // Arrange + Calendar expectedAccessedAt = Calendar.getInstance(); + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Calendar actualAccessedAt = QueueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); + // Assert + assertEquals(expectedAccessedAt, actualAccessedAt); } @Test public void testGetSetSupportOrdering() { + // Arrange + Boolean expectedIsSupportOrdering = true; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Boolean actualIsSupportOrdering = QueueInfo.setSupportOrdering(expectedIsSupportOrdering).isSupportOrdering(); + // Assert + assertEquals(expectedIsSupportOrdering, actualIsSupportOrdering); } @Test public void testGetSetCountDetails() { + // Arrange + MessageCountDetails expectedCountDetails = new MessageCountDetails(); + QueueInfo QueueInfo = new QueueInfo(); + // Act + MessageCountDetails actualCountDetails = QueueInfo.setCountDetails(expectedCountDetails).getCountDetails(); + + // Assert + assertEquals(expectedCountDetails, actualCountDetails); } @Test public void testGetSetAutoDeleteOnIdle() { + // Arrange + Duration expectedIsAutoDeleteOnIdle = createDuration(100); + QueueInfo QueueInfo = new QueueInfo(); + + // Act + Duration actualIsAutoDeleteOnIdle = QueueInfo.setAutoDeleteOnIdle(expectedIsAutoDeleteOnIdle) + .getAutoDeleteOnIdle(); + // Assert + assertEquals(expectedIsAutoDeleteOnIdle, actualIsAutoDeleteOnIdle); } @Test public void testGetSetPartioningPolicy() { + // Arrange + PartitioningPolicy expectedPartitioningPolicy = PartitioningPolicy.NO_PARTITIONING; + QueueInfo QueueInfo = new QueueInfo(); + + // Act + PartitioningPolicy actualPartitioningPolicy = QueueInfo.setPartitioningPolicy(expectedPartitioningPolicy) + .getPartitioningPolicy(); + // Assert + assertEquals(expectedPartitioningPolicy, actualPartitioningPolicy); } @Test public void testGetSetEntityAvailabilityStatus() { + // Arrange + EntityAvailabilityStatus expectedEntityAvailabilityStatus = EntityAvailabilityStatus.AVAILABLE; + QueueInfo QueueInfo = new QueueInfo(); + // Act + EntityAvailabilityStatus actualEntityAvailabilityStatus = QueueInfo.setEntityAvailabilityStatus( + expectedEntityAvailabilityStatus).getEntityAvailabilityStatus(); + + // Assert + assertEquals(expectedEntityAvailabilityStatus, actualEntityAvailabilityStatus); } } From a56d910250d7ac37eb91a5f21bd4916b9540d5bc Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 24 Apr 2013 10:30:42 -0700 Subject: [PATCH 6/7] ensure all the unit tests passes. --- .../services/serviceBus/models/QueueInfo.java | 186 +++++++++++++++++- .../serviceBus/models/QueueInfoTest.java | 96 ++++----- 2 files changed, 226 insertions(+), 56 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java index 961c8340bd27f..07a79e8dfe5ef 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java @@ -80,7 +80,7 @@ public String getPath() { * @param value * A String that represents the name of the queue. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setPath(String value) { getEntry().setTitle(value); @@ -102,7 +102,7 @@ public Duration getLockDuration() { * @param value * The duration, in seconds, of the lock. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setLockDuration(Duration value) { getModel().setLockDuration(value); @@ -124,7 +124,7 @@ public Long getMaxSizeInMegabytes() { * @param value * The maximum size, in megabytes, of the queue. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setMaxSizeInMegabytes(Long value) { getModel().setMaxSizeInMegabytes(value); @@ -146,7 +146,7 @@ public Boolean isRequiresDuplicateDetection() { * @param value * true if duplicate message detection is required; otherwise, false. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setRequiresDuplicateDetection(Boolean value) { getModel().setRequiresDuplicateDetection(value); @@ -168,7 +168,7 @@ public Boolean isRequiresSession() { * @param value * true if the queue is session aware; otherwise, false. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setRequiresSession(Boolean value) { getModel().setRequiresSession(value); @@ -191,19 +191,31 @@ public Duration getDefaultMessageTimeToLive() { * @param value * A Duration object that represents the default message TTL. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setDefaultMessageTimeToLive(Duration value) { getModel().setDefaultMessageTimeToLive(value); return this; } + /** + * Gets the time span before auto deletion starts. + * + * @return A Duration object that represents the time span before auto deletion. + */ public Duration getAutoDeleteOnIdle() { return getModel().getAutoDeleteOnIdle(); } - public QueueInfo setAutoDeleteOnIdle(Duration duration) { - getModel().setAutoDeleteOnIdle(duration); + /** + * Sets the time span before auto deletion starts. + * + * @param autoDeleteOnIdle + * A Duration object that represents the time span before auto deletion starts. + * @return A QueueInfo object that represents the updated queue. + */ + public QueueInfo setAutoDeleteOnIdle(Duration autoDeleteOnIdle) { + getModel().setAutoDeleteOnIdle(autoDeleteOnIdle); return this; } @@ -307,6 +319,13 @@ public Long getSizeInBytes() { return getModel().getSizeInBytes(); } + /** + * Sets the size in bytes. + * + * @param sizeInBytes + * the size in bytes + * @return the queue info + */ public QueueInfo setSizeInBytes(Long sizeInBytes) { getModel().setSizeInBytes(sizeInBytes); return this; @@ -321,114 +340,265 @@ public Long getMessageCount() { return getModel().getMessageCount(); } + /** + * Sets the message count. + * + * @param messageCount + * the message count + * @return the queue info + */ public QueueInfo setMessageCount(Long messageCount) { getModel().setMessageCount(messageCount); return this; } + /** + * Sets the count details. + * + * @param countDetails + * the count details + * @return the queue info + */ public QueueInfo setCountDetails(MessageCountDetails countDetails) { getModel().setCountDetails(countDetails); return this; } + /** + * Gets the count details. + * + * @return the count details + */ public MessageCountDetails getCountDetails() { return getModel().getCountDetails(); } + /** + * Gets the authorization. + * + * @return the authorization + */ public AuthorizationRules getAuthorization() { return getModel().getAuthorizationRules(); } + /** + * Sets the authorization. + * + * @param authorizationRules + * the authorization rules + * @return the queue info + */ public QueueInfo setAuthorization(AuthorizationRules authorizationRules) { getModel().setAuthorizationRules(authorizationRules); return this; } + /** + * Checks if is anonymous accessible. + * + * @return the boolean + */ public Boolean isAnonymousAccessible() { return getModel().isIsAnonymousAccessible(); } + /** + * Sets the is anonymous accessible. + * + * @param isAnonymousAccessible + * the is anonymous accessible + * @return the queue info + */ public QueueInfo setIsAnonymousAccessible(Boolean isAnonymousAccessible) { getModel().setIsAnonymousAccessible(isAnonymousAccessible); return this; } + /** + * Checks if is support ordering. + * + * @return the boolean + */ public Boolean isSupportOrdering() { return getModel().isSupportOrdering(); } + /** + * Sets the support ordering. + * + * @param supportOrdering + * the support ordering + * @return the queue info + */ public QueueInfo setSupportOrdering(Boolean supportOrdering) { getModel().setSupportOrdering(supportOrdering); return this; } + /** + * Gets the status. + * + * @return the status + */ public EntityStatus getStatus() { return getModel().getStatus(); } + /** + * Sets the status. + * + * @param entityStatus + * the entity status + * @return the queue info + */ public QueueInfo setStatus(EntityStatus entityStatus) { getModel().setStatus(entityStatus); return this; } + /** + * Gets the entity availability status. + * + * @return the entity availability status + */ public EntityAvailabilityStatus getEntityAvailabilityStatus() { return getModel().getEntityAvailabilityStatus(); } + /** + * Sets the entity availability status. + * + * @param entityAvailabilityStatus + * the entity availability status + * @return the queue info + */ public QueueInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvailabilityStatus) { getModel().setEntityAvailabilityStatus(entityAvailabilityStatus); return this; } + /** + * Gets the forward to. + * + * @return the forward to + */ public String getForwardTo() { return getModel().getForwardTo(); } + /** + * Sets the forward to. + * + * @param forwardTo + * the forward to + * @return the queue info + */ public QueueInfo setForwardTo(String forwardTo) { getModel().setForwardTo(forwardTo); return this; } + /** + * Gets the created at. + * + * @return the created at + */ public Calendar getCreatedAt() { return getModel().getCreatedAt(); } + /** + * Sets the created at. + * + * @param createdAt + * the created at + * @return the queue info + */ public QueueInfo setCreatedAt(Calendar createdAt) { getModel().setCreatedAt(createdAt); return this; } + /** + * Gets the updated at. + * + * @return the updated at + */ public Calendar getUpdatedAt() { return getModel().getUpdatedAt(); } + /** + * Sets the updated at. + * + * @param updatedAt + * the updated at + * @return the queue info + */ public QueueInfo setUpdatedAt(Calendar updatedAt) { getModel().setUpdatedAt(updatedAt); return this; } + /** + * Gets the accessed at. + * + * @return the accessed at + */ public Calendar getAccessedAt() { return getModel().getAccessedAt(); } + /** + * Sets the accessed at. + * + * @param accessedAt + * the accessed at + * @return the queue info + */ public QueueInfo setAccessedAt(Calendar accessedAt) { getModel().setAccessedAt(accessedAt); return this; } + /** + * Gets the partitioning policy. + * + * @return the partitioning policy + */ public PartitioningPolicy getPartitioningPolicy() { return getModel().getPartitioningPolicy(); } + /** + * Sets the partitioning policy. + * + * @param partitioningPolicy + * the partitioning policy + * @return the queue info + */ public QueueInfo setPartitioningPolicy(PartitioningPolicy partitioningPolicy) { getModel().setPartitioningPolicy(partitioningPolicy); return this; } + /** + * Sets the user metadata. + * + * @return the string + */ public String setUserMetadata() { return getModel().getUserMetadata(); } + /** + * Sets the user metadata. + * + * @param userMetadata + * the user metadata + * @return the queue info + */ public QueueInfo setUserMetadata(String userMetadata) { getModel().setUserMetadata(userMetadata); return this; diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java index 6303db54332e4..2cd89c55de8de 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java @@ -47,10 +47,10 @@ private Duration createDuration(int milliSeconds) { public void testGetSetLockDuration() { // Arrange Duration expectedLockDuration = createDuration(100); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Duration actualLockDuration = QueueInfo.setLockDuration(expectedLockDuration).getLockDuration(); + Duration actualLockDuration = queueInfo.setLockDuration(expectedLockDuration).getLockDuration(); // Assert assertEquals(expectedLockDuration, actualLockDuration); @@ -61,10 +61,10 @@ public void testGetSetLockDuration() { public void testGetSetMaxSizeInMegabytes() { // Arrange Long expectedMaxSizeInMegabytes = 1024L; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Long actualMaxSizeInMegabytes = QueueInfo.setMaxSizeInMegabytes(expectedMaxSizeInMegabytes) + Long actualMaxSizeInMegabytes = queueInfo.setMaxSizeInMegabytes(expectedMaxSizeInMegabytes) .getMaxSizeInMegabytes(); // Assert @@ -76,10 +76,10 @@ public void testGetSetMaxSizeInMegabytes() { public void testGetSetRequiresDuplicateDetection() { // Arrange Boolean expectedRequiresDuplicateDetection = true; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Boolean actualRequiresDuplicateDetection = QueueInfo.setRequiresDuplicateDetection( + Boolean actualRequiresDuplicateDetection = queueInfo.setRequiresDuplicateDetection( expectedRequiresDuplicateDetection).isRequiresDuplicateDetection(); // Assert @@ -91,10 +91,10 @@ public void testGetSetRequiresDuplicateDetection() { public void testGetSetRequiresSession() { // Arrange Boolean expectedRequiresSession = true; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Boolean actualRequiresSession = QueueInfo.setRequiresSession(expectedRequiresSession).isRequiresSession(); + Boolean actualRequiresSession = queueInfo.setRequiresSession(expectedRequiresSession).isRequiresSession(); // Assert assertEquals(expectedRequiresSession, actualRequiresSession); @@ -104,10 +104,10 @@ public void testGetSetRequiresSession() { public void testGetSetDefaultMessageTimeToLive() { // Arrange Duration expectedDefaultMessageTimeToLive = createDuration(100); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Duration actualDefaultMessageTimeToLive = QueueInfo.setDefaultMessageTimeToLive( + Duration actualDefaultMessageTimeToLive = queueInfo.setDefaultMessageTimeToLive( expectedDefaultMessageTimeToLive).getDefaultMessageTimeToLive(); // Assert @@ -118,10 +118,10 @@ public void testGetSetDefaultMessageTimeToLive() { public void testGetSetDeadLetteringOnMessageExpiration() { // Arrange Boolean expectedDeadLetteringOnMessageExpiration = true; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Boolean actualDeadLetteringOnMessageExpiration = QueueInfo.setDeadLetteringOnMessageExpiration( + Boolean actualDeadLetteringOnMessageExpiration = queueInfo.setDeadLetteringOnMessageExpiration( expectedDeadLetteringOnMessageExpiration).isDeadLetteringOnMessageExpiration(); // Assert @@ -132,10 +132,10 @@ public void testGetSetDeadLetteringOnMessageExpiration() { public void testGetSetDuplicateDetectionHistoryTimeWindow() { // Arrange Duration expectedDefaultMessageTimeToLive = createDuration(100); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Duration actualDefaultMessageTimeToLive = QueueInfo.setDefaultMessageTimeToLive( + Duration actualDefaultMessageTimeToLive = queueInfo.setDefaultMessageTimeToLive( expectedDefaultMessageTimeToLive).getDefaultMessageTimeToLive(); // Assert @@ -146,10 +146,10 @@ public void testGetSetDuplicateDetectionHistoryTimeWindow() { public void testGetSetMaxDeliveryCount() { // Arrange Integer expectedMaxDeliveryCount = 1024; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Integer actualMaxDeliveryCount = QueueInfo.setMaxDeliveryCount(expectedMaxDeliveryCount).getMaxDeliveryCount(); + Integer actualMaxDeliveryCount = queueInfo.setMaxDeliveryCount(expectedMaxDeliveryCount).getMaxDeliveryCount(); // Assert assertEquals(expectedMaxDeliveryCount, actualMaxDeliveryCount); @@ -159,10 +159,10 @@ public void testGetSetMaxDeliveryCount() { public void testGetSetEnableBatchedOperations() { // Arrange Boolean expectedEnableBatchedOperations = true; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Boolean actualEnableBatchedOperations = QueueInfo.setEnableBatchedOperations(expectedEnableBatchedOperations) + Boolean actualEnableBatchedOperations = queueInfo.setEnableBatchedOperations(expectedEnableBatchedOperations) .isEnableBatchedOperations(); // Assert @@ -173,10 +173,10 @@ public void testGetSetEnableBatchedOperations() { public void testGetSetSizeInBytes() { // Arrange Long expectedSizeInBytes = 1024L; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Long actualSizeInBytes = QueueInfo.setSizeInBytes(expectedSizeInBytes).getSizeInBytes(); + Long actualSizeInBytes = queueInfo.setSizeInBytes(expectedSizeInBytes).getSizeInBytes(); // Assert assertEquals(expectedSizeInBytes, actualSizeInBytes); @@ -186,10 +186,10 @@ public void testGetSetSizeInBytes() { public void testGetSetMessageCount() { // Arrange Long expectedMessageCount = 1024L; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Long actualMessageCount = QueueInfo.setMessageCount(expectedMessageCount).getMessageCount(); + Long actualMessageCount = queueInfo.setMessageCount(expectedMessageCount).getMessageCount(); // Assert assertEquals(expectedMessageCount, actualMessageCount); @@ -199,10 +199,10 @@ public void testGetSetMessageCount() { public void testGetSetIsAnonymousAccessible() { // Arrange Boolean expectedIsAnonymousAccessible = true; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Boolean actualIsAnonymousAccessible = QueueInfo.setIsAnonymousAccessible(expectedIsAnonymousAccessible) + Boolean actualIsAnonymousAccessible = queueInfo.setIsAnonymousAccessible(expectedIsAnonymousAccessible) .isAnonymousAccessible(); // Assert @@ -213,10 +213,10 @@ public void testGetSetIsAnonymousAccessible() { public void testGetSetAuthorization() { // Arrange AuthorizationRules expectedAuthorizationRules = new AuthorizationRules(); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - AuthorizationRules actualAuthorizationRules = QueueInfo.setAuthorization(expectedAuthorizationRules) + AuthorizationRules actualAuthorizationRules = queueInfo.setAuthorization(expectedAuthorizationRules) .getAuthorization(); // Assert @@ -227,10 +227,10 @@ public void testGetSetAuthorization() { public void testGetSetStatus() { // Arrange EntityStatus expectedEntityStatus = EntityStatus.ACTIVE; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - EntityStatus actualEntityStatus = QueueInfo.setStatus(expectedEntityStatus).getStatus(); + EntityStatus actualEntityStatus = queueInfo.setStatus(expectedEntityStatus).getStatus(); // Assert assertEquals(expectedEntityStatus, actualEntityStatus); @@ -240,10 +240,10 @@ public void testGetSetStatus() { public void testGetSetForwardTo() { // Arrange String expectedForwardTo = "forwardTo"; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - String actualForwardTo = QueueInfo.setForwardTo(expectedForwardTo).getForwardTo(); + String actualForwardTo = queueInfo.setForwardTo(expectedForwardTo).getForwardTo(); // Assert assertEquals(expectedForwardTo, actualForwardTo); @@ -253,10 +253,10 @@ public void testGetSetForwardTo() { public void testGetSetCreatedAt() { // Arrange Calendar expectedCreatedAt = Calendar.getInstance(); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Calendar actualCreatedAt = QueueInfo.setCreatedAt(expectedCreatedAt).getCreatedAt(); + Calendar actualCreatedAt = queueInfo.setCreatedAt(expectedCreatedAt).getCreatedAt(); // Assert assertEquals(expectedCreatedAt, actualCreatedAt); @@ -266,10 +266,10 @@ public void testGetSetCreatedAt() { public void testGetSetUpdatedAt() { // Arrange Calendar expectedUpdatedAt = Calendar.getInstance(); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Calendar actualUpdatedAt = QueueInfo.setUpdatedAt(expectedUpdatedAt).getUpdatedAt(); + Calendar actualUpdatedAt = queueInfo.setUpdatedAt(expectedUpdatedAt).getUpdatedAt(); // Assert assertEquals(expectedUpdatedAt, actualUpdatedAt); @@ -279,10 +279,10 @@ public void testGetSetUpdatedAt() { public void testGetSetAccessedAt() { // Arrange Calendar expectedAccessedAt = Calendar.getInstance(); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Calendar actualAccessedAt = QueueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); + Calendar actualAccessedAt = queueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); // Assert assertEquals(expectedAccessedAt, actualAccessedAt); @@ -292,10 +292,10 @@ public void testGetSetAccessedAt() { public void testGetSetUserMetadata() { // Arrange Calendar expectedAccessedAt = Calendar.getInstance(); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Calendar actualAccessedAt = QueueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); + Calendar actualAccessedAt = queueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); // Assert assertEquals(expectedAccessedAt, actualAccessedAt); @@ -305,10 +305,10 @@ public void testGetSetUserMetadata() { public void testGetSetSupportOrdering() { // Arrange Boolean expectedIsSupportOrdering = true; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Boolean actualIsSupportOrdering = QueueInfo.setSupportOrdering(expectedIsSupportOrdering).isSupportOrdering(); + Boolean actualIsSupportOrdering = queueInfo.setSupportOrdering(expectedIsSupportOrdering).isSupportOrdering(); // Assert assertEquals(expectedIsSupportOrdering, actualIsSupportOrdering); @@ -318,10 +318,10 @@ public void testGetSetSupportOrdering() { public void testGetSetCountDetails() { // Arrange MessageCountDetails expectedCountDetails = new MessageCountDetails(); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - MessageCountDetails actualCountDetails = QueueInfo.setCountDetails(expectedCountDetails).getCountDetails(); + MessageCountDetails actualCountDetails = queueInfo.setCountDetails(expectedCountDetails).getCountDetails(); // Assert assertEquals(expectedCountDetails, actualCountDetails); @@ -331,10 +331,10 @@ public void testGetSetCountDetails() { public void testGetSetAutoDeleteOnIdle() { // Arrange Duration expectedIsAutoDeleteOnIdle = createDuration(100); - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - Duration actualIsAutoDeleteOnIdle = QueueInfo.setAutoDeleteOnIdle(expectedIsAutoDeleteOnIdle) + Duration actualIsAutoDeleteOnIdle = queueInfo.setAutoDeleteOnIdle(expectedIsAutoDeleteOnIdle) .getAutoDeleteOnIdle(); // Assert @@ -345,10 +345,10 @@ public void testGetSetAutoDeleteOnIdle() { public void testGetSetPartioningPolicy() { // Arrange PartitioningPolicy expectedPartitioningPolicy = PartitioningPolicy.NO_PARTITIONING; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - PartitioningPolicy actualPartitioningPolicy = QueueInfo.setPartitioningPolicy(expectedPartitioningPolicy) + PartitioningPolicy actualPartitioningPolicy = queueInfo.setPartitioningPolicy(expectedPartitioningPolicy) .getPartitioningPolicy(); // Assert @@ -359,10 +359,10 @@ public void testGetSetPartioningPolicy() { public void testGetSetEntityAvailabilityStatus() { // Arrange EntityAvailabilityStatus expectedEntityAvailabilityStatus = EntityAvailabilityStatus.AVAILABLE; - QueueInfo QueueInfo = new QueueInfo(); + QueueInfo queueInfo = new QueueInfo(); // Act - EntityAvailabilityStatus actualEntityAvailabilityStatus = QueueInfo.setEntityAvailabilityStatus( + EntityAvailabilityStatus actualEntityAvailabilityStatus = queueInfo.setEntityAvailabilityStatus( expectedEntityAvailabilityStatus).getEntityAvailabilityStatus(); // Assert From 2a601b070702a4c51e61c65e7dbebeb6cc09c1bb Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 24 Apr 2013 10:54:52 -0700 Subject: [PATCH 7/7] update queue info. --- .../services/serviceBus/models/QueueInfo.java | 92 +++++++++---------- .../serviceBus/models/QueueInfoTest.java | 6 +- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java index 07a79e8dfe5ef..5f152b54b1cfe 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfo.java @@ -35,7 +35,7 @@ public class QueueInfo extends EntryModel { /** - * Creates an instance of the Queue class. + * Creates an instance of the QueueInfo class. */ public QueueInfo() { super(new Entry(), new QueueDescription()); @@ -45,7 +45,7 @@ public QueueInfo() { } /** - * Creates an instance of the Queue class using the specified entry. + * Creates an instance of the QueueInfo class using the specified entry. * * @param entry * An Entry object. @@ -55,7 +55,7 @@ public QueueInfo(Entry entry) { } /** - * Creates an instance of the Queue class using the specified name. + * Creates an instance of the QueueInfo class using the specified name. * * @param path * A String object that represents the name of the queue. @@ -234,7 +234,7 @@ public Boolean isDeadLetteringOnMessageExpiration() { * @param value * true if dead lettering is in effect; otherwise, false. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setDeadLetteringOnMessageExpiration(Boolean value) { getModel().setDeadLetteringOnMessageExpiration(value); @@ -259,7 +259,7 @@ public Duration getDuplicateDetectionHistoryTimeWindow() { * @param value * A Duration object that represents the time span for detecting message duplication. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setDuplicateDetectionHistoryTimeWindow(Duration value) { getModel().setDuplicateDetectionHistoryTimeWindow(value); @@ -269,7 +269,7 @@ public QueueInfo setDuplicateDetectionHistoryTimeWindow(Duration value) { /** * Returns the maximum delivery count for the queue. * - * @return The maximum delivery count. + * @return An Integer object that represents the maximum delivery count. */ public Integer getMaxDeliveryCount() { return getModel().getMaxDeliveryCount(); @@ -281,7 +281,7 @@ public Integer getMaxDeliveryCount() { * @param value * The maximum delivery count for the queue. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setMaxDeliveryCount(Integer value) { getModel().setMaxDeliveryCount(value); @@ -303,7 +303,7 @@ public Boolean isEnableBatchedOperations() { * @param value * true if batch operations are enabled; otherwise, false. * - * @return A Queue object that represents the updated queue. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setEnableBatchedOperations(Boolean value) { getModel().setEnableBatchedOperations(value); @@ -313,7 +313,7 @@ public QueueInfo setEnableBatchedOperations(Boolean value) { /** * Returns the size of the queue. * - * @return The size, in bytes, of the queue. + * @return A Long object that represents the size of the queue in bytes. */ public Long getSizeInBytes() { return getModel().getSizeInBytes(); @@ -324,7 +324,7 @@ public Long getSizeInBytes() { * * @param sizeInBytes * the size in bytes - * @return the queue info + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setSizeInBytes(Long sizeInBytes) { getModel().setSizeInBytes(sizeInBytes); @@ -334,7 +334,7 @@ public QueueInfo setSizeInBytes(Long sizeInBytes) { /** * Returns the number of messages in the queue. * - * @return The number of messages in the queue. + * @return A Long object that represents the number of messages in the queue. */ public Long getMessageCount() { return getModel().getMessageCount(); @@ -345,7 +345,7 @@ public Long getMessageCount() { * * @param messageCount * the message count - * @return the queue info + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setMessageCount(Long messageCount) { getModel().setMessageCount(messageCount); @@ -356,8 +356,8 @@ public QueueInfo setMessageCount(Long messageCount) { * Sets the count details. * * @param countDetails - * the count details - * @return the queue info + * A MessageCountDetails object that contains the details of the message count. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setCountDetails(MessageCountDetails countDetails) { getModel().setCountDetails(countDetails); @@ -367,7 +367,7 @@ public QueueInfo setCountDetails(MessageCountDetails countDetails) { /** * Gets the count details. * - * @return the count details + * @return A MessageCountDetails object that contains the details of the message count. */ public MessageCountDetails getCountDetails() { return getModel().getCountDetails(); @@ -376,7 +376,7 @@ public MessageCountDetails getCountDetails() { /** * Gets the authorization. * - * @return the authorization + * @return A AuthorizationRules instance which contains the rules of the authorization. */ public AuthorizationRules getAuthorization() { return getModel().getAuthorizationRules(); @@ -387,7 +387,7 @@ public AuthorizationRules getAuthorization() { * * @param authorizationRules * the authorization rules - * @return the queue info + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setAuthorization(AuthorizationRules authorizationRules) { getModel().setAuthorizationRules(authorizationRules); @@ -397,7 +397,7 @@ public QueueInfo setAuthorization(AuthorizationRules authorizationRules) { /** * Checks if is anonymous accessible. * - * @return the boolean + * @return true if the queue can be accessed anonymously. Otherwise, false. */ public Boolean isAnonymousAccessible() { return getModel().isIsAnonymousAccessible(); @@ -408,7 +408,7 @@ public Boolean isAnonymousAccessible() { * * @param isAnonymousAccessible * the is anonymous accessible - * @return the queue info + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setIsAnonymousAccessible(Boolean isAnonymousAccessible) { getModel().setIsAnonymousAccessible(isAnonymousAccessible); @@ -418,7 +418,7 @@ public QueueInfo setIsAnonymousAccessible(Boolean isAnonymousAccessible) { /** * Checks if is support ordering. * - * @return the boolean + * @return true if ordering is supported, otherwise, false. */ public Boolean isSupportOrdering() { return getModel().isSupportOrdering(); @@ -428,8 +428,8 @@ public Boolean isSupportOrdering() { * Sets the support ordering. * * @param supportOrdering - * the support ordering - * @return the queue info + * A Boolean object represents whether the queue supports ordering. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setSupportOrdering(Boolean supportOrdering) { getModel().setSupportOrdering(supportOrdering); @@ -439,7 +439,7 @@ public QueueInfo setSupportOrdering(Boolean supportOrdering) { /** * Gets the status. * - * @return the status + * @return A EntityStatus object. */ public EntityStatus getStatus() { return getModel().getStatus(); @@ -450,7 +450,7 @@ public EntityStatus getStatus() { * * @param entityStatus * the entity status - * @return the queue info + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setStatus(EntityStatus entityStatus) { getModel().setStatus(entityStatus); @@ -460,7 +460,7 @@ public QueueInfo setStatus(EntityStatus entityStatus) { /** * Gets the entity availability status. * - * @return the entity availability status + * @return A EntityAvailabilityStatus object which represents the availability status of the entity. */ public EntityAvailabilityStatus getEntityAvailabilityStatus() { return getModel().getEntityAvailabilityStatus(); @@ -470,8 +470,8 @@ public EntityAvailabilityStatus getEntityAvailabilityStatus() { * Sets the entity availability status. * * @param entityAvailabilityStatus - * the entity availability status - * @return the queue info + * A EntityAvailabilityStatus object. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvailabilityStatus) { getModel().setEntityAvailabilityStatus(entityAvailabilityStatus); @@ -491,8 +491,8 @@ public String getForwardTo() { * Sets the forward to. * * @param forwardTo - * the forward to - * @return the queue info + * A String object represents which queue the messages will be forwarded to. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setForwardTo(String forwardTo) { getModel().setForwardTo(forwardTo); @@ -502,7 +502,7 @@ public QueueInfo setForwardTo(String forwardTo) { /** * Gets the created at. * - * @return the created at + * @return A Calendar object which represents the time of the queue created at. */ public Calendar getCreatedAt() { return getModel().getCreatedAt(); @@ -512,8 +512,8 @@ public Calendar getCreatedAt() { * Sets the created at. * * @param createdAt - * the created at - * @return the queue info + * A Calendar ojbect which represnets the time of the queue created at. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setCreatedAt(Calendar createdAt) { getModel().setCreatedAt(createdAt); @@ -523,7 +523,7 @@ public QueueInfo setCreatedAt(Calendar createdAt) { /** * Gets the updated at. * - * @return the updated at + * @return A Calendar object which represents the time that the queue was updated at. */ public Calendar getUpdatedAt() { return getModel().getUpdatedAt(); @@ -533,8 +533,8 @@ public Calendar getUpdatedAt() { * Sets the updated at. * * @param updatedAt - * the updated at - * @return the queue info + * A Calendar object which represents the time that the queue was updated at. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setUpdatedAt(Calendar updatedAt) { getModel().setUpdatedAt(updatedAt); @@ -544,7 +544,7 @@ public QueueInfo setUpdatedAt(Calendar updatedAt) { /** * Gets the accessed at. * - * @return the accessed at + * @return A Calendar object which represents the time that the queue was accessed at. */ public Calendar getAccessedAt() { return getModel().getAccessedAt(); @@ -554,8 +554,8 @@ public Calendar getAccessedAt() { * Sets the accessed at. * * @param accessedAt - * the accessed at - * @return the queue info + * A Calendar object which represents the time that the queue was accessed at. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setAccessedAt(Calendar accessedAt) { getModel().setAccessedAt(accessedAt); @@ -565,7 +565,7 @@ public QueueInfo setAccessedAt(Calendar accessedAt) { /** * Gets the partitioning policy. * - * @return the partitioning policy + * @return A PartitioningPolicy represents the partitioning policy. */ public PartitioningPolicy getPartitioningPolicy() { return getModel().getPartitioningPolicy(); @@ -575,8 +575,8 @@ public PartitioningPolicy getPartitioningPolicy() { * Sets the partitioning policy. * * @param partitioningPolicy - * the partitioning policy - * @return the queue info + * A PartitioningPolicy represents the partitioning policy. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setPartitioningPolicy(PartitioningPolicy partitioningPolicy) { getModel().setPartitioningPolicy(partitioningPolicy); @@ -584,11 +584,11 @@ public QueueInfo setPartitioningPolicy(PartitioningPolicy partitioningPolicy) { } /** - * Sets the user metadata. + * Gets the user metadata. * - * @return the string + * @return A String objects which contains the user metadata. */ - public String setUserMetadata() { + public String getUserMetadata() { return getModel().getUserMetadata(); } @@ -596,8 +596,8 @@ public String setUserMetadata() { * Sets the user metadata. * * @param userMetadata - * the user metadata - * @return the queue info + * A String objects which contains the user metadata. + * @return A QueueInfo object that represents the updated queue. */ public QueueInfo setUserMetadata(String userMetadata) { getModel().setUserMetadata(userMetadata); diff --git a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java index 2cd89c55de8de..80887432d9401 100644 --- a/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java +++ b/microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/serviceBus/models/QueueInfoTest.java @@ -291,14 +291,14 @@ public void testGetSetAccessedAt() { @Test public void testGetSetUserMetadata() { // Arrange - Calendar expectedAccessedAt = Calendar.getInstance(); + String expectedUserMetadata = "expectedUserMetaData"; QueueInfo queueInfo = new QueueInfo(); // Act - Calendar actualAccessedAt = queueInfo.setAccessedAt(expectedAccessedAt).getAccessedAt(); + String actualUserMetadata = queueInfo.setUserMetadata(expectedUserMetadata).getUserMetadata(); // Assert - assertEquals(expectedAccessedAt, actualAccessedAt); + assertEquals(expectedUserMetadata, actualUserMetadata); } @Test