setlocal enabledelayedexpansion
set JAVA_HOME=D:\Program Files (x86)\Java\jdk1.6.0_30
set PATH=%JAVA_HOME%/bin;%PATH%
set MY_HOME=.
echo %MY_HOME%
set LIBPATH=%MY_HOME%/lib
echo %LIBPATH%
set _classpath=%MY_HOME%/conf
set LIB_DEPLOY_CLASSPATH=".;%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar"
set LIB_DEPLOY_CLASSPATH=%LIB_DEPLOY_CLASSPATH%;%_classpath%
for %%i in (%LIBPATH%\*.jar) do set LIB_DEPLOY_CLASSPATH=!LIB_DEPLOY_CLASSPATH!;%%i
echo %LIB_DEPLOY_CLASSPATH%
java -Dfile.encoding=GBK -Dclient.encoding.override=GBK -classpath %LIB_DEPLOY_CLASSPATH% org.testng.TestNG testng.xml
該腳本仿照dubbo官方給出的測試項目中的start.sh改寫的,依次是:
設(shè)置java home稻据,
設(shè)置path艾猜,
設(shè)置項目目錄,
設(shè)置lib包所在目錄捻悯,
設(shè)置conf配置文件所在目錄
設(shè)置運行時classtpath:javahome下jar包匆赃,conf下配置文件,lib下所有jar包
啟動