directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [directory-fortress-core] branch jmeter-add-case updated: + option to update following add
Date Thu, 01 Oct 2020 15:59:36 GMT
This is an automated email from the ASF dual-hosted git repository.

smckinney pushed a commit to branch jmeter-add-case
in repository https://gitbox.apache.org/repos/asf/directory-fortress-core.git


The following commit(s) were added to refs/heads/jmeter-add-case by this push:
     new 8ac242d  + option to update following add
8ac242d is described below

commit 8ac242d18e5bb59e029a9b72048c8014a1af1fe1
Author: Shawn McKinney <smckinney@symas.com>
AuthorDate: Thu Oct 1 10:59:29 2020 -0500

    + option to update following add
---
 pom.xml                                                        |  1 +
 .../org/apache/directory/fortress/core/jmeter/AddUser.java     |  6 ++++++
 .../org/apache/directory/fortress/core/jmeter/UserBase.java    | 10 ++++++++++
 src/test/jmeter/ftAddUser.jmx                                  |  5 +++++
 4 files changed, 22 insertions(+)

diff --git a/pom.xml b/pom.xml
index 9fc1c07..f973555 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1224,6 +1224,7 @@
                 <qualifier>${qualifier}</qualifier>
                 <verify>${verify}</verify>
                 <output>${output}</output>
+                <update>${update}</update>
                 <sleep>${sleep}</sleep>
               </propertiesSystem>
             </configuration>
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java b/src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java
index 57b81c4..56e5b8e 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java
@@ -55,6 +55,12 @@ public class AddUser extends UserBase
             write( "threadid: " + getThreadId() + ", userId: " + userId );
             User outUser = adminMgr.addUser( user );
             assertNotNull( outUser );
+            if( update )
+            {
+                user.setDescription( "updated: " + user.getUserId() );
+                outUser = adminMgr.updateUser( user );
+            }
+            assertNotNull( outUser );
             if ( verify )
             {
                 assertTrue( verify( userId, Op.ADD ) );
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/UserBase.java b/src/test/java/org/apache/directory/fortress/core/jmeter/UserBase.java
index 6687064..33b88c5 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/UserBase.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/UserBase.java
@@ -55,6 +55,7 @@ public abstract class UserBase extends AbstractJavaSamplerClient
     private String filename;
     protected boolean verify = false;
     protected boolean output = false;
+    protected boolean update = false;
     protected int sleep = 0;
     private PrintWriter printWriter;
 
@@ -145,6 +146,15 @@ public abstract class UserBase extends AbstractJavaSamplerClient
         {
             output = szLog.equalsIgnoreCase( "true" );
         }
+        String szUpdate = System.getProperty( "update" );
+        if (StringUtils.isEmpty( szUpdate ))
+        {
+            update = samplerContext.getParameter( "update" ).equalsIgnoreCase( "true" );
+        }
+        else
+        {
+            update = szVerify.equalsIgnoreCase( "true" );
+        }
         String szSleep = System.getProperty( "sleep" );
         if (StringUtils.isEmpty( szSleep ))
         {
diff --git a/src/test/jmeter/ftAddUser.jmx b/src/test/jmeter/ftAddUser.jmx
index 72d5926..c11c693 100644
--- a/src/test/jmeter/ftAddUser.jmx
+++ b/src/test/jmeter/ftAddUser.jmx
@@ -77,6 +77,11 @@
                 <stringProp name="Argument.value">false</stringProp>
                 <stringProp name="Argument.metadata">=</stringProp>
               </elementProp>
+              <elementProp name="update" elementType="Argument">
+                <stringProp name="Argument.name">update</stringProp>
+                <stringProp name="Argument.value">true</stringProp>
+                <stringProp name="Argument.metadata">=</stringProp>
+              </elementProp>
               <elementProp name="sleep" elementType="Argument">
                 <stringProp name="Argument.name">sleep</stringProp>
                 <stringProp name="Argument.value">5</stringProp>


Mime
View raw message