You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/07/23 16:30:00 UTC
[jira] [Work logged] (WW-5462) Restructure com.opensymphony.xwork2.mock (org.apache.struts2.mock)
[ https://issues.apache.org/jira/browse/WW-5462?focusedWorklogId=1031897&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1031897 ]
ASF GitHub Bot logged work on WW-5462:
--------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jul/26 16:29
Start Date: 23/Jul/26 16:29
Worklog Time Spent: 10m
Work Description: lukaszlenart opened a new pull request, #1809:
URL: https://github.com/apache/struts/pull/1809
Fixes [WW-5462](https://issues.apache.org/jira/browse/WW-5462)
Removes the test-only `org.apache.struts2.mock` package from the published `struts2-core` jar.
## Changes
- **`core/pom.xml`**: attaches a filtered `test-jar` containing only `org/apache/struts2/mock/**` (with `<archive combine.self="override"/>` so it gets a default manifest instead of the main jar's OSGi manifest)
- **Six plugin poms** (json, rest, spring, xslt, jasperreports, jasperreports7): consume the test-jar as a `<type>test-jar</type>` test-scope dependency
- **`MockContainer`**: deleted — zero references anywhere in the codebase
- **5 mock classes** (`MockActionInvocation`, `MockActionProxy`, `MockInterceptor`, `MockObjectTypeDeterminer`, `MockResult`): moved as pure renames from `core/src/main/java` to `core/src/test/java` — package unchanged, so no import edits anywhere
- **spring plugin**: dropped its byte-identical local copy of `DummyTextProvider`
## Notes
- **Breaking change (7.3.0)**: downstream projects using these mocks in their own tests must switch to `struts2-junit-plugin`, Mockito, or copy the needed class. Release notes need a migration note. The attached `-tests.jar` is internal build plumbing, not supported API (deliberately not in the bom).
- Dev-build caveat: in unpackaged reactor runs (`mvn test`), Maven resolves the test-jar dep to core's `target/test-classes` directory (filter applies only at packaging); verified green in both modes. CI's `mvn verify` exercises the packaged/filtered path.
- Design/plan docs included under `docs/superpowers/`.
## Verification
- Full reactor `mvn test -DskipAssembly`: core 2997 + plugins (spring 61, junit 12, jasperreports 9, jasperreports7 12, json 163, rest 118, xslt 17) — all green
- `mvn clean install -Pjakartaee11 -DskipAssembly`: green
- `struts2-core-*-tests.jar` contains only the 8 mock classes, default manifest; main jar no longer contains the package
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Issue Time Tracking
-------------------
Worklog Id: (was: 1031897)
Remaining Estimate: 0h
Time Spent: 10m
> Restructure com.opensymphony.xwork2.mock (org.apache.struts2.mock)
> ------------------------------------------------------------------
>
> Key: WW-5462
> URL: https://issues.apache.org/jira/browse/WW-5462
> Project: Struts 2
> Issue Type: Improvement
> Components: Core
> Reporter: Lukasz Lenart
> Priority: Trivial
> Fix For: 7.3.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Classes of this package are used in tests only or never, move everything into {{src/test/java}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)