|
35 | 35 | import java.util.List; |
36 | 36 |
|
37 | 37 | import org.ros2.rcljava.RCLJava; |
| 38 | +import org.ros2.rcljava.client.Client; |
38 | 39 | import org.ros2.rcljava.concurrent.RCLFuture; |
39 | 40 | import org.ros2.rcljava.consumers.Consumer; |
| 41 | +import org.ros2.rcljava.consumers.TriConsumer; |
40 | 42 | import org.ros2.rcljava.executors.Executor; |
41 | 43 | import org.ros2.rcljava.executors.MultiThreadedExecutor; |
42 | 44 | import org.ros2.rcljava.executors.SingleThreadedExecutor; |
43 | 45 | import org.ros2.rcljava.graph.NameAndTypes; |
44 | 46 | import org.ros2.rcljava.node.Node; |
45 | 47 | import org.ros2.rcljava.publisher.Publisher; |
| 48 | +import org.ros2.rcljava.service.RMWRequestId; |
| 49 | +import org.ros2.rcljava.service.Service; |
46 | 50 | import org.ros2.rcljava.subscription.Subscription; |
47 | 51 |
|
48 | 52 | public class NodeTest { |
@@ -933,4 +937,24 @@ public void accept(final Collection<NameAndTypes> namesAndTypes) { |
933 | 937 | subscription.dispose(); |
934 | 938 | subscription2.dispose(); |
935 | 939 | } |
| 940 | + |
| 941 | + @Test |
| 942 | + public final void testGetServiceNamesAndTypes() throws Exception { |
| 943 | + Service<rcljava.srv.AddTwoInts> service = node.<rcljava.srv.AddTwoInts>createService( |
| 944 | + rcljava.srv.AddTwoInts.class, "test_service_names_and_types_1", |
| 945 | + new TriConsumer< |
| 946 | + RMWRequestId, rcljava.srv.AddTwoInts_Request, rcljava.srv.AddTwoInts_Response>() |
| 947 | + { |
| 948 | + public final void accept( |
| 949 | + final RMWRequestId header, |
| 950 | + final rcljava.srv.AddTwoInts_Request request, |
| 951 | + final rcljava.srv.AddTwoInts_Response response) |
| 952 | + {} |
| 953 | + }); |
| 954 | + Client<rcljava.srv.AddTwoInts> client = node.<rcljava.srv.AddTwoInts>createClient( |
| 955 | + rcljava.srv.AddTwoInts.class, "test_service_names_and_types_2"); |
| 956 | + |
| 957 | + service.dispose(); |
| 958 | + client.dispose(); |
| 959 | + } |
936 | 960 | } |
0 commit comments