Class BlockTester


  • public final class BlockTester
    extends Object

    Test infrastructure for TIBCO Cloud Streaming flow blocks.

    See Also:
    FlowTester
    • Method Detail

      • getTransformedConfigForParentBlock

        @Deprecated
        public com.typesafe.config.Config getTransformedConfigForParentBlock​(String[] inputPortNames,
                                                                             String[] outputPortNames,
                                                                             com.typesafe.config.Config blockInstanceConfig)
                                                                      throws TCSRuntimeException

        For a block of type DEPENDENT, given a block instance configuration for this block, return the block instance's transformed parent configuration. Used to test correctness of transformation operations in dependent block metadata.

        Parameters:
        inputPortNames - expected block input port name(s)
        outputPortNames - expected block output port name(s)
        blockInstanceConfig - block instance's configuration
        Returns:
        the transformed parent configuration
        Throws:
        TCSRuntimeException - if the block is the wrong type, or the port names are invalid
      • getTransformedConfigForParentBlock

        public com.typesafe.config.Config getTransformedConfigForParentBlock​(Set<String> inputPortNames,
                                                                             Set<String> outputPortNames,
                                                                             com.typesafe.config.Config blockInstanceConfig)
                                                                      throws TCSRuntimeException

        For a block of type DEPENDENT, given a block instance configuration for this block, return the block instance's transformed parent configuration. Used to test correctness of transformation operations in dependent block metadata.

        Parameters:
        inputPortNames - expected block input port name(s)
        outputPortNames - expected block output port name(s)
        blockInstanceConfig - block instance's configuration
        Returns:
        the transformed parent configuration
        Throws:
        TCSRuntimeException - if the block is the wrong type, or the port names are invalid
      • getDefaultBlockConfig

        public com.typesafe.config.Config getDefaultBlockConfig()

        Return this tester's block type's default configuration.

        Returns:
        default configuration
      • getExternalAdapterXMLConfigForType

        public NodeList getExternalAdapterXMLConfigForType​(String adapterType)
                                                    throws TCSRuntimeException

        Return the current external XML adapter configuration for the specified adapter type. Requires that a flow containing a block using that adapter type be running. Used to test conversion of block instance configuration to StreamBase adapter external XML.

        Parameters:
        adapterType - the adapter type that this block tester's block type is associated with
        Returns:
        external adapter configuration XML for the desired adapter type
        Throws:
        TCSRuntimeException - if the supplied adapter type is syntactically invalid
      • getModuleParametersForModuleBlock

        @Deprecated
        public Map<String,​String> getModuleParametersForModuleBlock​(String[] inputPortNames,
                                                                          String[] outputPortNames,
                                                                          com.typesafe.config.Config blockInstanceConfig)
                                                                   throws TCSRuntimeException

        For a block of type MODULE, given a block instance configuration for this block, return the block instance's module parameters. Used to test correctness of parameter expressions in module block metadata.

        Parameters:
        inputPortNames - expected block input port name(s)
        outputPortNames - expected block output port name(s)
        blockInstanceConfig - block instance's configuration
        Returns:
        the block instance's underlying module parameters
        Throws:
        TCSRuntimeException - if the block is the wrong type, or the port names are invalid
      • getModuleParametersForModuleBlock

        public Map<String,​String> getModuleParametersForModuleBlock​(Set<String> inputPortNames,
                                                                          Set<String> outputPortNames,
                                                                          com.typesafe.config.Config blockInstanceConfig)
                                                                   throws TCSRuntimeException

        For a block of type MODULE, given a block instance configuration for this block, return the block instance's module parameters. Used to test correctness of parameter expressions in module block metadata.

        Parameters:
        inputPortNames - expected block input port name(s)
        outputPortNames - expected block output port name(s)
        blockInstanceConfig - block instance's configuration
        Returns:
        the block instance's underlying module parameters
        Throws:
        TCSRuntimeException - if the block is the wrong type, or the port names are invalid