-
Notifications
You must be signed in to change notification settings - Fork 35
#433: Add basic set of JUnit tests for Data- and TimeMachine component #434
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
#433: Add basic set of JUnit tests for Data- and TimeMachine component #434
Conversation
- closes #433 - fixes bug/glitch in DataMachineFiles#line99 - fixes bug/glitch in TimeMachineFiles#line49 - removes spammy, oldskool FileMemoryLogger from default ILogger config in AbstractEnvironmentFactory as the same behavior (log 'files') can be achieved via some external config
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.
Pull request overview
This PR adds JUnit tests for DataMachine and TimeMachine components, fixes two bugs in copy/error handling, and removes the FileMemoryLogger from default logging configuration.
Changes:
- Adds comprehensive JUnit test suites for DataMachine and TimeMachine factory and domain classes
- Fixes critical bug in TimeMachineFiles copy constructor where pageLinksFile was incorrectly assigned metaHistoryFile value
- Fixes bug in DataMachineFiles where error message referenced wrong variable
- Updates Slf4JLogger to log Throwables at error level instead of info level
- Removes FileMemoryLogger from default ILogger configuration in AbstractEnvironmentFactory
- Adds input validation and defensive null checks in Files and DataMachineFiles
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/factory/AbstractEnvironmentFactory.java | Removes FileMemoryLogger from default logger configuration, adds explanatory comment |
| dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/domain/Files.java | Adds null/blank validation for setOutputDirectory with defensive behavior when path is not a directory |
| dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/debug/Slf4JLogger.java | Changes Throwable logging from info to error level |
| dkpro-jwpl-timemachine/src/main/java/org/dkpro/jwpl/timemachine/domain/TimeMachineFiles.java | Fixes copy constructor bug, removes blank line in setTimestamp, improves formatting |
| dkpro-jwpl-datamachine/src/main/java/org/dkpro/jwpl/datamachine/domain/DataMachineFiles.java | Fixes error message to reference correct variable, adds null/blank validation, adds defensive null checks in getters |
| dkpro-jwpl-timemachine/src/test/java/org/dkpro/jwpl/timemachine/factory/DefaultTimeMachineEnvironmentFactoryTest.java | Adds factory tests verifying component instantiation |
| dkpro-jwpl-timemachine/src/test/java/org/dkpro/jwpl/timemachine/domain/TimeMachineFilesTest.java | Adds comprehensive tests for TimeMachineFiles including validation, getters, and copy constructor |
| dkpro-jwpl-datamachine/src/test/java/org/dkpro/jwpl/datamachine/factory/DefaultDataMachineEnvironmentFactoryTest.java | Adds factory tests verifying component instantiation |
| dkpro-jwpl-datamachine/src/test/java/org/dkpro/jwpl/datamachine/domain/DataMachineFilesTest.java | Adds comprehensive tests for DataMachineFiles including validation, getters, and copy constructor |
| dkpro-jwpl-timemachine/src/test/resources/log4j2.xml | Adds log4j2 configuration for test resources |
| dkpro-jwpl-datamachine/src/test/resources/log4j2.xml | Adds log4j2 configuration for test resources |
| dkpro-jwpl-datamachine/src/test/resources/log4j2.properties | Removes old log4j properties file |
| dkpro-jwpl-timemachine/src/test-e2e/java/org/dkpro/jwpl/timemachine/domain/JWPLTimeMachineE2ETest.java | Restructures directory organization for E2E tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...o-jwpl-timemachine/src/test/java/org/dkpro/jwpl/timemachine/domain/TimeMachineFilesTest.java
Outdated
Show resolved
Hide resolved
...o-jwpl-timemachine/src/test/java/org/dkpro/jwpl/timemachine/domain/TimeMachineFilesTest.java
Outdated
Show resolved
Hide resolved
...o-jwpl-datamachine/src/test/java/org/dkpro/jwpl/datamachine/domain/DataMachineFilesTest.java
Outdated
Show resolved
Hide resolved
...o-jwpl-datamachine/src/test/java/org/dkpro/jwpl/datamachine/domain/DataMachineFilesTest.java
Outdated
Show resolved
Hide resolved
...o-jwpl-datamachine/src/test/java/org/dkpro/jwpl/datamachine/domain/DataMachineFilesTest.java
Outdated
Show resolved
Hide resolved
dkpro-jwpl-wikimachine/src/main/java/org/dkpro/jwpl/wikimachine/domain/Files.java
Outdated
Show resolved
Hide resolved
...o-jwpl-timemachine/src/test/java/org/dkpro/jwpl/timemachine/domain/TimeMachineFilesTest.java
Outdated
Show resolved
Hide resolved
dkpro-jwpl-timemachine/src/main/java/org/dkpro/jwpl/timemachine/domain/TimeMachineFiles.java
Show resolved
Hide resolved
- addresses AI-driven quality checks
What's in the PR
How to test manually
mvn clean verify -Ptest-e2e-toolsAutomatic testing
Documentation