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: jmeter del user test case
Date Wed, 16 Sep 2020 16:14:07 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 db3ba75  jmeter del user test case
db3ba75 is described below

commit db3ba75b7e4fae51882b521d24c6814e279c163c
Author: Shawn McKinney <smckinney@symas.com>
AuthorDate: Wed Sep 16 11:14:01 2020 -0500

    jmeter del user test case
---
 pom.xml                                            | 60 ++++++++++++++++++++++
 .../directory/fortress/core/jmeter/AddUser.java    |  3 +-
 .../core/jmeter/{AddUser.java => DelUser.java}     | 14 ++---
 src/test/jmeter/ftAddUser.jmx                      |  2 +-
 src/test/jmeter/{ftAddUser.jmx => ftDelUser.jmx}   |  6 +--
 5 files changed, 70 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9f9f7af..5a1f9b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1270,6 +1270,66 @@
       </build>
     </profile>
 
+    <!-- This profile starts Fortress core checkAccess loadTest -->
+    <!-- To execute: mvn -Ploadtest-fortress-deluser jmeter:jmeter -->
+    <profile>
+      <id>loadtest-fortress-deluser</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>com.lazerycode.jmeter</groupId>
+            <artifactId>jmeter-maven-plugin</artifactId>
+            <version>1.10.0</version>
+            <configuration>
+              <overrideRootLogLevel>DEBUG</overrideRootLogLevel>
+              <suppressJMeterOutput>false</suppressJMeterOutput>
+              <testFilesIncluded>
+                <jMeterTestFile>ftDelUser.jmx</jMeterTestFile>
+              </testFilesIncluded>
+              <propertiesSystem>
+                <version>${project.version}</version>
+              </propertiesSystem>
+              <propertiesSystem>
+                <tenant>${tenant}</tenant>
+              </propertiesSystem>
+            </configuration>
+            <executions>
+              <execution>
+                <id>jmeter-tests</id>
+                <goals>
+                  <goal>jmeter</goal>
+                </goals>
+              </execution>
+            </executions>
+            <dependencies>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.directory.fortress</groupId>
+                <artifactId>fortress-core</artifactId>
+                <version>${project.version}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.directory.fortress</groupId>
+                <artifactId>fortress-core</artifactId>
+                <type>test-jar</type>
+                <version>${project.version}</version>
+              </dependency>
+            </dependencies>
+          </plugin>
+
+        </plugins>
+      </build>
+    </profile>
+
     <!-- This profile calls ant target init-slapd in build-config.xml script. -->
     <!-- To execute: mvn -Pinit-slapd test -->
     <profile>
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 9bed581..68256a0 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
@@ -19,7 +19,6 @@
  */
 package org.apache.directory.fortress.core.jmeter;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.*;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
@@ -137,7 +136,7 @@ public class AddUser extends AbstractJavaSamplerClient
      */
     public void teardownTest( JavaSamplerContext samplerContext )
     {
-        String message = "FT SETUP CreateSession TID: " + getThreadId();
+        String message = "FT SETUP AddUser TID: " + getThreadId();
         LOG.info( message );
         System.out.println( message );
     }
diff --git a/src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java b/src/test/java/org/apache/directory/fortress/core/jmeter/DelUser.java
similarity index 90%
copy from src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java
copy to src/test/java/org/apache/directory/fortress/core/jmeter/DelUser.java
index 9bed581..f78107c 100644
--- a/src/test/java/org/apache/directory/fortress/core/jmeter/AddUser.java
+++ b/src/test/java/org/apache/directory/fortress/core/jmeter/DelUser.java
@@ -19,7 +19,6 @@
  */
 package org.apache.directory.fortress.core.jmeter;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.directory.fortress.core.*;
 import org.apache.directory.fortress.core.SecurityException;
 import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
