- // Test exchanging a custom message
- byte[] custom_message_bytes = new byte[] { 0x42, 0x44, 0x43, 0x00 };
- state.peer1.custom_messages_to_send.add(custom_message_bytes);
- state.peer1.peer_manager.process_events();
- synchronized (state.peer2.received_custom_messages) {
- while (true) {
- if (state.peer2.received_custom_messages.isEmpty()) {
- state.peer2.received_custom_messages.wait();
- continue;
+ // Test exchanging a custom message (note that ChannelManagerConstructor) always loads an IgnorimgMessageHandler
+ // so we cannot exchange custom messages with it
+ if (!use_chan_manager_constructor) {
+ byte[] custom_message_bytes = new byte[]{0x42, 0x44, 0x43, 0x00};
+ state.peer1.custom_messages_to_send.add(custom_message_bytes);
+ state.peer1.peer_manager.process_events();
+ synchronized (state.peer2.received_custom_messages) {
+ while (true) {
+ if (state.peer2.received_custom_messages.isEmpty()) {
+ state.peer2.received_custom_messages.wait();
+ continue;
+ }
+ assert state.peer2.received_custom_messages.size() == 1;
+ assert Arrays.equals(state.peer2.received_custom_messages.get(0), custom_message_bytes);
+ break;