JBoss.orgCommunity Documentation

Chapter 10. Testing Your Models

10.1. Manage Connector Bindings
10.1.1. Manage Connector Bindings
10.1.2. Create New Connector Binding
10.1.3. Binding Sources to Connectors
10.1.4. Importing Connector Bindings and Types
10.1.5. Export Connector Bindings
10.2. Previewing Data For a Model
10.2.1. Preview Relational Table or View
10.2.2. Preview Relational Table With Access Pattern
10.2.3. Preview Relational Procedure
10.2.4. Preview Web Service Operation
10.3. Testing With Your VDB

Go To: Table of Contents

As described briefly in Chapter 1, you can test your models in by using the Preview Data action . You can also test your models via your deployable VDB. These two options will be described in detail in this chapter as well as managing your required connector bindings.

In order to test your data, the Designer requires applicable connector information. This information is stored in the properties of a Connector Binding. The Designer provides a Connectors view for managing your bindings and this section summarizes its features and capabilities.

Create a new connector binding by either selecting the New Connector Binding action in the Connectors view toolbar or right-click select the same action from the context menu. If connector types are displayed in the Connectors view, you can select a connector type first, then select the New Connector Binding action. This will pre-select the type in the New Connector dialog. The action will launch the New Connector dialog shown below. Provide a valid binding name, select desired connector type, enter your custom properties and click OK to create you new connector binding.

In order to preview your data, you'll need to bind your source models to valid connectors. If you import your source from JDBC, your connector binding will be created during the import process and your source automatically bound to that connector binding.

You can bind, unbind or change source bindings in a couple of ways.

To bind a source, you can:

  • Select a model in the Model Explorer view select the Modeling > Connector >> Bind action. This action presents a dialog for selecting your desired existing Connector binding. Select a binding and click OK.

  • Select a model in the Model Explorer view and drag the model into the Connectors view and drop into the desired existing Connector binding.

To unbind a source:

  • Select the source model in Connectors view and right-click select the Unbind action.

  • Select the model in the Model Explorer view and select the Modeling > Connector >> Unbind action.

You can import your custom connector types and bindings into Designer. These bindings can be in the form of a *.cdk file (i.e. exported from Designer) or from a *.caf (connector archive file) defined during connector development.

You can export your custom connector bindings from Designer into a *.cdk file.

After creating your models, you can test them by using the Preview Data action . By selecting a desired table object and executing the action, the results of a simple query will be displayed in the Preview results view. This action is accessible throughout the Designer in various view toolbars and context menus.

There are two requirements for previewing your data: the selected object must be one of several previewable model object types and all source models within the model dependency tree must be bound to connector bindings. Model objects that can be previewed include: relational tables and views (including tables involving access patterns), relational procedures, Web service operations and XML document staging tables.

Note that any virtual table, view or procedure is previewable as long as all "physical" source models are bound via connector bindings. (See Connectors view )

Testing Your Transformations

When editing transformation SQL in the Transformation Editor, a special Preview data action is provided in the editor tool-bar .

You can change your transformation SQL, re-validate and preview your the data for your modified SQL.

The following sections provide steps for previewing your data. Note that all steps assume that all source models referenced by your models, either directly or through dependencies, are bound to connector bindings.

When executing queries on XML View Documents, the results are displayed in XML format as shown below:

When each query is executed, the SQL is stored in the SQL History table so the queries can be re-submitted without re-typing it.

This content of this SQL History table can be edited via right-click menu shown below.

Saving Your Query Results

Query results, both SQL and XML, can be saved to text files in the SQL Explorer perspective.

The toolbars for SQL Results and XML Results views contains an additional action/button (see below) which presents a file save dialog. Note that the action can also be accessed via the right-click menu on both views.

In addition, this file save dialog is presented to the user when the XML Document results exceed the character size limit defined by a user preference property for the SQL Explorer.

When this limit is exceeded, the user is presented with a dialog to either save the results to a file or continue displaying the results and possibly incurring substantial runtime memory allocation.

When the Save option is accepted, the XML Query Results view displays the file name and path of the exported file.