test_class.declarator: topicName = "com.weevent.test"
test_class.modifier: private
test_class.original_string: private String topicName = "com.weevent.test";
test_class.type: String
test_class.var_name: topicName
test_class.declarator: channelName = "mychannel"
test_class.modifier: private
test_class.original_string: private String channelName = "mychannel";
test_class.type: String
test_class.var_name: channelName
test_class.declarator: transactionTimeout = 30000
test_class.modifier: private
test_class.original_string: private long transactionTimeout = 30000;
test_class.type: long
test_class.var_name: transactionTimeout
test_class.declarator: iProducer
test_class.modifier: private
test_class.original_string: private FabricBroker4Producer iProducer;
test_class.type: FabricBroker4Producer
test_class.var_name: iProducer
test_class.file: weevent-core/src/test/java/com/webank/weevent/core/fabric/FabricBroker4ProducerTest.java
test_class.identifier: FabricBroker4ProducerTest
test_class.superclass: extends JUnitTestBase
test_case.body: @Test
      public void testPublishTopicContainSpecialChar() {
          try {
              char[] charStr = {69, 72, 31};
              String illegalTopic = new String(charStr);
              byte[] bytes = "hello world".getBytes();
              this.iProducer.publish(new WeEvent(illegalTopic, bytes), this.channelName);
              Assert.fail();
          } catch (BrokerException e) {
              Assert.assertEquals(ErrorCode.TOPIC_CONTAIN_INVALID_CHAR.getCode(), e.getCode());
          }
      }
test_case.class_method_signature: FabricBroker4ProducerTest.testPublishTopicContainSpecialChar()
test_case.full_signature: @Test public void testPublishTopicContainSpecialChar()
test_case.identifier: testPublishTopicContainSpecialChar
test_case.invocations: getBytes publish fail assertEquals getCode getCode
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPublishTopicContainSpecialChar()
focal_class.file: weevent-core/src/main/java/com/webank/weevent/core/fabric/FabricBroker4Producer.java
focal_class.identifier: FabricBroker4Producer
focal_class.interfaces: implements IProducer
focal_class.class_method_signature: FabricBroker4Producer.FabricBroker4Producer(FabricDelegate fabricDelegate)
focal_class.full_signature: public  FabricBroker4Producer(FabricDelegate fabricDelegate)
focal_class.identifier: FabricBroker4Producer
focal_class.modifiers: public
focal_class.parameters: (FabricDelegate fabricDelegate)
focal_class.signature:  FabricBroker4Producer(FabricDelegate fabricDelegate)
focal_class.class_method_signature: FabricBroker4Producer.startProducer()
focal_class.full_signature: @Override public boolean startProducer()
focal_class.identifier: startProducer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean startProducer()
focal_class.class_method_signature: FabricBroker4Producer.shutdownProducer()
focal_class.full_signature: @Override public boolean shutdownProducer()
focal_class.identifier: shutdownProducer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean shutdownProducer()
focal_class.class_method_signature: FabricBroker4Producer.publish(WeEvent event, String channelName)
focal_class.full_signature: @Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName)
focal_class.identifier: publish
focal_class.modifiers: @Override public
focal_class.parameters: (WeEvent event, String channelName)
focal_class.return: CompletableFuture<SendResult>
focal_class.signature: CompletableFuture<SendResult> publish(WeEvent event, String channelName)
focal_class.superclass: extends FabricTopicAdmin
focal_method.body: @Override
      public CompletableFuture<SendResult> publish(WeEvent event, String channelName) throws BrokerException {
          log.debug("publish input param WeEvent: {}", event);
  
          ParamCheckUtils.validateEvent(event);
          this.validateChannelName(channelName);
          return fabricDelegate.publishEvent(event.getTopic(),
                  channelName,
                  new String(event.getContent(), StandardCharsets.UTF_8),
                  JsonHelper.object2Json(event.getExtensions()));
      }
focal_method.class_method_signature: FabricBroker4Producer.publish(WeEvent event, String channelName)
focal_method.full_signature: @Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName)
focal_method.identifier: publish
focal_method.invocations: debug validateEvent validateChannelName publishEvent getTopic getContent object2Json getExtensions
focal_method.modifiers: @Override public
focal_method.parameters: (WeEvent event, String channelName)
focal_method.return: CompletableFuture<SendResult>
focal_method.signature: CompletableFuture<SendResult> publish(WeEvent event, String channelName)