码迷,mamicode.com
首页 > 系统相关 > 详细

Jmeter性能测试之进阶BeanShell的使用

时间:2018-10-20 22:15:45      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:bean   pat   src   str   ted   inf   location   ima   cat   

BeanShell 最常用的用法

写好Java代码打成jar, 放到目录\lib\ext下面

 1 package com.test;
 2 
 3 import java.io.File;
 4 import java.io.UnsupportedEncodingException;
 5 
 6 public class Common {
 7     public static String getPath(){
 8         String path = Common.class.getProtectionDomain().getCodeSource().getLocation().getFile();
 9         try {
10             path = java.net.URLDecoder.decode(path, "UTF-8");
11         } catch (UnsupportedEncodingException e) {
12             e.printStackTrace();
13         }
14         String jarPath = new File(path).getParentFile().getAbsolutePath();
15         return jarPath;
16     }
17 }

技术分享图片

技术分享图片

 

Jmeter性能测试之进阶BeanShell的使用

标签:bean   pat   src   str   ted   inf   location   ima   cat   

原文地址:https://www.cnblogs.com/andrew209/p/9823010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!