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 theSystemTestCommandwhich 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 classSystemTest.PriorityImportance 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 intcompareTo(SystemTest other)abstract booleandidPass()Determines passing conditions for the SystemTestLightningFaultCodes.CodegetCode()The relatingFaultCodecorresponding to the SystemTestjava.lang.StringgetMessage()The dashboard message of the SystemTestSystemTest.PrioritygetPriority()The priority of the SystemTeststatic voidregister(SystemTest test)Registers the given system test to be run when theLightningRobotis 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-FaultCoderelating 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-FaultCoderelating to the SystemTestpriority-SystemTest.Priorityof the SystemTest
-
-
Method Detail
-
register
public static void register(SystemTest test)
Registers the given system test to be run when theLightningRobotis 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.Priorityof 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 relatingFaultCodecorresponding to the SystemTest- Returns:
- The corresponding FaultCode
-
compareTo
public int compareTo(SystemTest other)
- Specified by:
compareToin interfacejava.lang.Comparable<SystemTest>
-
-