Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

注意,Parasoft 应用市场(可通过 marketplace.parasoft.com 或你组织的 或贵公司的 CTP 访问)提供了 TCP/IP、FTP 和其他固定长度消息类型(如 Equifax)的示例。

...

实现必要类之后,如下定义 parasoft-extension.xml (在 添加扩展的通用程序中有所介绍): 


Code Block
<?xml version="1.0" encoding="UTF-8"?>
<extension xmlns="urn:com/parasoft/extensibility-framework/extension"
       type="messageListener" 
       name='The name of your message listener, appears in the transports menu' 
       description='A more detailed description'>
  <class>com.mycompany.MyMessageListener</class> <!-- implements ICustomMessageListener-->
  <form xmlns="urn:com/parasoft/extensibility-framework/gui">
       <!-- This describes the fields you wish to appear in your transport GUI --> 
       <section label="field group 1">
          <field id="key 1" label="field 1"/>
          <field id="key 2" label="field 2"/> 
          ...
          <section label="field group 2">
          <field id="key 3" label="field 3" />
      </section>
      <section label="field group 2">
          <field label="field 1" />
          ...
      </section>
      ...
  </form>
</extension>

 


此处 section 元素下的字段 id 被用于传递到各种 API 方法的 ICustomMessageListenerConfiguration 实例检索值,该对象允许将用户提供的值传递到实现中。它们还可用于在保存值时,将用户提供的值保存到响应器部署描述符文件中。GUI 中出现的字段标签是基于此 XML 构建的。section 布局不存在编程影响;它只是帮助将各种 GUI 字段组织成 sections 或 categories,以便最终用户方便地访问和使用。

...

如果只有一个自定义监听器可用,则这个选项卡将专门用于配置该自定义格式: 


 


如果有多个自定义侦听器可用,则可以从 Select Implementation 下拉菜单选择要使用的:

 


示例

有几个自定义消息侦听器实现可以在 Parasoft 应用市场上使用(可以在 marketplace.parasoft.com 或从你组织的 或从贵公司的 CTP 中访问)。  有关如何安装和使用这些扩展的详细信息,请参阅这些 zip 文件中提供的文档。 

...