Move mock types into xbot.common from edu.wpi.first.wpilibj - #676
Open
stephenjust wants to merge 1 commit into
Open
Move mock types into xbot.common from edu.wpi.first.wpilibj#676stephenjust wants to merge 1 commit into
stephenjust wants to merge 1 commit into
Conversation
WPILib 2027 is changing their package name from `edu.wpi.first.wpilibj` to `org.wpilib` so now is a good opportunity to clean this up.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR relocates several mock/stub implementations that previously lived in the edu.wpi.first.wpilibj namespace into xbot.common.*, reducing coupling to WPILib’s package layout ahead of the upcoming WPILib package rename.
Changes:
- Updated unit tests and test harness base classes to import mock types from
xbot.common.controls.*.mock_adapters. - Updated Dagger modules (
MockDevicesModule,MockControlsModule,UnitTestModule) to bind factories and implementations from the new mock packages. - Repackaged multiple mock adapter classes by changing their
packagedeclarations to match theirxbot.commonsource tree locations.
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/xbot/common/subsystems/pose/BasePoseTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/subsystems/feedback/RumbleManagerTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/subsystems/drive/HeadingModuleTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/subsystems/drive/HeadingAssistModuleTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/simulation/SimulatedTimerTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/simulation/SimulatedSolenoidTest.java | Switches MockSolenoid import to new mock adapter package. |
| src/test/java/xbot/common/math/PIDManagerTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/injection/MockTimerTest.java | Switches MockTimer import to new mock adapter package. |
| src/test/java/xbot/common/controls/sensors/XboxControllerTest.java | Switches MockXboxControllerAdapter import to new mock adapter package. |
| src/test/java/xbot/common/controls/actuators/XDoubleSolenoidTest.java | Switches MockSolenoid import to new mock adapter package. |
| src/test/java/xbot/common/controls/actuators/TimedAndBoundedServoTest.java | Switches MockTimer import to new mock adapter package. |
| src/main/java/xbot/common/simulation/BaseSimulationTest.java | Switches MockTimer import to new mock adapter package. |
| src/main/java/xbot/common/injection/modules/UnitTestModule.java | Binds timer implementations using the relocated MockTimer. |
| src/main/java/xbot/common/injection/modules/MockDevicesModule.java | Updates imports/bindings to use relocated mock device factories. |
| src/main/java/xbot/common/injection/modules/MockControlsModule.java | Updates imports/bindings to use relocated mock controller factory. |
| src/main/java/xbot/common/injection/BaseWPITest.java | Switches MockTimer import to new mock adapter package. |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockXboxControllerAdapter.java | Changes package to xbot.common... and adds required WPILib imports. |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockTimer.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockLidarLite.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockDutyCycleEncoder.java | Removes old WPILib mock import as part of repackaging. |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockDistanceSensorPair.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockDistanceSensor.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockDigitalInput.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/sensors/mock_adapters/MockAnalogInput.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/actuators/mock_adapters/MockSpeedController.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/actuators/mock_adapters/MockSolenoid.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/actuators/mock_adapters/MockServo.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/actuators/mock_adapters/MockPWM.java | Changes package to xbot.common.... |
| src/main/java/xbot/common/controls/actuators/mock_adapters/MockDigitalOutput.java | Changes package to xbot.common.... |
Comments suppressed due to low confidence (1)
src/main/java/xbot/common/controls/sensors/mock_adapters/MockDutyCycleEncoder.java:10
- Unused import
xbot.common.controls.sensors.XAnalogInputremains after moving mocks; this will likely fail Checkstyle's unused imports rule and adds noise.
import xbot.common.command.DataFrameRegistry;
import xbot.common.controls.io_inputs.XDutyCycleEncoderInputs;
import xbot.common.controls.sensors.XAnalogInput;
import xbot.common.controls.sensors.XDutyCycleEncoder;
import xbot.common.injection.DevicePolice;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aschokking
approved these changes
Aug 1, 2026
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
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.
WPILib 2027 is changing their package name from
edu.wpi.first.wpilibjtoorg.wpilibso now is a good opportunity to clean this up.