Skip to content

refactor: テストデータパーサーをTemplate Methodパターンで整理 - #75

Draft
kiyotis wants to merge 14 commits into
developfrom
convert-testdata-excel-to-text
Draft

refactor: テストデータパーサーをTemplate Methodパターンで整理#75
kiyotis wants to merge 14 commits into
developfrom
convert-testdata-excel-to-text

Conversation

@kiyotis

@kiyotis kiyotis commented May 15, 2026

Copy link
Copy Markdown

概要

NTFのテストデータ読み込み機構をリファクタリングし、パーサー間の重複を解消した。

変更内容

ソースコード

  • Template Methodパターンの導入 (TestDataParsingTemplate)
    ListMapParserTableDataParser に重複していたキャッシュ処理を抽象基底クラスに集約

  • DataFileParser の整理
    各パーサーの責務を明確化し、テストデータ解析フローを統一

ドキュメント(docs/pr75/docs/

  • testdata-converter-design.md — 変換ツール設計書
  • ntf-testdata-loading.md — テストデータ読み込み機構の解説
  • ntf-testdata-doc.md / ntf-testdata-doc-examples-*.md — NTFテストデータ解説書

テスト結果

  • mvn clean test(Java 17 + Maven 3.9.9): 840件 Failures:0 Errors:0
  • 既知スキップ 7件・既知4E(MockHttpRequestTest / MockServletExecutionContextTest)は PR75 非起因

@kiyotis kiyotis changed the title ExcelテストデータのYAML代替スキーマ設計 feat: NTF テストデータ YAML 実装(YamlTestDataParser TDD・トレーサビリティマトリクス145件) May 27, 2026
@kiyotis
kiyotis force-pushed the convert-testdata-excel-to-text branch 2 times, most recently from 7efc1ed to 2818ffb Compare June 16, 2026 06:47
@kiyotis
kiyotis changed the base branch from main to develop June 22, 2026 06:27
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kiyotis
kiyotis force-pushed the convert-testdata-excel-to-text branch from d5bd33f to d799c0a Compare June 23, 2026 08:26
kiyotis and others added 9 commits June 23, 2026 18:29
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
設計書・NTF解説書・仕様リストの不整合を実装コードを正として修正。

設計書 (testdata-converter-design.md):
- TestDataFormatReader#read シグネチャを read(basePath, resourceName) に修正
- ConverterMojo を FormatHandler/ConversionRequest 等の実際の構成に差し替え
- TestCoreReaderAdapter の追加メソッド (readSendSyncMessages/readHeaders/readBlockBodyLines) を追記
- YamlTestCoreAdapter に isResourceExisting を追記
- TestDataBlock のフィールド (dataType/groupId/identifier) をクラス図に追記
- FileDataBlock の FileType enum をクラス図に追記
- YamlTestDataValidator/ValidationError を OUT 節に追記
- 重複していた「依存の向き」ブロックを削除

NTF解説書 examples:
- ntf-testdata-doc-examples-messaging.md: directives: を records: 内から
  エントリ直下(records: と同階層)へ移動、record_type を DEFAULT → default に統一
- ntf-testdata-doc-examples-file.md 6.2節: type を英字記号 (X/N/Z) から
  日本語型名称 (半角/全角/数値) に修正

仕様リスト (ntf-impl-spec-list.md):
- テストメソッド名の test プレフィックスを全件除去(実装は test プレフィックスなし)
- RS-20 テストメソッド名: noFwHeader → noFwHeaderFragment に修正
- RS-12/RS-20 実装マッピング: extractFwHeader → convertFwHeader に修正
- SS-22: 未実装テストを — に修正
- SS-05: テストクラスを YamlTableDataBuilderTest → YamlTestDataParserTest に修正
- MS-01/MS-04: テストメソッドのプレースホルダーを実際のメソッド名に修正

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
送信同期メッセージ(要求/応答電文 4 種)の判定ロジックを DataType enum の
インスタンスメソッドとして集約した。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kiyotis kiyotis changed the title feat: NTF テストデータ YAML 実装(YamlTestDataParser TDD・トレーサビリティマトリクス145件) refactor: テストデータパーサーをTemplate Methodパターンで整理 Jun 25, 2026
kiyotis and others added 3 commits August 5, 2026 12:54
nablarch-testing-yaml 側でテストメソッド名の仕様ID依存を除去したため、
仕様一覧の参照をリネーム後のメソッド名(10件)に合わせる。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant