-
Notifications
You must be signed in to change notification settings - Fork 0
Add unit tests for de.rub.nds.crawler.core package #41
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
Open
ic0ns
wants to merge
14
commits into
main
Choose a base branch
from
add-crawler-core-unit-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added JaCoCo Maven plugin v0.8.13 for code coverage reporting - Configured prepare-agent goal for test execution - Configured report goal to generate coverage reports during test phase
- Changed import from de.rub.nds.scanner.core.constants to de.rub.nds.scanner.core.config - Fixed compilation errors in all test classes
- Created comprehensive tests for BulkScanWorkerManager singleton - Added tests for BulkScanWorker including initialization, cleanup, and concurrent access - Fixed imports and API usage to match actual class signatures - Achieved coverage for worker management and scan execution logic
- Created TestScanConfig for use in unit tests - Added ControllerEnhancedTest with improved test coverage - Added ProgressMonitorSimpleTest with basic coverage - Improved test configuration setup for better isolation
- Removed WorkerTest and PublishBulkScanJobTest due to complex API mismatches - These tests require significant refactoring to match current API signatures - Keeping tests that compile and provide basic coverage
- Removed BulkScanWorkerManagerTest and BulkScanWorkerTest - These require different method signatures than what was assumed - Focus on tests that compile and run correctly
- Focus on getting a minimal set of compiling tests - Will need to rewrite tests with correct API usage
- Test singleton getInstance() behavior - Test getBulkScanWorker() caching behavior - Test handle() and handleStatic() methods - Test exception handling when worker creation fails - Fix TestScanConfig to implement correct BulkScanWorker API
- Test startMonitoringBulkScanProgress() for monitored scans - Test stopMonitoringAndFinalizeBulkScan() method - Test that unmonitored scans are not monitored - Achieve 86% code coverage for ProgressMonitor class
- Test constructor and configuration usage - Test start() method registers scan job consumer - Test handleScanJob() processes scan jobs correctly - Achieve 59% code coverage for Worker class
- Test constructor - Test jobScheduled(), jobUnscheduled(), triggerFinalized() methods - Test all empty listener methods for completeness - Achieve 100% code coverage for SchedulerListenerShutdown class
- Test consumeDoneNotification() with various job statuses - Test multiple job status counters - Test final job processing - Test exception handling in consumeDoneNotification - Test formatTime() private method using reflection - Achieve 95% code coverage for ProgressMonitor.BulkscanMonitor - Increase core package coverage to 79%
- Add tests for timeout scenario in waitForScanResult() - Add tests for ExecutionException handling - Add tests for null result handling (EMPTY status) - Add tests for persistence exception handling - Add test for double timeout exception after cancellation - Create TestWorker and TestBulkScanWorkerManager for better test isolation - Improve overall core package coverage from 79% to 81%
- Test basic scan functionality and auto-cleanup behavior - Test initialization called only once for multiple scans - Test manual initialization and cleanup methods - Test cleanup behavior with active jobs - Test concurrent initialization (only one thread wins) - Test concurrent scans with auto-cleanup - Test scan exception handling - Test cleanup before initialization returns false - Improve overall core package coverage from 81% to 85%
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
de.rub.nds.crawler.core
packageChanges by class:
Test approach: