Skip to content
Permalink
Browse files
+ option to update following add
  • Loading branch information
shawnmckinney committed Oct 1, 2020
1 parent 8d474a5 commit 8ac242d18e5bb59e029a9b72048c8014a1af1fe1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
@@ -1224,6 +1224,7 @@
<qualifier>${qualifier}</qualifier>
<verify>${verify}</verify>
<output>${output}</output>
<update>${update}</update>
<sleep>${sleep}</sleep>
</propertiesSystem>
</configuration>
@@ -55,6 +55,12 @@ public SampleResult runTest( JavaSamplerContext samplerContext )
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 ) );
@@ -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 @@ private void init( JavaSamplerContext samplerContext )
{
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 ))
{
@@ -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>

0 comments on commit 8ac242d

Please sign in to comment.