@@ -38,10 +37,10 @@ import static org.junit.Assert.*;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddUser extends AbstractJavaSamplerClient
+public class DelUser extends AbstractJavaSamplerClient
 {
     private AdminMgr adminMgr;
-    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger( AddUser.class );
+    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger( DelUser.class );
     private static int count = 0;
     private int key = 0;
     private int ctr = 0;
@@ -60,7 +59,7 @@ public class AddUser extends AbstractJavaSamplerClient
         try
         {
             sampleResult.sampleStart();
-            String message = "FT AddUser TID: " + getThreadId() + " UID:" + userId + " CTR:"
+ ctr++;
+            String message = "FT DelUser TID: " + getThreadId() + " UID:" + userId + " CTR:"
+ ctr++;
             LOG.info( message );
             //System.out.println( message );
             assertNotNull( adminMgr );
@@ -72,10 +71,7 @@ public class AddUser extends AbstractJavaSamplerClient
             User user = new User();
             // positive test case:
             user.setUserId( userId );
-            user.setPassword( "secret" );
-            user.setOu( "dev0");
-            User outUser = adminMgr.addUser( user );
-            assertNotNull( outUser );
+            adminMgr.deleteUser( user );
             sampleResult.sampleEnd();
             sampleResult.setBytes(1);
             sampleResult.setResponseMessage("test completed TID: " + getThreadId() + " UID:
" + userId);
@@ -137,7 +133,7 @@ public class AddUser extends AbstractJavaSamplerClient
      */
     public void teardownTest( JavaSamplerContext samplerContext )
     {
-        String message = "FT SETUP CreateSession TID: " + getThreadId();
+        String message = "FT SETUP DelUser TID: " + getThreadId();
         LOG.info( message );
         System.out.println( message );
     }
diff --git a/src/test/jmeter/ftAddUser.jmx b/src/test/jmeter/ftAddUser.jmx
index ef41bdb..849727c 100644
--- a/src/test/jmeter/ftAddUser.jmx
+++ b/src/test/jmeter/ftAddUser.jmx
@@ -47,7 +47,7 @@
 
           <stringProp name="LoopController.loops">10</stringProp>
         </elementProp>
-        <stringProp name="ThreadGroup.num_threads">10</stringProp>
+        <stringProp name="ThreadGroup.num_threads">2</stringProp>
         <stringProp name="ThreadGroup.ramp_time">10</stringProp>
         <boolProp name="ThreadGroup.scheduler">false</boolProp>
         <stringProp name="ThreadGroup.duration"></stringProp>
diff --git a/src/test/jmeter/ftAddUser.jmx b/src/test/jmeter/ftDelUser.jmx
similarity index 96%
copy from src/test/jmeter/ftAddUser.jmx
copy to src/test/jmeter/ftDelUser.jmx
index ef41bdb..a94ca26 100644
--- a/src/test/jmeter/ftAddUser.jmx
+++ b/src/test/jmeter/ftDelUser.jmx
@@ -32,7 +32,7 @@
       <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set
Config" enabled="false">
         <stringProp name="delimiter">,</stringProp>
         <stringProp name="fileEncoding"></stringProp>
-        <stringProp name="filename">AddUser.csv</stringProp>
+        <stringProp name="filename">DelUser.csv</stringProp>
         <boolProp name="quotedData">false</boolProp>
         <boolProp name="recycle">true</boolProp>
         <stringProp name="shareMode">shareMode.all</stringProp>
@@ -47,7 +47,7 @@
 
           <stringProp name="LoopController.loops">10</stringProp>
         </elementProp>
-        <stringProp name="ThreadGroup.num_threads">10</stringProp>
+        <stringProp name="ThreadGroup.num_threads">2</stringProp>
         <stringProp name="ThreadGroup.ramp_time">10</stringProp>
         <boolProp name="ThreadGroup.scheduler">false</boolProp>
         <stringProp name="ThreadGroup.duration"></stringProp>
@@ -64,7 +64,7 @@
               </elementProp>
             </collectionProp>
           </elementProp>
-          <stringProp name="classname">org.apache.directory.fortress.core.jmeter.AddUser</stringProp>
+          <stringProp name="classname">org.apache.directory.fortress.core.jmeter.DelUser</stringProp>
         </JavaSampler>
         <hashTree/>
         <ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary
Report" enabled="true">


Mime
View raw message