Eclipse 測(cè)試框架分析 基于 PDE 運(yùn)行時(shí)的參數(shù)設(shè)定如下: 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
由參數(shù)配置可以看出, Eclipse PDE 中插件測(cè)試實(shí)際上是啟動(dòng)了 org.eclipse.pde.junit.runtime.coretestapplication 這個(gè)應(yīng)用,而被測(cè)試的應(yīng)用通過(guò)參數(shù) –testApplication 指定,運(yùn)行的參數(shù)通過(guò) –dev file:…./dev.properties 來(lái)指定。我們先分析一下 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 這里配置需要加載的工作區(qū)插件和 class 路徑。 |
通過(guò)對(duì)Eclipse測(cè)試框架的研究,發(fā)現(xiàn)目前無(wú)法支持Triones框架的測(cè)試環(huán)境要求:
“測(cè)試框架由
org.eclipse.test
插件和
org.eclipse.ant.optional.junit
段組成。
上面這兩個(gè)工程可以從
dev.eclipse.org
資源庫(kù)獲取并且已經(jīng)包含在
eclipse-Automated-Tests.<buildid>.zip
文件中,可以從
eclipse.org
下載頁(yè)面下載。
測(cè)試框架的當(dāng)前版本并不能與 PDE 集成環(huán)境兼容。如果你希望運(yùn)行測(cè)試,那么你需要安裝一套完整的目標(biāo) Eclipse 環(huán)境以便于測(cè)試框架能夠檢測(cè)所有需要的內(nèi)容。如果你準(zhǔn)備為一個(gè)或多個(gè) Eclipse 插件編寫測(cè)試,那么你需要?jiǎng)?chuàng)建一個(gè)專門用于測(cè)試的獨(dú)立的插件。這個(gè)測(cè)試插件將包含針對(duì)你正在開(kāi)發(fā)的插件的所有測(cè)試,同時(shí)也定義了這些測(cè)試的運(yùn)行方式。”
這樣的情況下,必須重新考慮Triones框架的設(shè)計(jì)了。
不得窺道門,不得悟佛門,不得入窄門,實(shí)乃破門。