wiki:BuildInstructions

Version 3 (modified by 216009, 38 hours ago) ( diff )

--

Build Instructions

Development Environment Description

  • Programming Language: Java 17
  • IDE: IntelliJ IDEA / Eclipse / VS Code (Java support)
  • Database: PostgreSQL 15 (or compatible version)
  • JDBC Driver: PostgreSQL JDBC Driver 42.6.0 (postgresql-42.6.0.jar)
  • Download from: https://jdbc.postgresql.org/download.html
  • Add to project classpath or IDE libraries
  • Operating System: Windows / Linux / macOS
  • Build Tool: None required (plain Java compilation via IDE or javac)

Software Required

  • Java JDK 17 installed and configured (java -version to check).
  • PostgreSQL installed and running.
  • PostgreSQL JDBC driver included in the project classpath.
  • IDE (IntelliJ/Eclipse/VS Code) or command line compiler to build Java project.

Build Instructions

  1. Clone the project from your Git repository:
    git clone <repository_url>
    
  1. Open the project in your IDE.
  1. Add PostgreSQL JDBC jar (postgresql-42.6.0.jar) to the project libraries.
  1. Compile all .java files.
  1. Ensure database schema is created in PostgreSQL:
    • Run create_tables.sql to generate all tables.
    • Run data_load.sql for initial test data and constraints setup.

Launch Instructions

  1. Ensure PostgreSQL is running and accessible.
  1. Update JDBC connection settings in JDBC.getConnection() method with:
    • Host
    • Port
    • Database name
    • Username
    • Password
  1. Run the main class:
    java University
    
    or via IDE Run Configuration.
  1. The CLI menu will appear:
    • Administrator: manage universities, add professors/students, create subjects
    • Professor: assign grades to students
    • Student: enroll in subjects by choosing a professor instance

Testing Instructions

Administrator Use-case Test

  1. Launch program, select Admin Menu (1).
  2. Add a university.
  3. Verify in the database that table University contains the new entry:
    SELECT * FROM University;
    

Professor Use-case Test

  1. Launch program, select Professor Menu (2) → Assign Grade to Student.
  2. Select a professor, a subject they instruct, an enrolled student, and assign a grade (6-10).
  3. Verify that table Student_Subject has updated Final_Grade and Status = 'PASSED':
    SELECT * FROM Student_Subject WHERE Student_Id = <id> AND Subject_Id = <id> AND Professor_Id = <id>;
    

Student Use-case Test

  1. Launch program, select Student Menu (3) → Enroll in Subject.
  2. Select a student, available subject, and a professor instance.
  3. Verify that table Student_Subject has a new row successfully created with Status = 'PASSED':
    SELECT * FROM Student_Subject WHERE Student_Id = <id> AND Subject_Id = <id>;
    

Usernames and Passwords

  • Database: Use your local PostgreSQL credentials.
  • Application CLI: No credentials required for the prototype (IDs are selected dynamically from terminal lists).

Step-by-Step Mini Guide

  1. Launch application.
  2. Choose actor from main menu: Admin Menu / Professor Menu / Student Menu.
  3. Follow on-screen menus:
    • Admin: Add University → Add Professor → Add Student → Create Subject
    • Professor: Assign Grade → select professor → select subject → select student → enter grade
    • Student: Enroll in Subject → select student → select subject → select professor
  4. Verify actions in the database using standard SELECT queries.
Note: See TracWiki for help on using the wiki.