Bert, Group 50
Test Discipline
Revision History: current version v3, v2
For testing to work:
- #1) Classpaths must be correct & include
MySQL java database connector
- #2) Your machine
must be connected to JCU network in order for program to connect to manning.cs.jcu.edu.au,
(the default database).
- #3) Sun ONE Studios 4 must be installed,
the update must be installed, and the JUnit addon must be installed.
- #4) Tomcat must be installed & working
- (preferably the version of Tomcat which comes with SunStudios).
Installing SunStudios JUnit addon:
- If you don't already have JUnit addon (check Tools->JUnit) then
you may need to use the update centre to get a copy.
- Select "Update Centre" when you first initiate Sun Studios Environment.
- Connected to the update centre and download the Junit addon.
- Username: "joeblack202"
- Password: "password"
- Once installed, navigate to it through the "Tools" drop down.
Sunstudios JUnit Testing:
- If not already you run build_all.bat (in the first level
of the unzipped directory) to build all classes except the test classes
- #1) Open Sun Studios, and mount the directory you unzipped.
Use the "filesystems" panel to navigate to "bert\control"
and highlight/select all the use case tests classes (they all start with "UC"),
open them and hit "build all" (F11). Providing
you installed the SunStudios JUnit addon correctly they should all compile
without error.
- #2) Open all these use case tests classes (in SunStudios)
& execute them one at a time.
- NOTE: Notice that all use case test
require that the database is reset to its origional stage. For instance, "UC6_ManageEmployees_Test"
adds a new employee called "dmitry" (hey - that's you!), & deletes
the employee "benjamin" (which seems strangely appropriate). If
this was run twice without reset database values the test would fail to add
"dmitry" (since he already exists), and fail to delete "benjamin"
(because he's already been deleted). I've written the method "clearAndPopulateAllTablesWithTestData()"
in "DBSetupServices" to serve this purpose. All use cases call this
method at the beginning of their execution.