(String[] args)
| 7 | private static final int N_MSGS = 10; |
| 8 | |
| 9 | public static void main(String[] args) { |
| 10 | |
| 11 | DomainParticipantFactory dpf = |
| 12 | TheParticipantFactory.WithArgs(new StringSeqHolder(args)); |
| 13 | if (dpf == null) { |
| 14 | System.err.println("ERROR: Domain Participant Factory not found"); |
| 15 | return; |
| 16 | } |
| 17 | DomainParticipant dp = dpf.create_participant(4, |
| 18 | PARTICIPANT_QOS_DEFAULT.get(), null, DEFAULT_STATUS_MASK.value); |
| 19 | if (dp == null) { |
| 20 | System.err.println("ERROR: Domain Participant creation failed"); |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | MessageTypeSupportImpl servant = new MessageTypeSupportImpl(); |
| 25 | if (servant.register_type(dp, "") != RETCODE_OK.value) { |
| 26 | System.err.println("ERROR: register_type failed"); |
| 27 | return; |
| 28 | } |
| 29 | |
| 30 | Publisher pub = dp.create_publisher(PUBLISHER_QOS_DEFAULT.get(), null, |
| 31 | DEFAULT_STATUS_MASK.value); |
| 32 | if (pub == null) { |
| 33 | System.err.println("ERROR: Publisher creation failed"); |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | Subscriber sub = dp.create_subscriber(SUBSCRIBER_QOS_DEFAULT.get(), |
| 38 | null, DEFAULT_STATUS_MASK.value); |
| 39 | if (sub == null) { |
| 40 | System.err.println("ERROR: Subscriber creation failed"); |
| 41 | return; |
| 42 | } |
| 43 | |
| 44 | Topic top = dp.create_topic("Movie Discussion List", |
| 45 | servant.get_type_name(), |
| 46 | TOPIC_QOS_DEFAULT.get(), |
| 47 | null, |
| 48 | DEFAULT_STATUS_MASK.value); |
| 49 | if (top == null) { |
| 50 | System.err.println("ERROR: Topic creation failed"); |
| 51 | return; |
| 52 | } |
| 53 | |
| 54 | DataWriter dw = pub.create_datawriter(top, |
| 55 | DATAWRITER_QOS_DEFAULT.get(), |
| 56 | null, |
| 57 | DEFAULT_STATUS_MASK.value); |
| 58 | if (dw == null) { |
| 59 | System.err.println("ERROR: DataWriter creation failed"); |
| 60 | return; |
| 61 | } |
| 62 | |
| 63 | DataReader dr = sub.create_datareader(top, |
| 64 | DATAREADER_QOS_DEFAULT.get(), |
| 65 | null, |
| 66 | DEFAULT_STATUS_MASK.value); |
nothing calls this directly
no test coverage detected