diff --git a/core/pom.xml b/core/pom.xml index 6509b6a422..6fdfabfce4 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -66,6 +66,24 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + mock-test-jar + + test-jar + + + + + org/apache/struts2/mock/** + + + + + com.cj.jshintmojo jshint-maven-plugin diff --git a/core/src/main/java/org/apache/struts2/mock/MockContainer.java b/core/src/main/java/org/apache/struts2/mock/MockContainer.java deleted file mode 100644 index a03ec2d678..0000000000 --- a/core/src/main/java/org/apache/struts2/mock/MockContainer.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.struts2.mock; - -import org.apache.struts2.inject.Container; -import org.apache.struts2.inject.Scope; - -import java.util.Set; - -/** - * Mock implementation to be used in unittests - */ -public class MockContainer implements Container { - - public void inject(Object o) { - - } - - public T inject(Class implementation) { - return null; - } - - public T getInstance(Class type, String name) { - return null; - } - - public T getInstance(Class type) { - return null; - } - - public Set getInstanceNames(Class type) { - return null; - } - - public void setScopeStrategy(Scope.Strategy scopeStrategy) { - - } - - public void removeScopeStrategy() { - - } - - @Override - public void destroy() { - // no-op in mock - } - -} diff --git a/core/src/main/java/org/apache/struts2/mock/package.html b/core/src/main/java/org/apache/struts2/mock/package.html deleted file mode 100644 index fafd91c66d..0000000000 --- a/core/src/main/java/org/apache/struts2/mock/package.html +++ /dev/null @@ -1,21 +0,0 @@ - -XWork specific mock classes. diff --git a/core/src/main/java/org/apache/struts2/mock/MockActionInvocation.java b/core/src/test/java/org/apache/struts2/mock/MockActionInvocation.java similarity index 100% rename from core/src/main/java/org/apache/struts2/mock/MockActionInvocation.java rename to core/src/test/java/org/apache/struts2/mock/MockActionInvocation.java diff --git a/core/src/main/java/org/apache/struts2/mock/MockActionProxy.java b/core/src/test/java/org/apache/struts2/mock/MockActionProxy.java similarity index 100% rename from core/src/main/java/org/apache/struts2/mock/MockActionProxy.java rename to core/src/test/java/org/apache/struts2/mock/MockActionProxy.java diff --git a/core/src/main/java/org/apache/struts2/mock/MockInterceptor.java b/core/src/test/java/org/apache/struts2/mock/MockInterceptor.java similarity index 100% rename from core/src/main/java/org/apache/struts2/mock/MockInterceptor.java rename to core/src/test/java/org/apache/struts2/mock/MockInterceptor.java diff --git a/core/src/main/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java b/core/src/test/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java similarity index 100% rename from core/src/main/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java rename to core/src/test/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java diff --git a/core/src/main/java/org/apache/struts2/mock/MockResult.java b/core/src/test/java/org/apache/struts2/mock/MockResult.java similarity index 100% rename from core/src/main/java/org/apache/struts2/mock/MockResult.java rename to core/src/test/java/org/apache/struts2/mock/MockResult.java diff --git a/docs/superpowers/plans/2026-07-23-WW-5462-mock-package-test-jar.md b/docs/superpowers/plans/2026-07-23-WW-5462-mock-package-test-jar.md new file mode 100644 index 0000000000..ed59234334 --- /dev/null +++ b/docs/superpowers/plans/2026-07-23-WW-5462-mock-package-test-jar.md @@ -0,0 +1,285 @@ +# WW-5462 Mock Package Test-Jar Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Remove the test-only `org.apache.struts2.mock` package from the published `struts2-core` jar by moving it to test sources and sharing it with plugin tests via a filtered test-jar. + +**Architecture:** Core attaches a `maven-jar-plugin` test-jar containing only `org/apache/struts2/mock/**`. Six plugins consume it as a test-scoped `test-jar` dependency. Tasks are ordered so every commit leaves the full reactor green: pom plumbing first (mocks still in main sources), the move last. + +**Tech Stack:** Java 17, Maven multi-module reactor, maven-jar-plugin `test-jar` goal. + +**Spec:** `docs/superpowers/specs/2026-07-23-WW-5462-mock-package-test-jar-design.md` + +## Global Constraints + +- Branch: `WW-5462-mock-package-cleanup` (already exists; work there, never on `main`) +- Every commit message starts with `WW-5462` followed by conventional-commit type (see `~/.claude/commit_guideline.md`) +- Package name `org.apache.struts2.mock` never changes — no import edits anywhere +- The bom (`bom/pom.xml`) must NOT gain a test-jar entry +- Test-jar includes filter is exactly `org/apache/struts2/mock/**` +- No new files other than pom edits; this is a move/delete change + +## Known Risk (check in Task 2, Step 3) + +When the reactor runs without packaging (`mvn test`), Maven's `ReactorReader` resolves the +test-jar dependency to core's whole `target/test-classes` directory — the includes filter +applies only when the jar is physically packaged. Core's test resources (`struts.xml`, +`struts.properties`, `struts-tests-default.xml`, `log4j2.xml`) then appear on plugin test +classpaths. Plugins `json`, `rest`, `xslt`, `jasperreports` have no own root `struts.xml` +to shadow core's. If Task 2's verification shows plugin test failures caused by leaked core +test resources, STOP and report back — the fallback options (renaming core's clashing test +resources, or copying mocks into plugins instead of the test-jar) need a human decision. + +--- + +### Task 1: Attach filtered test-jar in core + +**Files:** +- Modify: `core/pom.xml` (the `` section starting at line 39) + +**Interfaces:** +- Consumes: nothing from other tasks +- Produces: attached artifact `org.apache.struts:struts2-core:test-jar` (classifier `tests`), containing only `org/apache/struts2/mock/**`. Task 2 depends on these exact coordinates. + +Background for the implementer: the root `pom.xml` (line ~467) configures `maven-jar-plugin` +with `` pointing at the OSGi manifest that the felix bundle plugin +generates for the **main** jar. The test-jar must not inherit that manifest, hence the +`` below, which resets the inherited `` config +so the test-jar gets a default manifest. + +- [ ] **Step 1: Add the test-jar execution** + +In `core/pom.xml`, inside ``, add as a new `` entry directly after the closing tag of the `maven-surefire-plugin` entry (after line 68): + +```xml + + org.apache.maven.plugins + maven-jar-plugin + + + mock-test-jar + + test-jar + + + + + org/apache/struts2/mock/** + + + + + +``` + +- [ ] **Step 2: Package core and verify the build passes** + +Run: +```bash +mvn package -DskipTests -DskipAssembly -pl core +``` +Expected: `BUILD SUCCESS`, and the log contains `maven-jar-plugin:...:test-jar (mock-test-jar) @ struts2-core` followed by `Building jar: .../core/target/struts2-core-7.2.0-SNAPSHOT-tests.jar`. + +- [ ] **Step 3: Verify test-jar contents** + +Run: +```bash +unzip -l core/target/struts2-core-*-tests.jar +``` +Expected: entries only under `META-INF/` and `org/apache/struts2/mock/`. At this point the mock package in test sources holds exactly 3 classes, so the class list is: +`DummyTextProvider.class`, `InjectableAction.class`, `MockLazyInterceptor.class` (plus any inner/anonymous class files of these). NO other packages, NO `struts.xml`, NO `*.properties`. + +- [ ] **Step 4: Verify the test-jar manifest is not the OSGi bundle manifest** + +Run: +```bash +unzip -p core/target/struts2-core-*-tests.jar META-INF/MANIFEST.MF | head -20 +``` +Expected: a plain default manifest (`Manifest-Version`, `Created-By`, `Build-Jdk-Spec`). It must NOT contain `Export-Package` or `Bundle-SymbolicName`. + +- [ ] **Step 5: Commit** + +```bash +git add core/pom.xml +git commit -m "WW-5462 build(core): attach test-jar with the mock package" +``` + +--- + +### Task 2: Wire the six consuming plugins + +**Files:** +- Modify: `plugins/json/pom.xml` +- Modify: `plugins/rest/pom.xml` +- Modify: `plugins/spring/pom.xml` +- Modify: `plugins/xslt/pom.xml` +- Modify: `plugins/jasperreports/pom.xml` +- Modify: `plugins/jasperreports7/pom.xml` + +**Interfaces:** +- Consumes: the `struts2-core` test-jar artifact attached in Task 1 +- Produces: plugin test classpaths that resolve `org.apache.struts2.mock` from the test-jar; Task 3 relies on this to move the mocks without breaking plugin builds + +- [ ] **Step 1: Add the test-jar dependency to all six plugin poms** + +In each of the six poms listed above, inside the `` section, add this block immediately before the first `test` dependency (each pom has a ``-style boundary; json's is at line 63 — place it right after that comment where present, otherwise before the junit dependency): + +```xml + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + +``` + +The block is identical in all six poms. `${project.version}` is correct because all modules share the reactor version; the bom must not be touched. + +- [ ] **Step 2: Verify the six plugins build and pass with the new dependency** + +Run: +```bash +mvn test -DskipAssembly -am -pl plugins/json,plugins/rest,plugins/spring,plugins/xslt,plugins/jasperreports,plugins/jasperreports7 +``` +Expected: `BUILD SUCCESS`; all plugin tests pass. The mocks still resolve from core's main classes at this point, so this proves only that the added dependency is well-formed and harmless. + +- [ ] **Step 3: Check for the known risk — core test-resource leakage** + +The Step 2 run used unpackaged reactor resolution, i.e. plugin test classpaths contained core's whole `target/test-classes` (see "Known Risk" above). Examine the Step 2 output: +- All tests pass → risk is benign, continue. +- Any plugin test failure that does not occur on `main` → STOP. Re-run that plugin's tests on `main` to confirm the regression is caused by this change, then report back with the failing tests and the leaked-resource explanation. Do not improvise a fix. + +- [ ] **Step 4: Commit** + +```bash +git add plugins/json/pom.xml plugins/rest/pom.xml plugins/spring/pom.xml plugins/xslt/pom.xml plugins/jasperreports/pom.xml plugins/jasperreports7/pom.xml +git commit -m "WW-5462 build(plugins): consume struts2-core test-jar in tests" +``` + +--- + +### Task 3: Delete MockContainer, move the five remaining mocks + +**Files:** +- Delete: `core/src/main/java/org/apache/struts2/mock/MockContainer.java` +- Move: `core/src/main/java/org/apache/struts2/mock/MockActionInvocation.java` → `core/src/test/java/org/apache/struts2/mock/MockActionInvocation.java` +- Move: `core/src/main/java/org/apache/struts2/mock/MockActionProxy.java` → `core/src/test/java/org/apache/struts2/mock/MockActionProxy.java` +- Move: `core/src/main/java/org/apache/struts2/mock/MockInterceptor.java` → `core/src/test/java/org/apache/struts2/mock/MockInterceptor.java` +- Move: `core/src/main/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java` → `core/src/test/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java` +- Move: `core/src/main/java/org/apache/struts2/mock/MockResult.java` → `core/src/test/java/org/apache/struts2/mock/MockResult.java` + +**Interfaces:** +- Consumes: test-jar packaging (Task 1) and plugin wiring (Task 2) — both must be committed first, or this task breaks plugin builds +- Produces: `struts2-core` main jar without `org.apache.struts2.mock`; test-jar now carries all 8 mock classes + +- [ ] **Step 1: Delete the dead class and move the five live ones** + +```bash +git rm core/src/main/java/org/apache/struts2/mock/MockContainer.java +git mv core/src/main/java/org/apache/struts2/mock/MockActionInvocation.java core/src/test/java/org/apache/struts2/mock/ +git mv core/src/main/java/org/apache/struts2/mock/MockActionProxy.java core/src/test/java/org/apache/struts2/mock/ +git mv core/src/main/java/org/apache/struts2/mock/MockInterceptor.java core/src/test/java/org/apache/struts2/mock/ +git mv core/src/main/java/org/apache/struts2/mock/MockObjectTypeDeterminer.java core/src/test/java/org/apache/struts2/mock/ +git mv core/src/main/java/org/apache/struts2/mock/MockResult.java core/src/test/java/org/apache/struts2/mock/ +``` + +Then confirm the main-side package directory is gone: +```bash +ls core/src/main/java/org/apache/struts2/mock/ 2>&1 +``` +Expected: `No such file or directory`. + +No source edits: the package declaration stays `org.apache.struts2.mock`, so no imports change anywhere. + +- [ ] **Step 2: Run core tests** + +Run: +```bash +mvn test -DskipAssembly -pl core +``` +Expected: `BUILD SUCCESS`, same test count as on `main` (the ~50 core test classes using the mocks compile against test sources now). + +- [ ] **Step 3: Verify jar contents after the move** + +Run: +```bash +mvn package -DskipTests -DskipAssembly -pl core +unzip -l core/target/struts2-core-7.2.0-SNAPSHOT.jar | grep 'struts2/mock' ; echo "main-jar grep exit: $?" +unzip -l core/target/struts2-core-7.2.0-SNAPSHOT-tests.jar | grep -c 'struts2/mock/.*\.class' +``` +Expected: main-jar grep exit code `1` (no mock package in the published jar); tests-jar contains `8` classes — the 5 moved + `DummyTextProvider`, `InjectableAction`, `MockLazyInterceptor` (count may exceed 8 only if inner-class files exist; there must be exactly 8 top-level `*.class` names). + +- [ ] **Step 4: Verify plugin tests still pass against the moved mocks** + +Run: +```bash +mvn test -DskipAssembly -am -pl plugins/json,plugins/rest,plugins/spring,plugins/xslt,plugins/jasperreports,plugins/jasperreports7 +``` +Expected: `BUILD SUCCESS`, all tests pass — mocks now come from core's test classpath contribution. + +- [ ] **Step 5: Commit** + +```bash +git add -A core/src +git commit -m "WW-5462 refactor(core): move mock package to test sources, drop unused MockContainer + +BREAKING CHANGE: org.apache.struts2.mock is no longer part of the +published struts2-core jar. Downstream tests should use +struts2-junit-plugin, Mockito, or a local copy of the needed mock." +``` + +--- + +### Task 4: Remove spring's duplicate mock and run full verification + +**Files:** +- Delete: `plugins/spring/src/test/java/org/apache/struts2/mock/DummyTextProvider.java` + +**Interfaces:** +- Consumes: test-jar wiring from Task 2 (spring resolves `DummyTextProvider` from core's test-jar instead of its local copy) +- Produces: final verified state of the branch + +- [ ] **Step 1: Delete the duplicate** + +```bash +git rm plugins/spring/src/test/java/org/apache/struts2/mock/DummyTextProvider.java +``` + +Same package and class name ship in the core test-jar, so `plugins/spring/src/test/java/org/apache/struts2/spring/SpringObjectFactoryTest.java` (its only consumer, import at line 39) needs no edit. + +- [ ] **Step 2: Run spring plugin tests** + +Run: +```bash +mvn test -DskipAssembly -am -pl plugins/spring +``` +Expected: `BUILD SUCCESS`, all tests pass. + +- [ ] **Step 3: Full reactor test run** + +Run: +```bash +mvn test -DskipAssembly +``` +Expected: `BUILD SUCCESS` — every module compiles and passes. + +- [ ] **Step 4: Jakarta EE 11 profile sanity check** + +Run: +```bash +mvn clean install -Pjakartaee11 -DskipAssembly +``` +Expected: `BUILD SUCCESS`. (This also re-verifies the packaged-jar path: with `install`, plugins resolve the real filtered test-jar, not the test-classes directory.) + +- [ ] **Step 5: Commit** + +```bash +git add -A plugins/spring +git commit -m "WW-5462 test(spring): use DummyTextProvider from core test-jar" +``` + +- [ ] **Step 6: Remind the user about the release-notes migration note** + +Tell the user (do not attempt to do this yourself — it is a Jira/Confluence action, not a repo change): +> The 7.3.0 release notes need a migration note: `org.apache.struts2.mock` was removed from the struts2-core jar (WW-5462); downstream tests should switch to struts2-junit-plugin, Mockito, or copy the needed mock class. diff --git a/docs/superpowers/specs/2026-07-23-WW-5462-mock-package-test-jar-design.md b/docs/superpowers/specs/2026-07-23-WW-5462-mock-package-test-jar-design.md new file mode 100644 index 0000000000..48175aad00 --- /dev/null +++ b/docs/superpowers/specs/2026-07-23-WW-5462-mock-package-test-jar-design.md @@ -0,0 +1,133 @@ +# WW-5462: Move `org.apache.struts2.mock` out of the published struts2-core jar + +- **Ticket**: [WW-5462](https://issues.apache.org/jira/browse/WW-5462) +- **Date**: 2026-07-23 +- **Status**: Approved design +- **Fix version**: 7.3.0 + +## Problem + +Six mock classes live in `core/src/main/java/org/apache/struts2/mock/` and ship in the +published `struts2-core` jar, yet nothing in production code references them — they are +used only by tests (core's own tests plus the json, rest, spring, xslt, jasperreports, +and jasperreports7 plugin tests). One of them is referenced by nothing at all. Test-only +code in the public jar inflates the supported API surface for no benefit. + +The `com.opensymphony.xwork2.mock` package named in the ticket no longer exists; it was +migrated to `org.apache.struts2.mock` in 7.0. + +## Decision summary + +| Decision | Choice | +|---|---| +| Compatibility | Remove from the main jar in 7.3.0; note in release notes (no deprecation cycle) | +| Sharing mechanism | Filtered `test-jar` attached by core, consumed test-scope by plugins | +| Shared `mocks` module | Rejected — mocks implement core interfaces, so a module would create a reactor dependency cycle (`mocks → core` compile, `core → mocks` test); Maven rejects cycles regardless of scope | +| `MockContainer` | Delete — zero references anywhere in the codebase | + +## Design + +### 1. Delete dead code + +Delete `core/src/main/java/org/apache/struts2/mock/MockContainer.java`. No references +exist in core, plugins, or apps. + +### 2. Move the remaining five mocks + +Move from `core/src/main/java/org/apache/struts2/mock/` to +`core/src/test/java/org/apache/struts2/mock/`: + +- `MockActionInvocation` +- `MockActionProxy` +- `MockInterceptor` +- `MockObjectTypeDeterminer` +- `MockResult` + +They join the three mocks already in test sources (`DummyTextProvider`, +`InjectableAction`, `MockLazyInterceptor`). The package name is unchanged, so no core +test file needs an import change. + +### 3. Attach a filtered test-jar from core + +In `core/pom.xml`, add a `maven-jar-plugin` execution: + +```xml + + + test-jar + + + + + org/apache/struts2/mock/** + + + +``` + +The `` resets the `` configuration +inherited from the root pom, which points at the OSGi manifest generated for the main jar; +without it the test-jar would carry the main bundle's manifest. + +**Dev-build caveat:** when the reactor runs without packaging (`mvn test -DskipAssembly`), +Maven resolves the test-jar dependency to core's whole `target/test-classes` directory — +the includes filter applies only to the packaged jar. Plugin test classpaths then also see +core's other test classes and test resources (`struts.xml`, `struts.properties`). This is +verified empirically during implementation; packaged builds (`mvn package`/`install`) always +use the filtered jar. + +The includes filter is essential: it keeps core's other test classes and test resources +(`struts.xml` variants, test properties) off plugin test classpaths, where they would +conflict with plugin test configuration. The resulting +`struts2-core--tests.jar` contains only the mock package (all eight classes). + +This artifact is internal build plumbing. It is deployed alongside the main artifact as +Maven attaches it by default, but it is not added to the bom and not documented as +supported API. + +### 4. Wire the six consuming plugins + +Add to the poms of `json`, `rest`, `spring`, `xslt`, `jasperreports`, and +`jasperreports7`: + +```xml + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + +``` + +`test-jar` (not `tests`) is Maven's recommended +form for reactor builds. The version is declared inline with `${project.version}` +because the bom stays free of internal test artifacts. + +### 5. Remove the spring plugin's duplicate + +Delete `plugins/spring/src/test/java/org/apache/struts2/mock/DummyTextProvider.java`. +The test-jar provides the canonical copy from core's test sources. No import changes +are needed — same package, same class name. + +## Compatibility + +Downstream projects that use these mocks in their own tests will fail to compile +against 7.3.0. This is accepted (Trivial-priority cleanup; the classes were never +intended as public API). Release notes must include a migration note: use +`struts2-junit-plugin`, Mockito, or copy the needed class into your own test sources. + +## Out of scope + +- Extracting a core `api` module to enable a supported, standalone mocks artifact +- Any change to the three mocks already in core test sources beyond packaging +- Renaming or refactoring the mock classes themselves + +## Verification + +1. `mvn test -DskipAssembly` — full reactor: core and all six plugins compile and pass. +2. `mvn clean install -Pjakartaee11` — Jakarta EE 11 profile sanity check. +3. Inspect `core/target/struts2-core-*-tests.jar` — contains only + `org/apache/struts2/mock/**` (eight classes), no test resources. +4. Inspect `core/target/struts2-core-*.jar` — contains no `org/apache/struts2/mock` + package. diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml index 2c90d5fca2..2ca28481a9 100644 --- a/plugins/jasperreports/pom.xml +++ b/plugins/jasperreports/pom.xml @@ -53,6 +53,15 @@ + + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + + org.apache.struts struts2-junit-plugin diff --git a/plugins/jasperreports7/pom.xml b/plugins/jasperreports7/pom.xml index 3e0095f762..f6126f64d5 100644 --- a/plugins/jasperreports7/pom.xml +++ b/plugins/jasperreports7/pom.xml @@ -63,6 +63,15 @@ com.fasterxml.jackson.core jackson-databind + + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + + org.apache.struts struts2-junit-plugin diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml index 5223b02d6a..1b3d8d1a55 100644 --- a/plugins/json/pom.xml +++ b/plugins/json/pom.xml @@ -48,6 +48,14 @@ + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + + org.apache.struts struts2-junit-plugin diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml index 036694c004..b24da920e0 100644 --- a/plugins/rest/pom.xml +++ b/plugins/rest/pom.xml @@ -68,6 +68,14 @@ true + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + + mockobjects mockobjects-core diff --git a/plugins/spring/pom.xml b/plugins/spring/pom.xml index fddfb03de9..9040fe8d1d 100644 --- a/plugins/spring/pom.xml +++ b/plugins/spring/pom.xml @@ -64,6 +64,14 @@ true + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + + org.springframework spring-test diff --git a/plugins/spring/src/test/java/org/apache/struts2/mock/DummyTextProvider.java b/plugins/spring/src/test/java/org/apache/struts2/mock/DummyTextProvider.java deleted file mode 100644 index a76993680f..0000000000 --- a/plugins/spring/src/test/java/org/apache/struts2/mock/DummyTextProvider.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - package org.apache.struts2.mock; - -import org.apache.struts2.text.TextProvider; -import org.apache.struts2.util.ValueStack; - -import java.util.List; -import java.util.ResourceBundle; - -public class DummyTextProvider implements TextProvider { - @Override - public boolean hasKey(String key) { - return false; - } - - @Override - public String getText(String key) { - return null; - } - - @Override - public String getText(String key, String defaultValue) { - return null; - } - - @Override - public String getText(String key, String defaultValue, String obj) { - return null; - } - - @Override - public String getText(String key, List args) { - return null; - } - - @Override - public String getText(String key, String[] args) { - return null; - } - - @Override - public String getText(String key, String defaultValue, List args) { - return null; - } - - @Override - public String getText(String key, String defaultValue, String[] args) { - return null; - } - - @Override - public String getText(String key, String defaultValue, List args, ValueStack stack) { - return null; - } - - @Override - public String getText(String key, String defaultValue, String[] args, ValueStack stack) { - return null; - } - - @Override - public ResourceBundle getTexts(String bundleName) { - return null; - } - - @Override - public ResourceBundle getTexts() { - return null; - } -} diff --git a/plugins/xslt/pom.xml b/plugins/xslt/pom.xml index f338b9c01a..f234ce38fd 100644 --- a/plugins/xslt/pom.xml +++ b/plugins/xslt/pom.xml @@ -32,6 +32,14 @@ Struts 2 XSLT Plugin + + org.apache.struts + struts2-core + ${project.version} + test-jar + test + + org.apache.struts struts2-junit-plugin