The JMockit Testing Toolkit Tutorial
-
Introduction
導入
- Automated developer testing and test isolation
開発者のテストの自動化とテストの分離
- Testing with mock objects
モックオブジェクトを使ったテスト
- An example
例
- Running tests with JMockit
JMockit でテストを実行する
-
Testing enterprise applications
エンタープライズアプリケーションのテスト
- An example
例
- Interface resolution
インターフェース解像度
- Trade-offs of the approach
アプローチのトレードオフ
-
Mocking
- Mocked types and instances
モック型とインスタンス
- Expectations
期待
- The record-replay-verify model
記録・再生・検証モデル
- Instantiation and injection of tested classes
テスト対象のクラスのインスタンス化と注入
- Recording results for an expectation
期待の結果を記録する
- Flexible matching of argument values
引数値の柔軟なマッチング
- Specifying invocation count constraints
呼び出し回数の制約を指定する
- Explicit verification
明示的な検証
- Delegates: specifying custom results
デリゲート: カスタム結果の指定
- Capturing invocation arguments for verification
検証のための呼び出し引数のキャプチャ
- Cascading mocks
カスケードモック
- Matching invocations to specific instances
特定のインスタンスへの呼び出しのマッチング
- Partial mocking
部分的な嘲笑
- Mocking unspecified implementation classes
未指定の実装クラスのモック
-
Faking
- Fake methods and fake classes
偽のメソッドと偽のクラス
- Applying fake classes
偽のクラスを適用する
- Faking unspecified implementation classes
未指定の実装クラスを偽装する
- Faking class initializers
クラス初期化子の偽装
- Accessing the invocation context
呼び出しコンテキストへのアクセス
- Proceeding into the real implementation
実際の実装に進む
- Reusing fakes between tests
テスト間で偽物を再利用する
- Global fakes
世界的な偽物
- Applying AOP-style advice
AOPスタイルのアドバイスを適用する
-
Measuring code coverage
- The coverage metric
カバレッジメトリック
- Types of coverage output
カバレッジ出力の種類
- Configuring the coverage tool
カバレッジツールの設定
- Aggregated reports for multiple test runs
複数のテスト実行の集計レポート
- Checking minimum coverage
最低限の補償範囲の確認
- Activating coverage in a Maven project
Maven プロジェクトでカバレッジを有効にする
- Turning coverage off
カバレッジをオフにする