Eclipse
測試框架分析
基于
PDE
運行時的參數設定如下:
Eclipse.buildId=unknown
java.version=1.4.2
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN
Framework arguments:
?
-version 3
-application org.eclipse.pde.junit.runtime.coretestapplication
-testApplication org.softme.triones.runtime.framework
-pdelaunch
-port 3655
-testpluginname org.softme.triones.runtime
-classnames org.softme.triones.runtime.TrionesRuntimeAllTests
Command-line arguments:
?
-version 3
-application org.eclipse.pde.junit.runtime.coretestapplication
-testApplication org.softme.triones.runtime.framework
-data D:\netshop\runtime-test-workspace
-dev file:D:/netshop/sources/.metadata/.plugins/org.eclipse.pde.core/Trionse Runtime Test/dev.properties
-pdelaunch -os win32 -ws win32 -arch x86 -nl zh_CN -clean
-debug -consolelog
-port 3655
-testpluginname org.softme.triones.runtime
-classnames org.softme.triones.runtime.TrionesRuntimeAllTests
?
由參數配置可以看出,
Eclipse PDE
中插件測試實際上是啟動了
org.eclipse.pde.junit.runtime.coretestapplication
這個應用,而被測試的應用通過參數
–testApplication
指定,運行的參數通過
–dev file:…./dev.properties
來指定。我們先分析一下
dev.properties
文件:
org.softme.triones.runtime=bin
org.softme.triones.sdk=bin
org.eclipse.osgi=bin
org.softme.triones.hello=bin
com.opensymphony=bin
org.softme.triones.turbine=bin
這里配置需要加載的工作區插件和
class
路徑。