Jmeter性能测试之进阶BeanShell的使用
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 }
兴趣是最好的老师,知识改变格局,转载请注明出处!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步