Class SystemTest
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.CommandBase
-
- com.lightningrobotics.common.testing.SystemTest
-
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,edu.wpi.first.wpilibj2.command.Command
,java.lang.Comparable<SystemTest>
- Direct Known Subclasses:
AbstractTimedSystemTest
public abstract class SystemTest extends edu.wpi.first.wpilibj2.command.CommandBase implements java.lang.Comparable<SystemTest>
Base testing class. System tests run when the robot is enabled in test mode on the Driver Station. System tests are run with theSystemTestCommand
which is configured to run automatically in test mode. Individual system tests can be queued by callingregister(SystemTest)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SystemTest.Priority
Importance of the SystemTest.
-
Constructor Summary
Constructors Constructor Description SystemTest(java.lang.String msg, LightningFaultCodes.Code code)
Creates a new SystemTestSystemTest(java.lang.String msg, LightningFaultCodes.Code code, SystemTest.Priority priority)
Creates a new SystemTest
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(SystemTest other)
abstract boolean
didPass()
Determines passing conditions for the SystemTestLightningFaultCodes.Code
getCode()
The relatingFaultCode
corresponding to the SystemTestjava.lang.String
getMessage()
The dashboard message of the SystemTestSystemTest.Priority
getPriority()
The priority of the SystemTeststatic void
register(SystemTest test)
Registers the given system test to be run when theLightningRobot
is enabled in test mode.-
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj2.command.Command
alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, end, execute, hasRequirement, initialize, isFinished, isScheduled, perpetually, raceWith, runsWhenDisabled, schedule, schedule, until, withInterrupt, withTimeout
-
-
-
-
Constructor Detail
-
SystemTest
public SystemTest(java.lang.String msg, LightningFaultCodes.Code code)
Creates a new SystemTest- Parameters:
msg
- Dashboard display message for the SystemTestcode
-FaultCode
relating to the SystemTest
-
SystemTest
public SystemTest(java.lang.String msg, LightningFaultCodes.Code code, SystemTest.Priority priority)
Creates a new SystemTest- Parameters:
msg
- Dashboard display message for the SystemTestcode
-FaultCode
relating to the SystemTestpriority
-SystemTest.Priority
of the SystemTest
-
-
Method Detail
-
register
public static void register(SystemTest test)
Registers the given system test to be run when theLightningRobot
is enabled in test mode.- Parameters:
test
- The system test to be registered.
-
getPriority
public SystemTest.Priority getPriority()
The priority of the SystemTest- Returns:
- The
SystemTest.Priority
of the SystemTest
-
getMessage
public java.lang.String getMessage()
The dashboard message of the SystemTest- Returns:
- The message to be displayed on the dashboard
-
didPass
public abstract boolean didPass()
Determines passing conditions for the SystemTest- Returns:
- true if the test was completed successfully, false otherwise
-
getCode
public LightningFaultCodes.Code getCode()
The relatingFaultCode
corresponding to the SystemTest- Returns:
- The corresponding FaultCode
-
compareTo
public int compareTo(SystemTest other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SystemTest>
-
-