Skip to content
Permalink
Browse files
loop == 1 op
  • Loading branch information
shawnmckinney committed Feb 28, 2021
1 parent 540fa92 commit 7358d38f87ef2e9cff4c6d45a25e89780deda0da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
@@ -44,7 +44,6 @@ public class AddUser extends UserBase
*/
public SampleResult runTest( JavaSamplerContext samplerContext )
{
int opCtr = 0;
String userId = hostname + '-' + qualifier + '-' + getKey();
SampleResult sampleResult = new SampleResult();
try
@@ -57,24 +56,20 @@ public SampleResult runTest( JavaSamplerContext samplerContext )
user.setOu( ou );
write( "threadid: " + getThreadId() + ", userId: " + userId );
User outUser = adminMgr.addUser( user );
opCtr++;
assertNotNull( outUser );
if( update )
{
user.setDescription( "updated: " + user.getUserId() );
outUser = adminMgr.updateUser( user );
opCtr++;
}
if(StringUtil.isNotEmpty( role ) )
{
adminMgr.assignUser( new UserRole( user.getUserId(), role ));
opCtr++;
}
assertNotNull( outUser );
if ( verify )
{
assertTrue( verify( userId, Op.ADD ) );
opCtr++;
}
if( sleep > 0 )
{
@@ -87,7 +82,7 @@ public SampleResult runTest( JavaSamplerContext samplerContext )
Thread.currentThread().interrupt();
}
}
sampleResult.setSampleCount( opCtr );
sampleResult.setSampleCount( 1 );
sampleResult.sampleEnd();
sampleResult.setBytes(1);
sampleResult.setResponseMessage("test completed TID: " + getThreadId() + " UID: " + userId);
@@ -43,7 +43,6 @@ public class CheckUser extends UserBase
*/
public SampleResult runTest( JavaSamplerContext samplerContext )
{
int opCtr = 0;
String userId = hostname + '-' + qualifier + '-' + getKey();
SampleResult sampleResult = new SampleResult();
try
@@ -60,13 +59,11 @@ public SampleResult runTest( JavaSamplerContext samplerContext )
}
// This method performs both an ldap bind and a search:
Session session = accessMgr.createSession( user, false );
opCtr+=2;
assertNotNull( session );
if ( verify )
{
// perform an ldap 'read':
assertTrue( verify( userId, Op.CHECK ) );
opCtr++;
}
if(StringUtil.isNotEmpty( perm ) )
{
@@ -81,7 +78,6 @@ public SampleResult runTest( JavaSamplerContext samplerContext )
p.setOpName( perm.substring( indx + 1 ) + i );
// This method performs an ldap 'read':
accessMgr.checkAccess( session, p );
opCtr++;
}
}
}
@@ -97,7 +93,7 @@ public SampleResult runTest( JavaSamplerContext samplerContext )
Thread.currentThread().interrupt();
}
}
sampleResult.setSampleCount( opCtr );
sampleResult.setSampleCount( 1 );
sampleResult.sampleEnd();
sampleResult.setBytes(1);
sampleResult.setResponseMessage("test completed TID: " + getThreadId() + " UID: " + userId);

0 comments on commit 7358d38

Please sign in to comment.