Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

In NetBeans, right click the file you are creating tests for. Under Tools=>Create Tests, a dialog should come up:

Image Added

Give it a class name (the automatic one should be fine) and make sure the location is in Test Packages. 

Rename each test function to say exactly what it tests, i.e. testSavePatientShouldUsePrivileges or testSavePatientShouldSavePatient

 

 

To add in data to be tested for a table, make sure to add a Test-inititalData.xml file into your src/test/resources:

...

(NOTE: the src/test/resources folder should automatically come under the heading 'Other Test Resources' – if not, right click your project in Netbeans and choose Reload POM)

 

 

In addition, make sure your table mapping .hbm.xml file is defined in the test-hibernate.cfg.xml file:

...