File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
wpilibj/src/test/java/edu/wpi/first/wpilibj Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2323import org .junit .jupiter .api .parallel .ResourceLock ;
2424
2525class AlertTest {
26- String m_groupName ;
26+ private NetworkTableInstance m_inst ;
27+ private String m_groupName ;
2728
2829 @ BeforeEach
2930 void setup (TestInfo info ) {
3031 m_groupName = "AlertTest_" + info .getDisplayName ();
32+
33+ m_inst = NetworkTableInstance .create ();
34+ SmartDashboard .setNetworkTableInstance (m_inst );
3135 }
3236
3337 @ AfterEach
@@ -36,6 +40,9 @@ void checkClean() {
3640 assertEquals (0 , getActiveAlerts (AlertType .kError ).length );
3741 assertEquals (0 , getActiveAlerts (AlertType .kWarning ).length );
3842 assertEquals (0 , getActiveAlerts (AlertType .kInfo ).length );
43+
44+ m_inst .close ();
45+ SmartDashboard .setNetworkTableInstance (NetworkTableInstance .getDefault ());
3946 }
4047
4148 private String getSubtableName (Alert .AlertType type ) {
@@ -52,7 +59,7 @@ private String getSubtableName(Alert.AlertType type) {
5259 }
5360
5461 private StringArraySubscriber getSubscriberForType (Alert .AlertType type ) {
55- return NetworkTableInstance . getDefault ()
62+ return m_inst
5663 .getStringArrayTopic ("/SmartDashboard/" + m_groupName + "/" + getSubtableName (type ))
5764 .subscribe (new String [] {});
5865 }
You can’t perform that action at this time.
0 commit comments