Repository: camel Updated Branches: refs/heads/master 4d9ad42bf -> 82c57a965
[CAMEL-10786] Minor Azure Queue comp test and doc updates Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/82c57a96 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/82c57a96 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/82c57a96 Branch: refs/heads/master Commit: 82c57a965fb9792c2cd825662130c81f2a191813 Parents: 4d9ad42 Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Mon Feb 27 13:40:54 2017 +0000 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Mon Feb 27 13:40:54 2017 +0000 ---------------------------------------------------------------------- .../src/main/docs/azure-blob-component.adoc | 4 +-- components/camel-azure/src/main/docs/azure.adoc | 1 + .../azure/queue/QueueServiceEndpoint.java | 6 ++-- .../QueueServiceComponentConfigurationTest.java | 37 ++++++++++++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/82c57a96/components/camel-azure/src/main/docs/azure-blob-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/main/docs/azure-blob-component.adoc b/components/camel-azure/src/main/docs/azure-blob-component.adoc index 69e7629..765e25e 100644 --- a/components/camel-azure/src/main/docs/azure-blob-component.adoc +++ b/components/camel-azure/src/main/docs/azure-blob-component.adoc @@ -21,7 +21,7 @@ In most cases a blobName is required and the blob will be created if it does not You can append query options to the URI in the following format, ?options=value&option2=value&... -For example in order to download a blob content to/from the public block blob `blockBlob` +For example in order to download a blob content from the public block blob `blockBlob` located on the `container1` in the `camelazure` storage account, use the following snippet: [source,java] @@ -92,8 +92,6 @@ You have to provide the containerOrBlob name and the credentials if the private |======================================================================= |Header |Type |Description -|`CamelAwsS3BucketName` |`String` |The bucket Name which this object will be stored or which will be used for the current operation - |======================================================================= #### Message headers set by the Azure Storage Blob Service producer http://git-wip-us.apache.org/repos/asf/camel/blob/82c57a96/components/camel-azure/src/main/docs/azure.adoc ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/main/docs/azure.adoc b/components/camel-azure/src/main/docs/azure.adoc index 2054555..ea11038 100644 --- a/components/camel-azure/src/main/docs/azure.adoc +++ b/components/camel-azure/src/main/docs/azure.adoc @@ -11,4 +11,5 @@ provide connectivity to Azure services from Camel. |Azure Service |Camel Component |Camel Version | Component Description |https://azure.microsoft.com/services/storage/blobs[Storage Blob Service] |link:azure-blob.html[Azure-Blob] |2.9.0 |Supports storing and retrieving of blobs +|https://azure.microsoft.com/services/storage/queues[Storage Queue Service] |link:azure-queue.html[Azure-Queue] |2.9.0 |Supports storing and retrieving of messages in the queues |======================================================================= http://git-wip-us.apache.org/repos/asf/camel/blob/82c57a96/components/camel-azure/src/main/java/org/apache/camel/component/azure/queue/QueueServiceEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/main/java/org/apache/camel/component/azure/queue/QueueServiceEndpoint.java b/components/camel-azure/src/main/java/org/apache/camel/component/azure/queue/QueueServiceEndpoint.java index b111cd3..5173ada 100644 --- a/components/camel-azure/src/main/java/org/apache/camel/component/azure/queue/QueueServiceEndpoint.java +++ b/components/camel-azure/src/main/java/org/apache/camel/component/azure/queue/QueueServiceEndpoint.java @@ -34,16 +34,16 @@ import org.slf4j.LoggerFactory; @UriEndpoint(firstVersion = "2.19.0", scheme = "azure-queue", title = "Azure Storage Queue Service", - syntax = "azure-blob:queueOrMessageUri", + syntax = "azure-blob:containerAndQueueUri", consumerClass = QueueServiceConsumer.class, label = "cloud,queue,azure") public class QueueServiceEndpoint extends DefaultEndpoint { private static final Logger LOG = LoggerFactory.getLogger(QueueServiceEndpoint.class); - @UriPath(description = "Queue or Message compact Uri") + @UriPath(description = "Container Queue compact Uri") @Metadata(required = "true") - private String queueOrMessageUri; // to support component docs + private String containerAndQueueUri; // to support component docs @UriParam private QueueServiceConfiguration configuration; http://git-wip-us.apache.org/repos/asf/camel/blob/82c57a96/components/camel-azure/src/test/java/org/apache/camel/component/azure/queue/QueueServiceComponentConfigurationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-azure/src/test/java/org/apache/camel/component/azure/queue/QueueServiceComponentConfigurationTest.java b/components/camel-azure/src/test/java/org/apache/camel/component/azure/queue/QueueServiceComponentConfigurationTest.java index 800aebc..ac3e3c1 100644 --- a/components/camel-azure/src/test/java/org/apache/camel/component/azure/queue/QueueServiceComponentConfigurationTest.java +++ b/components/camel-azure/src/test/java/org/apache/camel/component/azure/queue/QueueServiceComponentConfigurationTest.java @@ -59,6 +59,18 @@ public class QueueServiceComponentConfigurationTest extends CamelTestSupport { doTestCreateEndpointWithMinConfig(endpoint, false); } + @Test + public void testCreateEndpointWithMaxConfig() throws Exception { + registerCredentials(); + + QueueServiceComponent component = new QueueServiceComponent(context); + QueueServiceEndpoint endpoint = + (QueueServiceEndpoint) component.createEndpoint("azure-queue://camelazure/testqueue?credentials=#creds" + + "&operation=addMessage&queuePrefix=prefix&messageTimeToLive=100&messageVisibilityDelay=10"); + + doTestCreateEndpointWithMaxConfig(endpoint, false); + } + private void doTestCreateEndpointWithMinConfig(QueueServiceEndpoint endpoint, boolean clientExpected) throws Exception { assertEquals("camelazure", endpoint.getConfiguration().getAccountName()); @@ -70,6 +82,31 @@ public class QueueServiceComponentConfigurationTest extends CamelTestSupport { assertNull(endpoint.getConfiguration().getAzureQueueClient()); assertNotNull(endpoint.getConfiguration().getCredentials()); } + assertEquals(QueueServiceOperations.listQueues, endpoint.getConfiguration().getOperation()); + + assertNull(endpoint.getConfiguration().getQueuePrefix()); + assertEquals(0, endpoint.getConfiguration().getMessageTimeToLive()); + assertEquals(0, endpoint.getConfiguration().getMessageVisibilityDelay()); + createConsumer(endpoint); + } + + private void doTestCreateEndpointWithMaxConfig(QueueServiceEndpoint endpoint, boolean clientExpected) + throws Exception { + assertEquals("camelazure", endpoint.getConfiguration().getAccountName()); + assertEquals("testqueue", endpoint.getConfiguration().getQueueName()); + if (clientExpected) { + assertNotNull(endpoint.getConfiguration().getAzureQueueClient()); + assertNull(endpoint.getConfiguration().getCredentials()); + } else { + assertNull(endpoint.getConfiguration().getAzureQueueClient()); + assertNotNull(endpoint.getConfiguration().getCredentials()); + } + assertEquals(QueueServiceOperations.addMessage, endpoint.getConfiguration().getOperation()); + + assertEquals("prefix", endpoint.getConfiguration().getQueuePrefix()); + assertEquals(100, endpoint.getConfiguration().getMessageTimeToLive()); + assertEquals(10, endpoint.getConfiguration().getMessageVisibilityDelay()); + createConsumer(endpoint); }