Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
43
Добавлен:
16.04.2013
Размер:
896.13 Кб
Скачать

&KDSWHU *HQHUDWLQJ D 7HVW 'DWD 6FULSW

You define a range of decimal numbers between 10.00 and 1000.00 for the random test numbers that will be generated for the data profile Price.

11 Click 2. in each of the dialog boxes.

PDM Getting Started

 

'HILQH D ILOH DV D VRXUFH IRU WHVW GDWD YDOXHV

'HILQH D ILOH DV D VRXUFH IRU WHVW GDWD YDOXHV

You can specify a CSV format file which contains values that can be used to create test data. You will define a CSV file as a test data source for the data profile Title_Txt. The directory TESTDATA in the PowerDesigner path contains several CSV files that can be used as test data generation source files.

1Select 0RGHO 7HVW 'DWD 3URILOHV from the menu bar.

The list of test data profiles appears and shows existing profiles.

2Double-click the 7LWOHB7[W line in the list.

The test data profile property sheet opens to the General page. The Automatic radio button is selected when you select a data profile that does not currently have a data generation source defined.

3Select the )LOH radio button from the Generation Source group box.

4Click the 'HWDLO tab.

The Detail page appears.

5Select or browse to the directory 7(67'$7$ in the PowerDesigner path.

6Select the file WLWOBW[W FVY.

This file contains a number of book titles.

 

PowerDesigner

&KDSWHU *HQHUDWLQJ D 7HVW 'DWD 6FULSW

7Click 2. in each of the dialog boxes. You return to the PDM diagram.

PDM Getting Started

 

$VVLJQ WHVW GDWD SURILOHV WR VHOHFWHG FROXPQV

$VVLJQ WHVW GDWD SURILOHV WR VHOHFWHG FROXPQV

You can assign test data profiles directly to selected table columns. You can do this for columns that are not attached to a domain, or if you want to generate test data that is specific to a column.

You cannot assign a test data profile to a foreign key column. It automatically takes the data profile of the primary key column in the parent table.

You will assign test data profiles to selected columns for the TITLE table in the PDM model. The same procedure can be used to assign test data profiles to any selected column in any table in the PDM model.

1Select 0RGHO 7DEOHV from the menu bar. The list of tables appears.

2Double-click the 7,7/( table.

The table property sheet opens to the General page.

3Click the &ROXPQV tab. The Columns page appears.

'LVSOD\ WKH FROXPQ \RX QHHG

If you don’t see the column you need, display it with the Customize Columns and Filter tool.

 

PowerDesigner

&KDSWHU *HQHUDWLQJ D 7HVW 'DWD 6FULSW

TITLE_ISBN has the data type CHAR(10). Based on this data type, and the sort of data that you want to generate for the column, you will assign the Name_ID data profile to this column.

4Double-click the 7,7/(B ,6%1 line in the list of columns. The column property sheet opens to the General page.

5Click the 'HWDLO tab.

The Detail page appears.

6Select 1DPHB,' in the dropdown list of the Profile textbox. The profile is attached to the column.

7 Click 2..

PDM Getting Started

 

$VVLJQ WHVW GDWD SURILOHV WR VHOHFWHG FROXPQV

You return to the Columns page of the table property sheet.

TITLE_PRICE has the data type NUMERIC(8,2). Based on this data type, and the sort of data that you want to generate for the column, you will assign the name data profile to this column.

8Double-click the 7,7/(B35,&( line in the list of columns. The column property sheet opens to the General page.

9Click the 'HWDLO tab.

The Detail page appears.

10Select 3ULFH in the dropdown list of the Profile textbox.

 

PowerDesigner

&KDSWHU *HQHUDWLQJ D 7HVW 'DWD 6FULSW

The profile is attached to the column.

11Click 2..

You return to the columns property sheet.

12Repeat steps 8 to 11 using 7,7/(B38%'$7 in the list of columns but select 'DWH in the dropdown list of the Profile textbox.

13Click 2. in each of the dialog boxes. You return to the PDM diagram.

PDM Getting Started

 

*HQHUDWH D WHVW GDWD FUHDWLRQ VFULSW

*HQHUDWH D WHVW GDWD FUHDWLRQ VFULSW

You will generate a test data script for the tables TITLE, AUTHOR, and TITLEAUTHOR. This script is named author.sql. You must execute the test data script in a database that contains the same tables that you use to generate the script.

1Select 'DWDEDVH*HQHUDWH 7HVW 'DWD.

The Test Data Generation dialog box opens to the Parameters page. It displays the test data generation parameters. Certain parameters are already selected.

2Select a destination directory.

3Type DXWKRU VTO in the File name box.

4Select the 6FULSW JHQHUDWLRQ radio button.

5Select the 'HOHWH 2OG 'DWD checkbox.

This option deletes all existing data in the tables so that they can be filled with new test data.

6Type in the 'HIDXOW 1XPEHU RI 5RZV textbox.

The default number of rows is the number of rows of test data that will be generated for tables that do not have a Number value defined in their property sheets.

7Select 3ULFH from the 'HIDXOW 1XPEHU 3URILOH dropdown list. Select 1DPHB,' from the 'HIDXOW &KDUDFWHU 3URILOH dropdown list.

 

PowerDesigner

&KDSWHU *HQHUDWLQJ D 7HVW 'DWD 6FULSW

Select 'DWH from the 'HIDXOW 'DWH 3URILOH dropdown list.

8Click the Selection tab. The Selection page appears.

9Click the 'HVHOHFW $OO tool from the tool bar at the top of the page.

All the checkboxes are cleared.

PDM Getting Started

 

*HQHUDWH D WHVW GDWD FUHDWLRQ VFULSW

10 Select the $87+25, 7,7/( and 7,7/($87+25 tables from the list.

11Click 2. to start the generation.

A Progress window briefly shows the test data generation progress. A Result dialog box asks you if you want to Edit or Close the newly generated file.

12Click &ORVH to close the Test Data Generation dialog box. You return to the PDM diagram.

 

PowerDesigner

Соседние файлы в папке PowerDesigner 9