Eclipse 4.7 - 4.18 向けは、 こちら をクリック
djunitの最新バージョンは 0.9.1 です
はじめに
Eclipse version 3.7から4.6で動作するdjUnit pluginを公開しています。
java8やjava11でのdjUnitテストが実行可能です。
新しいEclipseやJava runtime でdjUnitを動作させたい場合に利用してください。
GitHub
URL | https://github.com/girigiri-safe/djunit_plugin_for_eclipse_3.7-4.6 |
ダウンロード
version 0.9.1
ダウンロード
jarファイル | djunit-0.9.1.jar |
updatesite.zip | djunit-0.9.1-eclipse3.7.x-updatesite.zip |
アップデートサイト
URL | https://girigiri-safe.github.io/djunit_plugin_for_eclipse_3.7-4.6/updatesite/0.9.1/ |
Mavenリポジトリ
URL | https://girigiri-safe.github.io/djunit-maven-repo/ |
動作確認済のEclipseバージョン
eclipseバージョン | コードネーム |
---|---|
3.7 | Indigo |
4.2 | Juno |
4.3 | Kepler |
4.4 | Luna |
4.5 | Mars |
4.6 | Neon |
ASMのバージョン
実行環境に応じてASMのバージョンを切り替えて実行してください
ASMバージョン | ASMがサポートするjava | 動作するJREのバージョン |
---|---|---|
5.2 | java8まで | 1.5以上 |
9.1 | java17まで | 7以上 |
VSCodeのJava Test RunnerでdjUnitを実行する方法
djUnit 0.9.1から、VSCodeのJava Test RunnerでdjUnitを実行することができます。
以下を参考に設定してください。
.vscode/settings.json
{
...
"java.test.config": {
"name": "run test with djunit.",
"workingDirectory": "${workspaceFolder}",
"args": [],
"vmArgs": [
"-Djava.system.class.loader=jp.co.dgic.testing.common.DJUnitClassLoader" ,
"-Ddjunit.virtualmock.enable=true",
"-Ddjunit.asm.version=ASM9",
"-Ddjunit.target.src.dir=${workspaceFolder}/src/main/java"
],
"sourcePaths": ["${workspaceFolder}/src/main/java"]
},
...
}
Maven Surefire PluginでdjUnitを実行する方法
djUnit 0.9.1から、Maven Surefire PluginでdjUnitを実行することができます。
以下を参考に設定してください。
settings.xml または pom.xml
<repositories>
<repository>
<id>djunit.repository</id>
<name>djUnit repository</name>
<url>https://girigiri-safe.github.io/djunit-maven-repo/</url>
</repository>
</repositories>
<dependencies>
...
<dependency>
<groupId>jp.co.pmtech</groupId>
<artifactId>djunit</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>jp.co.pmtech</groupId>
<artifactId>djunit-asm</artifactId>
<version>9.1</version>
</dependency>
...
</dependencies>
<build>
<pluginManagement>
<plugins>
...
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>...</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
<argLine>-Djava.system.class.loader=jp.co.dgic.testing.common.DJUnitClassLoader -Ddjunit.coverage.enable=true -Ddjunit.virtualmock.enable=true -Ddjunit.asm.version=ASM9 -Ddjunit.target.src.dir=${project.basedir}\src\main\java</argLine>
</configuration>
</plugin>
...
</plugins>
</pluginManagement>
</build>
JVM引数について
VSCodeやMavenでdjUnitを実行するときは、以下のJVM引数を設定してください。
VM引数 | 設定値 | デフォルト値 | 必須 |
---|---|---|---|
java.system.class.loader | jp.co.dgic.testing.common.DJUnitClassLoader | Yes | |
djunit.virtualmock.enable | true | Yes | |
djunit.asm.version | ASM9 or ASM5 | ASM9 | No |
djunit.target.src.dir | path to your source folder | Yes |
リリースノート
version 0.9.1
Jar File Download
djunit-0.9.1.jarUpdatesite.zip
djunit-0.9.1-eclipse3.7.x-updatesite.zipversion 0.9.0
Jar File Download
djunit-0.9.0.jarUpdatesite.zip
djunit-0.9.0-eclipse3.7.x-updatesite.zipversion 0.8.6
Jar File Download
djunit-0.8.6.jarUpdatesite.zip
djunit-0.8.6-eclipse3.7.x-updatesite.zip