Friday, 14 October 2011

How to test ADF Business Components

Now that you have basic ADFbc ready for your service layer, it is very important to be able to test them. JDeveloper provides a very easy way to test your business layer.
There is AM Tester that you can invoke by just right click on the AM and that will let you browse, cretae, update and delete data for all VOs included in the AM.
Follow these steps to test the HumanResourceAM cretaed earlier.
  1. Right click on HumanResourceAM in JDeveloper and select Run.
  2. Click on Connect. It will use the DB connection that you used when generate ADFbc.
  3. This will show Business Components browser for the AM.
  4. Double click on Locations1 and it will show data from Locations table in a form.
  5. Now click on Department2. This will show you all Departments with LOC = NEW YORK because that is your current location row. Go to Location tab and use Blue ">" icon to move to next row. Now come back to Department2 tab and see that rows shown for Dept table are changed to show Departments with LOC = DALLAS. This shows you how automatic master-child works.
  6. Similarly you can browse Deparment to Employee master child and other VOs.
  7. Now click green "+" icon in Locatin tab. This allows you to create a new row for Location table. Enter values for LOC = SFO and LName = San Francisco attributes.
  8. Now go to Department2 tab. Notice there are no rows show as this is new location. 
  9. Click "+" green icon to create new department. Notice that LOC attribute is automatically populated with SFO because this deparment is created via view link.
  10. Populate other fields and click on Green Arrow icon. This will commit all the changes to the DB.
  11. Query Employee1 and enter comm = 100 and tab. Click on Green Arrow icon. This will commit all the changes to the DB.
  12. Use Blue ">" icon to go to some other row. Click on Red "x" icon to delete current row. Click on Green Arrow icon. This will commit all the changes to the DB.
  13. Close the AM tester and Re-run and verify all the changes you have made.

1 comment:

  1. Thanks for sharing the wonderful information about the components and very well judged points were mentioned
    Thanks for sharing