Eclipse Pluginの自動テストの方法
- test用のPluginを落とす
- http://www.eclipse.org/downloads/index.phpから「ByProject」→「Platform」→「LatestDownload」の「LatestRelease」→「JUnit Plugin Tests and Automated Testing Framework」の「eclipse-test-framework-ver.zip」を落とす。
- セットアップ
- コマンドプロンプトを立ち上げテスト用のEclipse環境へcdする。
- 以下のコマンドを実行する。下記のコマンドはコマンドプロンプト上で起動しますが、改行は必要ありません。coretestapplicationはUIを使わない場合のテストです。uitestapplicationはUIを使う場合のテストです。RCPアプリケーションの場合は-testapplicationで対象のアプリケーションIDを指定してください。指定しない場合はeclipseが起動します。
java -classpath startup.jar org.eclipse.core.launcher.Main -consolelog -application org.eclipse.test.[coretestapplication || uitestapplication] -classname テストクラス名 -testpluginname テスト対象のプラグイン -testapplication テスト対象のアプリケーションID formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter