## Bert Deployment Instructions.

- Assumption 1: Classpath is correct containing MySQL java database connector and JUnit
- Assumption 2: Connected to JCU network in order for program to connect to manning.cs.jcu.edu.au, where the database currently resides
- Assumption 3: Sun ONE Studios 4 is installed, the update is installed, and the JUnit addon is installed.
- Assumption 4: Tomcat is installed and working - (preferably the version of Tomcat which comes with SunStudios).

MySQL Java Connector Setup:

- Download the MySQL Java Connector from www.mysql.org.
- Unzip this into an appropriate directory (eg: "C:\mysql-connector-java-3.0.6-stable").
- Add the connector JAR file ("mysql-connector-java-3.0.6-stable-bin.jar") to your currenly classpath
- Make a copy of the connector JAR to the classpath used by Sun Studios "C:\Program Files\s1studio_jdk\j2sdk1.4.1_02\jre\lib" (or else our JUnit testing won't work).

1) Bert Setup/Build:

- #1) Download and unzip the install file (g50_bert_install.zip) to any directory
- #2) Run build_all.bat (In the first level of the unzipped directory). This will build all classes (including the gui classes), but will most likely be unsuccessful at compiling the use case tests under "bert/control". These were written by the junit addon for Sun Studios, so you'll probably have to compile these in the Sun Studios environment.
- #3) Open Sun Studios, make a new project, and mount the directory you unzipped. Use the "filesystems" panel to navigate to "bert\control" and highlight/select all the use case tests classes (all the classess starting with "UC"), open them and hit "build all" (Shift F11). Providing you installed the SunStudios JUnit correctly they should all compile without error.

2) JUnit Testing:

- #1) Open all the use case tests classes in SunStudios (as above) and execute them one at a time.
- Notice that all the use cases require that the database is reset to it's origional stage. For instance, "UC6_ManageEmployees_Test" adds a new employee called "dmitry" (hey - that's yoy!), and 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.

3) Bert GUI and Robot Demonstration:

- #1) Execute run_gui.bat to execute BERT as a regular Java applicaiton.
  - If an error message "jdbc drive not found" appears on startup, then you have not installed the MySQL Java Connector correctly
- #2) Run run_robot_demo.bat to see the robot testing of:
  - entering an incorrect date and trying to view bookings (produces error message),
  - entering an correct date and viewing bookings (no error message this time),
  - attempting to book a room (will only work if there is no conflicting booking), and then view bookings again
- All this JFrame/JPanel gui stuff was included only to demonstrate we understand JRobot. Our real objective was to get the program working as a jsp website.

4) Bert JSP Website:

- #1) Now all classes have been compiled copy the "bert" directory (with all the class files) to the "\classes" directory under tomcat.
- #2) Copy the "bert_jsp/bert" directory (with all the jsp files) to the "\webapps\ROOT" directory under tomcat.
  - NOTE: Tomcat comes with Sun Studios, so we set that up to work, and used "D:\s1studio_jdk\s1studio\tomcat401\classes" and "D:\s1studio_jdk\s1studio\tomcat401\webapps\ROOT" respectively.
  - I'm pretty sure is should work with any version of tomcat.
- #3) Start tomcat/catelina by executing "bin\startup.bat" under the tomcat directory.
  - NOTE: If you have installed Tomcat as a stand alone, you will need to start an executable instead.
- #3) Open a web browser (preferrably Internet Explorer) and open the page "http://localhost:8080/bert/". You can start your navigation of the site at "http://localhost:8080/bert/login.jsp". Most, but not all senarios have been labelled in green.
  - NOTE: the "make_employee.jsp" page demonstrates how JavaScript can detect incorrect field values (eg: letters in the phone number fields) at the gui level.
  - NOTE: that none of the equipment booking is working at this stage.
  - Try logging in as a Cheryl the superuser (details are provided), and then go back an log in as Andrew the normal user. Notice that each take you to a different page. Priveledged options are prevented for normal users.

5) Database Access: (optional)
(use this to view the database as you make changes to it via the jsp pages).

- #1) Open a putty window and log onto manning (as yourself)
- #2) Type/copy this:
  - mysql -p -h manning.cs.jcu.edu.au -u g312_50
  - jrzCszB77
  - use g312_50db;
- #4) The following commands will be useful:
  - show tables; //show all tables (there should be only 3 at the moment).
  - select * from room_bookings; //use this to check you have added a new room booking
- #5) If have changed the database & you want to revert to the origional database (with 4 rows populated in each table) then cut and paste this mySQL source code.

If problems persist call 40553061.