修改 builder
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.sunyard.sydapi.loadrunner;
|
||||
|
||||
import com.sunyard.sydapi.loadrunner.action1.Actions;
|
||||
import racal.sunyard.main.SydApi4j;
|
||||
import racal.sunyard.main.SydApiBuilder;
|
||||
|
||||
@@ -37,15 +38,15 @@ public class ShangTest {
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
|
||||
public static void main(String[] args) throws Throwable {
|
||||
|
||||
|
||||
System.out.println( SydApi4j.getVersion() );
|
||||
|
||||
ShangTest test = new ShangTest();
|
||||
Actions test = new Actions();
|
||||
test.init();
|
||||
test.hash4();
|
||||
test.destroy();
|
||||
test.action();
|
||||
test.end();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.sunyard.sydapi.loadrunner.action1;
|
||||
|
||||
/*
|
||||
* LoadRunner Java script. (Build: _build_number_)
|
||||
*
|
||||
* Script Description:
|
||||
*
|
||||
*/
|
||||
import racal.sunyard.main.SydApi4j;
|
||||
import racal.sunyard.main.SydApiBuilder;
|
||||
|
||||
public class Actions
|
||||
{
|
||||
|
||||
private static final byte[] testData = new byte[ 4 * 1024 ];
|
||||
|
||||
private SydApi4j api = null;
|
||||
|
||||
public int init() throws Throwable {
|
||||
api = (SydApi4j) new SydApiBuilder()
|
||||
.setIp("172.16.18.59")
|
||||
.setPort( 8889 )
|
||||
.useDebugMode()
|
||||
.build();
|
||||
return 0;
|
||||
}//end of init
|
||||
|
||||
|
||||
public int action() throws Throwable {
|
||||
api.SM3Hash( testData );
|
||||
return 0;
|
||||
}//end of action
|
||||
|
||||
|
||||
public int end() throws Throwable {
|
||||
if (null != this.api ) {
|
||||
this.api.disconnect();
|
||||
}
|
||||
return 0;
|
||||
}//end of end
|
||||
}
|
||||
Reference in New Issue
Block a user