Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Passenger Management System

This repository contains Java classes for managing a list of passengers, part of a larger project to demonstrate Java programming and unit testing techniques.

Purpose

The primary task of this project assignment is to provide a simple demonstration of handling objects within Java, specifically focusing on passenger management especially best practices in writing clean, testable code and implementing unit tests using JUnit.

Technologies and Packages Used

  • Java: The main programming language used for the development of the passenger management system.
  • JUnit: Utilized for unit testing to ensure the reliability and accuracy of the code.

Project Structure

  • Passenger.java: Defines the Passenger class with attributes such as name, ID, phone, etc., and includes methods to handle these attributes.
  • PassengerList.java: Manages a list of Passenger objects and includes methods to add and find passengers in the list.
  • PassengerTest.java: Contains unit tests for the Passenger class to verify the functionality of its methods.
  • PassengerListTest.java: Tests the methods of the PassengerList class, ensuring the list management works as expected.

Running the Tests

To run the unit tests for this project, you'll need Java and JUnit set up on your machine. Follow these steps:

  1. Clone this repository.
  2. Ensure that you have Java and JUnit installed on your system.
  3. Navigate to the project directory.
  4. Compile the classes, including the test classes. Use the following command if using a simple Java setup:
    javac -cp .;path_to_junit.jar *.java
    

Run the tests using Java. You can do this by running:
Replace path_to_junit.jar with the actual path to your JUnit jar file.

java -cp .;path_to_junit.jar org.junit.runner.JUnitCore ie.gmit.PassengerTest ie.gmit.PassengerListTest 

Replace path_to_junit.jar with the actual path to your JUnit jar file. This setup will execute all the tests defined in the test classes, outputting the results directly to your console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages