You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "GOODBOY008 (via GitHub)" <gi...@apache.org> on 2026/04/22 09:42:13 UTC
Re: [I] [Proposal] Refactor Unit Tests with Modern Testing Patterns [fesod]
GOODBOY008 commented on issue #717:
URL: https://github.com/apache/fesod/issues/717#issuecomment-4295167509
## Phase 1 & 2 Implementation: PR #901
PR [#901](https://github.com/apache/fesod/pull/901) implements the testkit infrastructure (Phase 1) and the initial batch of test migrations (Phase 2) described in this proposal.
### What was delivered
#### Testkit Infrastructure (`testkit/` package)
```
testkit/
├── base/
│ └── AbstractExcelTest.java # @TempDir, format providers, round-trip helpers
├── enums/
│ ├── ExcelFormat.java # XLSX/XLS/CSV with capability metadata + ExcelTypeEnum bridge
│ └── ApiMode.java # FILE / STREAM
├── listeners/
│ └── CollectingReadListener.java # Generic data collector — no embedded assertions
├── assertions/
│ ├── ExcelAssertions.java
│ ├── WorkbookAssert.java
│ ├── SheetAssert.java
│ ├── RowAssert.java
│ └── CellAssert.java
├── helpers/
│ └── RoundTripHelper.java # write→read helpers for File and Stream API modes
└── builders/
└── TestDataBuilder.java # shared factory methods replacing per-class data()
```
#### Package Reorganization
Legacy packages reorganized into:
| New Package | Contents |
|---|---|
| `core/` | `ClassUtils` tests, `NoModel` tests, repetition tests |
| `format/` | Date format, BOM, charset, CSV format tests |
| `readwrite/` | Simple data, extra data, sort, encrypt, exception, cache, skip tests |
| `sheet/` | Hidden sheets, sheet name, extra data (sheet-level) |
| `style/` | Annotation style, fill, style tests |
| `converter/` | Expanded: cell data, exclude/include, extra data, sort tests added |
#### Deprecated / Removed
- 25+ listener classes with embedded `Assertions.*` calls removed
- `@TestMethodOrder` + `t01`/`t02`/`t03` naming convention eliminated in migrated classes
- `TestFileUtil.createNewFile()` replaced by `@TempDir`
### Metrics (Phase 1+2)
| Metric | Before | After |
|---|---|---|
| Listener classes | 25+ | 1 (`CollectingReadListener`) |
| Per-format test method copies | 3× | 1× (parameterized) |
| Lines of test code | ~6,960 deleted | ~5,901 added |
### Migration Status
| Phase | Scope | Status |
|---|---|---|
| Phase 1 | Testkit Infrastructure | ✅ PR #901 |
| Phase 2 | converter/, core/, format/, readwrite/, sheet/, style/ | ✅ PR #901 |
| Phase 3 | fill/, head/ (remaining) | 🔲 Future |
| Phase 4 | template/, annotation/ | 🔲 Future |
| Phase 5 | Remaining packages | 🔲 Future |
| Phase 6 | Legacy cleanup | 🔲 Future |
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org