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: still working on output file
Date Mon, 21 Sep 2020 16:40:53 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 2593361  still working on output file
2593361 is described below

commit 25933618d11c1337723c5bdb6661aa7e59c97d38
Author: Shawn McKinney <smckinney@symas.com>
AuthorDate: Mon Sep 21 11:40:46 2020 -0500

    still working on output file
---
 .../directory/fortress/core/jmeter/UserBase.java   | 37 ++++++++--------------
 1 file changed, 14 insertions(+), 23 deletions(-)

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 b6a116b..c2209a8 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
@@ -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.directory.fortress.core.model.User;
@@ -85,6 +84,17 @@ public abstract class UserBase extends AbstractJavaSamplerClient
         return found;
     }
 
+    private void init()
+    {
+        hostname = System.getProperty( "hostname" );
+        System.setProperty( "fortress.host", hostname );
+        qualifier = System.getProperty( "qualifier" );
+        filename = "operations" + '-' + "thread" + getThreadId() + '-' + hostname + '-' +
qualifier + ".txt";
+        String szVerify = System.getProperty( "verify" );
+        verify = szVerify.equalsIgnoreCase( "true" );
+        open();
+    }
+
     /**
      * Description of the Method
      *
@@ -92,30 +102,10 @@ public abstract class UserBase extends AbstractJavaSamplerClient
      */
     public void setupTest( JavaSamplerContext samplerContext )
     {
-        hostname = System.getProperty( "hostname" );
-        if (StringUtils.isEmpty( hostname ))
-        {
-            hostname = samplerContext.getParameter( "hostname" );
-        }
-        System.setProperty( "fortress.host", hostname );
-        qualifier = System.getProperty( "qualifier" );
-        if (StringUtils.isEmpty( qualifier ))
-        {
-            qualifier = samplerContext.getParameter( "qualifier" );
-        }
-        filename = "operations" + '-' + hostname + '-' + qualifier + ".txt";
-        String szVerify = System.getProperty( "verify" );
-        if (StringUtils.isEmpty( szVerify ))
-        {
-            verify = samplerContext.getParameter( "verify" ).equalsIgnoreCase( "true" );
-        }
-        else
-        {
-            verify = szVerify.equalsIgnoreCase( "true" );
-        }
         String message = "FT SETUP User TID: " + getThreadId() + ", hostname: " + hostname
+ ", qualifier: " + qualifier + ", verify:" + verify;
         log( message );
         System.out.println( message );
+        init();
         try
         {
             adminMgr = AdminMgrFactory.createInstance( TestUtils.getContext() );
@@ -149,6 +139,7 @@ public abstract class UserBase extends AbstractJavaSamplerClient
     {
         return ++count;
     }
+
     String getThreadId()
     {
         return "" + Thread.currentThread().getId();
@@ -184,7 +175,7 @@ public abstract class UserBase extends AbstractJavaSamplerClient
         printWriter.close();
     }
 
-    protected synchronized void write( String message )
+    protected void write( String message )
     {
         printWriter.printf("%s\n", message);
         printWriter.flush();


Mime
View raw message