Skip to content

WW-5444 Add HTML5 theme with comprehensive unit tests#1422

Merged
lukaszlenart merged 10 commits into
mainfrom
feature/WW-5444-html5
Dec 14, 2025
Merged

WW-5444 Add HTML5 theme with comprehensive unit tests#1422
lukaszlenart merged 10 commits into
mainfrom
feature/WW-5444-html5

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

Summary

This PR adds the HTML5 theme to Struts core framework and implements comprehensive unit testing:

  • Migrated HTML5 theme from showcase to core/src/main/resources/template/html5/
  • Fixed all 32 HTML5 templates to use attributes instead of deprecated parameters variable
  • Added theme.properties with parent theme configuration
  • Implemented unit tests for 13 UI components (26 test methods total)
  • All tests passing (100% success rate)

Changes

Theme Implementation

  • Created 45 HTML5 FreeMarker templates in core
  • Added theme.properties with parent=simple configuration
  • Migrated templates from parameters to attributes variable

Unit Tests

Added testGenericHtml5() and testGenericHtml5_clearTagStateSet() methods to:

  • TextfieldTest, TextareaTest, PasswordTest
  • CheckboxTest, CheckboxListTest, RadioTest
  • SelectTest, FileTest, HiddenTest
  • LabelTest, ComboBoxTest, ResetTest, SubmitTest

Excluded: DoubleSelect and UpDownSelect (not supported in HTML5 theme)

Documentation

  • Added implementation plan and testing research documents
  • Updated CLAUDE.md with current guidelines

Test Results

  • 26/26 HTML5 theme tests passing
  • All template path resolution working correctly
  • Proper theme inheritance from simple theme

Closes WW-5444

🤖 Generated with Claude Code

Comment thread .claude/agents/test-runner.md Outdated
Comment thread core/src/main/resources/template/html5/theme.properties Outdated
@lukaszlenart lukaszlenart force-pushed the feature/WW-5444-html5 branch 2 times, most recently from 2ccca73 to 04613ba Compare November 27, 2025 09:17
lukaszlenart and others added 8 commits December 6, 2025 15:32
- Move 42 FreeMarker templates to core/src/main/resources/template/html5/
- Remove duplicate templates from showcase
- Makes html5 theme available to all applications via struts2-core.jar
- Enables unit testing in core module
- Fix Html5Action import from XWork2 to Struts2 package
- Add Apache license header to Html5Action

Resolves WW-5444

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add detailed implementation plan documenting the migration of html5 theme
from showcase to core, including step-by-step instructions, verification
procedures, and acceptance criteria.

Related to WW-5444

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ables

- Add testGenericHtml5() methods to 13 UI tag test classes
- Create theme.properties with parent=simple configuration
- Migrate all 32 HTML5 templates from deprecated 'parameters' to 'attributes' variable
- Exclude DoubleSelect and UpDownSelect (not supported in HTML5 theme)
- All 26 HTML5 theme tests passing (100% success rate)

Components tested: Textfield, Textarea, Password, Checkbox, CheckboxList,
Radio, Select, File, Hidden, Label, ComboBox, Reset, Submit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update CLAUDE.md with current project guidelines
- Update test-runner agent documentation
- Remove deprecated jakarta-migration-helper agent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…asses

Add HTML5 theme tests to ActionErrorTagTest, ActionMessageTagTest,
FieldErrorTagTest, AnchorTest, and FormTagTest. This completes Phase 1
of the HTML5 theme testing plan.

Changes:
- Add 24 new HTML5 theme unit tests across 5 test classes
- Create 17 expected output files for HTML5 theme validation
- Test coverage: action errors, action messages, field errors, anchors, and forms
- All tests verify HTML5 clean markup without table-based layouts

Coverage: 18 of 18 UI tag test classes now have HTML5 tests (100%)
Tests passing: 24/24 HTML5 tests successful

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create Html5TagExampleTest with 5 comprehensive integration tests
- Add fielderror tag demonstration to html5/index.jsp
- Validate HTML5 theme rendering, error display, and clean markup
- All tests passing (5/5) with HtmlUnit and Jetty integration

Tests validate:
- Page load and HTTP status (200)
- Action errors, messages, and field errors display
- Clean semantic markup (ul lists, no table layouts)
- Anchor tag rendering
- Namespace isolation under /html5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lukaszlenart lukaszlenart force-pushed the feature/WW-5444-html5 branch from 04613ba to 66cf785 Compare December 6, 2025 14:32
@lukaszlenart lukaszlenart marked this pull request as ready for review December 6, 2025 15:57
…mpress tag

- Create CompressModel.java to enable <@s.compress> in FreeMarker templates
- Register compress tag in StrutsModels.java for @s namespace access
- Migrate all 29 HTML5 theme templates from <#compress> to <@s.compress>
- Maintain identical compression behavior (uses same >\\s+< regex pattern)
- All 153 HTML5 theme unit tests pass without modification

This change leverages the new configurable Compress component (WW-5256)
which provides devMode awareness and security protections while maintaining
the same whitespace removal behavior as FreeMarker's built-in directive.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@lukaszlenart lukaszlenart force-pushed the feature/WW-5444-html5 branch from be5d83b to e5f884a Compare December 6, 2025 16:12
@sonarqubecloud

sonarqubecloud Bot commented Dec 6, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@lukaszlenart lukaszlenart merged commit e24d2f2 into main Dec 14, 2025
9 of 10 checks passed
@lukaszlenart lukaszlenart deleted the feature/WW-5444-html5 branch December 14, 2025 18:24
@lukaszlenart lukaszlenart added this to the 7.2.0 milestone Feb 12, 2026
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.

2 participants