Creating a datapool

Datapools contain data that tests can use when they run.

To create a datapool, do the following.
  1. Open the Test perspective.
    • From the File menu, choose Window > Open Perspective > Other.
    • Select Test and click OK. The Test Navigator appears.
  2. In the Test Navigator, right-click a project and select New > Test Element.... The New Test Element dialog appears.
  3. In the Wizards list box, expand the Test Assets folder and select Datapool.
  4. Click Next. The New Datapool dialog appears.
  5. Choose the datapool project folder and datapool name. In the list of existing projects, select the project to store the datapool. You can store datapools in any kind of project (Java, Simple, etc.). You do not have to store datapools with the tests that use them. In the Name field, enter the name of the new datapool. Click Finish to create an empty datapool with default settings or click Next to continue.
  6. Optionally, enter a description and initial dimensions for the datapool. Click Next to continue.
  7. Optionally, import data contained in an existing CSV file (comma-separated value text file).
    • In the CSV File field, type the name of a CSV file or click Browse to navigate to the file.
    • If the data in the CSV file is encoded differently from what the local computer expects, select the encoding from the Import Encoding drop down menu.
    • The first row of the CSV file may contain column names. If it does, check the box beside First row contains variable names and suggested types. If this box is not checked, default variable names and types such as Variable1::String are used. You can easily change the names using the datapool editor.
    • If the first column of your CSV file contains equivalence class names, check First column contains equivalence class names. Equivalence classes group related data. The following example shows a CSV file with two equivalence classes, flowers and vegetables.
      ,ModelNumber::String,Description::String,Price::Double
      flowers,F0001,Orchid,5.99
      flowers,F0002,Tulip,1.99
      flowers,F0003,White Poinsee,6.99
      flowers,F0004,White Rose,9.99
      flowers,F0005,Geraniums,4.99
      vegetables,F0006,Cabbage,0.99
      vegetables,F0007,Lettuce,0.99
      vegetables,F0008,Tomatoes,0.25
      vegetables,F0009,Celery,0.35
      vegetables,F0010,Cucumbers,0.4
      Note: if your CSV file does not include equivalence class names, all imported rows are grouped under a single equivalence class.
  8. Click Finish. If you specified initial datapool dimensions, which may conflict with the CSV file dimensions, a dialog appears. Click Yes to use the dimensions of the CSV file. Click No to use the specified initial dimensions (and possibly truncate the CSV file data). The Datapool editor appears, showing the datapool's first equivalence class.


For instructions on how to add data to or edit the new datapool, go to Editing a datapool.

Parent topic: Providing tests with variable data

Related concepts
Tutorial: Creating a datapool driven JUnit test application

Related tasks
Editing a datapool

(C) Copyright IBM Corporation 2000, 2006. All Rights Reserved.