Creating simple test data using tRowGenerator
This recipe shows how tRowGenerator
allows dummy data to be created for test purposes.
Getting ready
- Open the
jo_cook_ch10_0100_tRowGenerator
job. - Open the
tRowGenerator
component.
How to do it...
The steps for creating simple test data using tRowGenerator are as follows:
- Click on the Functions cell for customerId and select Numeric.sequence.
- Click on the Functions cell for firstName and select TalendDataGenerator.getFirstName.
- Click on the Functions cell for lastName and select TalendDataGenerator.getLastName.
- Click on the Functions cell for DOB and select TalendDate.getRandomDate. Your
tRowGenerator
should be as shown in the following screenshot: - Exit the
tRowGenerator
component, and run the job.
How it works...
Talend provides a set of random generators for different field types to enable test data to be created very easily. So, as you can see, we are using a sequence to create sequential customer key, random first names and last names, and a random...