Skip to content

Commit 121486f

Browse files
authored
Shutdown default context after tests (#95)
This fixes some fatal runtime errors during testing. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
1 parent 79f8273 commit 121486f

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

rcljava/src/test/java/org/ros2/rcljava/publisher/PublisherTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ public final void testCreate() {
3333
assertEquals(node.getHandle(), publisher.getNodeReference().get().getHandle());
3434
assertNotEquals(0, publisher.getNodeReference().get().getHandle());
3535
assertNotEquals(0, publisher.getHandle());
36+
RCLJava.shutdown();
3637
}
3738
}

rcljava/src/test/java/org/ros2/rcljava/subscription/SubscriptionTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ public void accept(final std_msgs.msg.String msg) {}
3636
assertEquals(node.getHandle(), subscription.getNodeReference().get().getHandle());
3737
assertNotEquals(0, subscription.getNodeReference().get().getHandle());
3838
assertNotEquals(0, subscription.getHandle());
39+
RCLJava.shutdown();
3940
}
4041
}

rcljava/src/test/java/org/ros2/rcljava/timer/TimerTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,6 @@ public final void testCreate() {
7979
assertTrue(timer.isCanceled());
8080

8181
assertEquals(4, timerCallback.getCounter());
82+
RCLJava.shutdown();
8283
}
8384
}

0 commit comments

Comments
 (0)