mike-neckのブログ

Java or Groovy or Swift or Golang

2017-01-01から1日間の記事一覧

JUnit5入門(3) - アノテーション

前回の続き JUnit4同様、JUnit5ではテストのメタ情報や、実行制御はアノテーションを介して行われる。今回はそのアノテーションをまとめる。 JUnit5が提供するアノテーション一覧 アノテーション 役割 説明 @Test メタ情報 付与されたメソッドがテストである…

JUnit5入門(2) - アサーション

前回 の続き 今回は値の比較、アサーションについて。 JUnit5が提供するアサーション JUnit5はJUnit4とほぼ同等のAssertion機能を提供している。また、より高度なAssertionを求める場合は、サードパーティライブラリーの利用を勧めている。 JUnit5のAssertio…

How to run test class whose name doesn't end with Test in JUnit5 with Gradle.

JUnit5 publishes junit-platform-gradle-plugin. With it you can run JUnit5 tests with gradle. But if you don't give Test at the end of the test class name, this plugin ignores to run it. If you want to run a test classes whose name don't en…

JUnit5入門(1) - テストクラスの作成とテストの実行

年末にかけてJUnit5(junit-jupiter)をいじったのでまとめ。 使い方的な話はQiitaにある記事のほうが詳しいかもしれない… qiita.com qiita.com qiita.com qiita.com JUnit5ライブラリーの導入 テストコンパイルスコープにjunit-jupiter-api、テストランタイム…

DateTimeFormatterのパターンとLocale

Junit5の ParameterResolver によってテストメソッドのパラメーターに渡せる日付文字列の形式をユーザーが自由に決められるようにするために、 DateTimeFormatter を使っていた際に、どうしても月のパターン MMM によって月が名前(例えば1月なら Jan)になら…