-
Notifications
You must be signed in to change notification settings - Fork 3
feature/incoporate-generators #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Replace the local Generators utility with the comprehensive cui-test-generator library. Changes: - Add cui-test-generator dependency to Maven (version managed by parent POM) - Remove src/test/java/de/cuioss/tools/support/Generators.java - Create TestDataGenerator implementing TypedGenerator interface for byte array generation - Update all test files to use new generator API: - Generators.randomString() → Generators.nonEmptyStrings().next() - Generators.randomInt(lower, upper) → Generators.integers(lower, upper).next() - Generators.randomBoolean() → Generators.booleans().next() - Generators.generateTestData(size) → TestDataGenerator.generateTestData(size) - Update imports from de.cuioss.tools.support.Generators to de.cuioss.test.generator.Generators - Fix TypedGenerator import references All 896 tests pass successfully. The new library provides better type safety, more generator types, and improved integration with JUnit 5. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Delete src/test/java/de/cuioss/tools/support/TypedGenerator.java (duplicate of the one from cui-test-generator) - Update imports in BracketLexerTest and PersonAddressGenerator to use de.cuioss.test.generator.TypedGenerator instead All tests pass successfully. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Reorder imports in BracketLexerTest and other test files - Auto-formatting by OpenRewrite plugin All tests pass successfully (896 tests). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…sues The ActionToken class uses String.split() which treats the token as a regex pattern. Using Generators.nonEmptyStrings() could generate strings with regex special characters (like backslashes) causing PatternSyntaxException. Changed to use Generators.letterStrings(5, 10) which only generates alphabetic strings, avoiding regex special characters. Fixes test failure: PatternSyntax Illegal/unsupported escape sequence 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Added @EnableGeneratorController annotation to 14 test classes that use cui-test-generator for test data generation: - ActionTokenTest - FieldWrapperTest - PropertyUtilTest - PropertyHolderTest - KeyMaterialHolderTest - PartialArrayListTest - PersonNameTest - KeyStoreProviderTest - StringTokenTest - StructuredFilenameTest - MorePathsTest - IOCaseTest - JoinerConfigTest - SplitterConfigTest This enables proper generator lifecycle control in JUnit 5 tests.
- Added @EnableGeneratorController and Generators imports to: - BooleanOperationsTest: Use generators for array sizes and boolean values - CollectionLiteralsTest: Use generators for test strings - UrlParameterTest: Use generators for parameter names and values - HexTest: Use generators for random data sizes - Replaced hardcoded test data with dynamically generated values - Makes tests more robust by testing with varied inputs - Improved test coverage with randomized test data
… in UrlParameterTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @cuioss, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've integrated the cui-test-generator library into the project's test suite. This change standardizes how random test data is generated across various unit tests, replacing existing custom generator methods with a more robust and dedicated library. The primary goal is to enhance the quality and maintainability of our tests by providing more diverse and consistent test data.
Highlights
- Dependency Update: The project's build configuration has been updated to include the new cui-test-generator library as a test dependency.
- Test Data Generation Standardization: Numerous test classes have been refactored to replace custom, ad-hoc random data generation methods with the standardized and more robust capabilities provided by the de.cuioss.test.generator.Generators utility.
- New TestDataGenerator: A new utility class, de.cuioss.tools.support.TestDataGenerator, has been introduced to specifically handle the generation of byte array test data, centralizing this functionality.
- Removal of Custom Generators: The custom de.cuioss.tools.support.Generators and de.cuioss.tools.support.TypedGenerator utility classes, which previously provided random data generation, have been removed from the codebase.
- Refactoring of Assertions: Method names in ObjectMethodsAsserts and ReflectionUtil have been updated from 'Overriden' to 'Overridden' to correct a spelling inconsistency.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully incorporates the cui-test-generator library, replacing the local test data generation utilities. The changes are well-executed across the test suite, improving test randomness and maintainability by using a standardized generator framework. I've identified a couple of areas for improvement: one test has lost its correctness assertions, and another introduces a minor performance issue by creating Random instances inside a loop. Overall, this is a solid refactoring that modernizes the test infrastructure.
- BooleanOperationsTest: Added proper helper methods to verify correctness of boolean operations with random test data. Replaced unrealistic large arrays (5000-15000 elements) with typical varargs sizes (1-5 elements) to match actual usage patterns. - HexTest: Moved Random instance creation outside loop to improve performance and random number quality. These changes address the review feedback from Gemini Code Assist while maintaining comprehensive test coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|



No description provided.