onkar717 opened a new pull request, #985:
URL: https://github.com/apache/tomcat/pull/985

   ### **Summary**
   
   This PR improves test coverage for the `storeconfig` module by adding
   unit tests for core classes that previously had little to no test
   coverage.
   
   ---
   
   ### **Motivation**
   
   While analyzing overall test coverage, the `storeconfig` module was
   identified as one of the largest gaps, with many untested classes.
   These classes are responsible for configuration serialization and
   XML generation, making them important for reliability.
   
   This PR introduces targeted tests to cover core behaviors, edge cases,
   and failure scenarios across the module.
   
   ---
   
   ### **Changes**
   
   #### **StoreDescription**
   
   Added `TestStoreDescription` covering:
   
   * Getters and setters
   * Transient attributes and child handling
   * Identifier and attribute resolution
   
   ---
   
   #### **StoreRegistry**
   
   Added `TestStoreRegistry` covering:
   
   * Registration and unregistration of descriptions
   * Lookup and factory resolution
   * Handling of missing or invalid classes
   
   ---
   
   #### **StoreAppender**
   
   Added `TestStoreAppender` covering:
   
   * XML tag generation
   * Attribute and value printing
   * Indentation and formatting behavior
   * Handling of arrays and nested elements
   
   ---
   
   #### **StoreFactoryBase**
   
   Added `TestStoreFactoryBase` covering:
   
   * Storing elements with and without descriptors
   * Appender and registry interaction
   * XML generation entry points
   
   ---
   
   #### **StoreFileMover**
   
   Added `TestStoreFileMover` covering:
   
   * File rotation and rename logic
   * Writer creation and handling
   * Failure scenarios and edge cases
   * Property getters and setters
   
   ---
   
   ### **Testing**
   
   All tests pass locally:
   
   ```
   ant clean test
   ```
   
   Targeted validation performed for each new test class with no failures.
   
   **Test results:**
   
   ```
   TestStoreDescription:   Tests run: 10, Failures: 0, Errors: 0
   TestStoreRegistry:      Tests run: 9,  Failures: 0, Errors: 0
   TestStoreAppender:      Tests run: 16, Failures: 0, Errors: 0
   TestStoreFactoryBase:   Tests run: 9,  Failures: 0, Errors: 0
   TestStoreFileMover:     Tests run: 7,  Failures: 0, Errors: 0
   ```
   
   ---
   
   ### **Coverage Impact**
   
   This PR significantly improves coverage for the `storeconfig` module,
   which previously had minimal test coverage.
   
   Core classes are now covered, including:
   
   * StoreDescription
   * StoreRegistry
   * StoreAppender
   * StoreFactoryBase
   * StoreFileMover
   
   This establishes a strong foundation for further coverage improvements
   in remaining classes.
   
   ---
   
   ### **Impact**
   
   * No functional changes
   * Test coverage improvement only
   
   ---
   
   ### **Files Changed**
   
   * `TestStoreDescription.java` (new)
   * `TestStoreRegistry.java` (new)
   * `TestStoreAppender.java` (new)
   * `TestStoreFactoryBase.java` (new)
   * `TestStoreFileMover.java` (new)
   
   ---
   
   ### **Notes**
   
   This PR is part of ongoing work to systematically improve test
   coverage across Tomcat modules, focusing on high-impact gaps.
   
   ---
   
   ### **Checklist**
   
   * [x] Tests added
   * [x] Existing tests pass
   * [x] No functional changes
   * [x] ASF license headers included
   * [x] Changes limited to test code only
   * [x] Build verified with `ant clean test`


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to