You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2023/04/13 21:47:12 UTC

[qpid-protonj2] branch main updated: PROTON-2711 Add single value API for setting source or target properties

This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git


The following commit(s) were added to refs/heads/main by this push:
     new 8885fbbd PROTON-2711 Add single value API for setting source or target properties
8885fbbd is described below

commit 8885fbbde71b923a1a36fe7e2971b754e838e7fd
Author: Timothy Bish <ta...@gmail.com>
AuthorDate: Thu Apr 13 17:43:48 2023 -0400

    PROTON-2711 Add single value API for setting source or target properties
    
    Allows for simple test setup when setting a source or target property
    that doesn't require creating the map instance.
---
 .../test/driver/actions/AttachInjectAction.java    | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/actions/AttachInjectAction.java b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/actions/AttachInjectAction.java
index 081fa8c6..2ced891c 100644
--- a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/actions/AttachInjectAction.java
+++ b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/actions/AttachInjectAction.java
@@ -417,6 +417,19 @@ public class AttachInjectAction extends AbstractPerformativeInjectAction<Attach>
             return this;
         }
 
+        public SourceBuilder withDynamicNodeProperty(String key, Object value) {
+            return withDynamicNodeProperty(Symbol.valueOf(key), value);
+        }
+
+        public SourceBuilder withDynamicNodeProperty(Symbol key, Object value) {
+            if (source.getDynamicNodeProperties() == null) {
+                source.setDynamicNodeProperties(new LinkedHashMap<>());
+            }
+
+            source.getDynamicNodeProperties().put(key, value);
+            return this;
+        }
+
         public SourceBuilder withDistributionMode(String mode) {
             source.setDistributionMode(Symbol.valueOf(mode));
             return this;
@@ -437,6 +450,19 @@ public class AttachInjectAction extends AbstractPerformativeInjectAction<Attach>
             return this;
         }
 
+        public SourceBuilder withFilterMap(String key, Object value) {
+            return withFilterMap(Symbol.valueOf(key), value);
+        }
+
+        public SourceBuilder withFilterMap(Symbol key, Object value) {
+            if (source.getFilter() == null) {
+                source.setFilter(new LinkedHashMap<>());
+            }
+
+            source.getFilter().put(key, value);
+            return this;
+        }
+
         public SourceBuilder withDefaultOutcome(Outcome outcome) {
             source.setDefaultOutcome((DescribedType) outcome);
             return this;
@@ -521,6 +547,19 @@ public class AttachInjectAction extends AbstractPerformativeInjectAction<Attach>
             return this;
         }
 
+        public TargetBuilder withDynamicNodeProperty(String key, Object value) {
+            return withDynamicNodeProperty(Symbol.valueOf(key), value);
+        }
+
+        public TargetBuilder withDynamicNodeProperty(Symbol key, Object value) {
+            if (target.getDynamicNodeProperties() == null) {
+                target.setDynamicNodeProperties(new LinkedHashMap<>());
+            }
+
+            target.getDynamicNodeProperties().put(key, value);
+            return this;
+        }
+
         public TargetBuilder withCapabilities(String... capabilities) {
             target.setCapabilities(TypeMapper.toSymbolArray(capabilities));
             return this;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org